diff options
Diffstat (limited to 'src/Kotlin')
-rw-r--r-- | src/Kotlin/ContentBuilder.kt | 26 | ||||
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 3 | ||||
-rw-r--r-- | src/Kotlin/KotlinLanguageService.kt | 3 |
3 files changed, 26 insertions, 6 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt index 462e886e..0c82a522 100644 --- a/src/Kotlin/ContentBuilder.kt +++ b/src/Kotlin/ContentBuilder.kt @@ -26,7 +26,7 @@ public fun DocumentationBuilder.buildContent(tree: MarkdownNode, descriptor: Dec parent.append(nodeStack.pop()) } MarkdownElementTypes.LIST_ITEM -> { - nodeStack.push(ContentBlock()) + nodeStack.push(ContentListItem()) processChildren() parent.append(nodeStack.pop()) } @@ -60,12 +60,26 @@ public fun DocumentationBuilder.buildContent(tree: MarkdownNode, descriptor: Dec processChildren() parent.append(nodeStack.pop()) } + MarkdownElementTypes.INLINE_LINK -> { + val label = node.child(MarkdownElementTypes.LINK_TEXT)?.child(MarkdownTokenTypes.TEXT) + val destination = node.child(MarkdownElementTypes.LINK_DESTINATION) + if (label != null) { + if (destination != null) { + val link = ContentExternalLink(destination.text) + link.append(ContentText(label.text)) + parent.append(link) + } else { + val link = ContentExternalLink(label.text) + link.append(ContentText(label.text)) + parent.append(link) + } + } + } MarkdownElementTypes.SHORT_REFERENCE_LINK -> { - val label = node.child(MarkdownElementTypes.LINK_LABEL) - val target = label?.child(MarkdownTokenTypes.TEXT) - if (target != null) { - val link = ContentExternalLink(target.text) - link.append(ContentText(target.text)) + val label = node.child(MarkdownElementTypes.LINK_LABEL)?.child(MarkdownTokenTypes.TEXT) + if (label != null) { + val link = ContentExternalLink(label.text) + link.append(ContentText(label.text)) parent.append(link) } } diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index c2d28312..7d38480a 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -338,6 +338,9 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati } + if ("." !in reference) + return null + val names = reference.split('.') val result = names.fold<String, DeclarationDescriptor?>(context) {(nextContext, name) -> nextContext?.let { resolveReference(it, name) } diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt index c7fabda9..c9275879 100644 --- a/src/Kotlin/KotlinLanguageService.kt +++ b/src/Kotlin/KotlinLanguageService.kt @@ -11,6 +11,9 @@ import org.jetbrains.dokka.ContentNode import org.jetbrains.dokka import org.jetbrains.dokka.ContentText +/** + * Implements [LanguageService] and provides rendering of symbols in Kotlin language + */ class KotlinLanguageService : LanguageService { override fun render(node: DocumentationNode): ContentNode { return dokka.content { |