diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-03-03 17:13:56 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-03-03 17:13:56 +0100 |
commit | e961960934e2f43cdfc6ad63126c005866a60003 (patch) | |
tree | 7fba0c2f6c5656bcf9adf4b7e9c7f52635c85355 /src/Java | |
parent | fe09a2623c32bb71c98b79380014f782f688bdc4 (diff) | |
download | dokka-e961960934e2f43cdfc6ad63126c005866a60003.tar.gz dokka-e961960934e2f43cdfc6ad63126c005866a60003.tar.bz2 dokka-e961960934e2f43cdfc6ad63126c005866a60003.zip |
use custom 'docref' attribute to represent doc link destination instead o marking href with ##
Diffstat (limited to 'src/Java')
-rw-r--r-- | src/Java/JavaDocumentationBuilder.kt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt index 4b1b8116..5720850d 100644 --- a/src/Java/JavaDocumentationBuilder.kt +++ b/src/Java/JavaDocumentationBuilder.kt @@ -91,14 +91,13 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions, } private fun createLink(element: Element): ContentBlock { + val docref = element.attr("docref") + if (docref != null) { + return ContentNodeLazyLink(docref, {() -> refGraph.lookup(docref)}) + } val href = element.attr("href") if (href != null) { - if (href.startsWith("##")) { - val signature = href.substring(2) - return ContentNodeLazyLink(signature, {() -> refGraph.lookup(signature)}) - } else { - return ContentExternalLink(href) - } + return ContentExternalLink(href) } else { return ContentBlock() } @@ -126,7 +125,7 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions, val valueElement = tag.linkElement() val linkSignature = resolveLink(valueElement) if (linkSignature != null) { - val link = "<a href=\"##$linkSignature\">${valueElement!!.getText().htmlEscape()}</a>" + val link = "<a docref=\"$linkSignature\">${valueElement!!.getText().htmlEscape()}</a>" if (tag.getName() == "link") "<code>$link</code>" else link } else if (valueElement != null) { |