public static Optional<String> getSymbolLink(Symbol symbol, Path relativeTo) {
        Optional<String> linkId = symbol.getProperty(DocSymbolProvider.LINK_ID_PROPERTY, String.class);
        var relativeToParent = relativeTo.getParent();
        if (StringUtils.isBlank(symbol.getDefinitionFile())
                || linkId.isEmpty()
                || StringUtils.isBlank(linkId.get())
                || relativeToParent == null) {
            return Optional.empty();
        }
        return Optional.of(format(
                "./%s#%s",
                relativeToParent.relativize(Paths.get(symbol.getDefinitionFile())),
                linkId.get()));
    }
Gets a relative link pointing to a given symbol.

<p>If the given symbol has no definition file or no
{@link DocSymbolProvider#LINK_ID_PROPERTY}, the response will be empty.

@param symbol The symbol to link to.
@param relativeTo A path that the symbol should be relative to. This must be the
                  path to the file containing the link.
@return Optionally returns a relative link to the given symbol.
smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocgenUtils.java