aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorFilip Zybała <fzybala@virtuslab.com>2020-04-01 17:20:44 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-04-06 14:23:54 +0200
commit2b921897aa90216d78e05165d5ce122814ead74c (patch)
treef89765c4bd17a1af3651596c377b84e3f0d146c6 /core
parenta1866dd98d291a6a2a538e88348c53ff08c812eb (diff)
downloaddokka-2b921897aa90216d78e05165d5ce122814ead74c.tar.gz
dokka-2b921897aa90216d78e05165d5ce122814ead74c.tar.bz2
dokka-2b921897aa90216d78e05165d5ce122814ead74c.zip
Changed see also parsing, added see also section to pages
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/model/doc/TagWrapper.kt4
-rw-r--r--core/src/main/kotlin/parsers/MarkdownParser.kt10
-rw-r--r--core/src/main/kotlin/parsers/Parser.kt2
3 files changed, 13 insertions, 3 deletions
diff --git a/core/src/main/kotlin/model/doc/TagWrapper.kt b/core/src/main/kotlin/model/doc/TagWrapper.kt
index 9dda7c8f..6652f5a1 100644
--- a/core/src/main/kotlin/model/doc/TagWrapper.kt
+++ b/core/src/main/kotlin/model/doc/TagWrapper.kt
@@ -1,5 +1,7 @@
package org.jetbrains.dokka.model.doc
+import org.jetbrains.dokka.links.DRI
+
sealed class TagWrapper(val root: DocTag) {
override fun equals(other: Any?): Boolean =
@@ -20,7 +22,7 @@ class Description(root: DocTag) : TagWrapper(root)
class Author(root: DocTag) : TagWrapper(root)
class Version(root: DocTag) : TagWrapper(root)
class Since(root: DocTag) : TagWrapper(root)
-class See(root: DocTag, name: String) : NamedTagWrapper(root, name)
+class See(root: DocTag, name: String, val address: DRI?) : NamedTagWrapper(root, name)
class Param(root: DocTag, name: String) : NamedTagWrapper(root, name)
class Return(root: DocTag) : TagWrapper(root)
class Receiver(root: DocTag) : TagWrapper(root)
diff --git a/core/src/main/kotlin/parsers/MarkdownParser.kt b/core/src/main/kotlin/parsers/MarkdownParser.kt
index 617d351b..782a6504 100644
--- a/core/src/main/kotlin/parsers/MarkdownParser.kt
+++ b/core/src/main/kotlin/parsers/MarkdownParser.kt
@@ -361,7 +361,15 @@ class MarkdownParser(
)
KDocKnownTag.RECEIVER -> Receiver(parseStringToDocNode(it.getContent()))
KDocKnownTag.RETURN -> Return(parseStringToDocNode(it.getContent()))
- KDocKnownTag.SEE -> See(parseStringToDocNode(it.getContent()), it.getSubjectName().orEmpty())
+ KDocKnownTag.SEE -> See(
+ parseStringToDocNode(it.getContent()),
+ it.getSubjectName().orEmpty(),
+ parseStringToDocNode("[${it.getSubjectName()}]")
+ .let {
+ if(it is DocumentationLink) it.dri
+ else null
+ }
+ )
KDocKnownTag.SINCE -> Since(parseStringToDocNode(it.getContent()))
KDocKnownTag.CONSTRUCTOR -> Constructor(parseStringToDocNode(it.getContent()))
KDocKnownTag.PROPERTY -> Property(
diff --git a/core/src/main/kotlin/parsers/Parser.kt b/core/src/main/kotlin/parsers/Parser.kt
index f03e57be..11dcafb0 100644
--- a/core/src/main/kotlin/parsers/Parser.kt
+++ b/core/src/main/kotlin/parsers/Parser.kt
@@ -17,7 +17,7 @@ abstract class Parser {
"author" -> Author(parseStringToDocNode(it.second))
"version" -> Version(parseStringToDocNode(it.second))
"since" -> Since(parseStringToDocNode(it.second))
- "see" -> See(parseStringToDocNode(it.second.substringAfter(' ')), it.second.substringBefore(' '))
+ "see" -> See(parseStringToDocNode(it.second.substringAfter(' ')), it.second.substringBefore(' '), null)
"param" -> Param(parseStringToDocNode(it.second.substringAfter(' ')), it.second.substringBefore(' '))
"property" -> Property(parseStringToDocNode(it.second.substringAfter(' ')), it.second.substringBefore(' '))
"return" -> Return(parseStringToDocNode(it.second))