diff options
-rw-r--r-- | lib/markdown.jar | bin | 203558 -> 200024 bytes | |||
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 15 | ||||
-rw-r--r-- | src/Markdown/MarkdownProcessor.kt | 4 |
3 files changed, 9 insertions, 10 deletions
diff --git a/lib/markdown.jar b/lib/markdown.jar Binary files differindex 25fd2e69..5a7db1ed 100644 --- a/lib/markdown.jar +++ b/lib/markdown.jar diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index 5ceb7f3d..9ca3ad79 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -389,7 +389,6 @@ class DocumentationBuilder(val session: ResolveSession, fun ClassDescriptor.build(): DocumentationNode { val kind = when (getKind()) { ClassKind.OBJECT -> Kind.Object - ClassKind.CLASS_OBJECT -> Kind.Object ClassKind.TRAIT -> Kind.Interface ClassKind.ENUM_CLASS -> Kind.Enum ClassKind.ANNOTATION_CLASS -> Kind.AnnotationClass @@ -411,9 +410,9 @@ class DocumentationBuilder(val session: ResolveSession, } val members = getDefaultType().getMemberScope().getAllDescriptors().filter { it != getDefaultObjectDescriptor() } node.appendChildren(members, DocumentationReference.Kind.Member) - val classObjectDescriptor = getDefaultObjectDescriptor() - if (classObjectDescriptor != null) { - node.appendChildren(classObjectDescriptor.getDefaultType().getMemberScope().getAllDescriptors(), + val defaultObjectDescriptor = getDefaultObjectDescriptor() + if (defaultObjectDescriptor != null) { + node.appendChildren(defaultObjectDescriptor.getDefaultType().getMemberScope().getAllDescriptors(), DocumentationReference.Kind.Member) } node.appendAnnotations(this) @@ -429,8 +428,8 @@ class DocumentationBuilder(val session: ResolveSession, return node } - private fun DeclarationDescriptor.inClassObject() = - getContainingDeclaration().let { it is ClassDescriptor && it.getKind() == ClassKind.CLASS_OBJECT } + private fun DeclarationDescriptor.inDefaultObject() = + getContainingDeclaration().let { it is ClassDescriptor && it.isDefaultObject() } fun CallableMemberDescriptor.getExtensionClassDescriptor(): ClassifierDescriptor? { val extensionReceiver = getExtensionReceiverParameter() @@ -442,7 +441,7 @@ class DocumentationBuilder(val session: ResolveSession, } fun FunctionDescriptor.build(): DocumentationNode { - val node = DocumentationNode(this, if (inClassObject()) Kind.DefaultObjectFunction else Kind.Function) + val node = DocumentationNode(this, if (inDefaultObject()) Kind.DefaultObjectFunction else Kind.Function) node.appendInPageChildren(getTypeParameters(), DocumentationReference.Kind.Detail) getExtensionReceiverParameter()?.let { node.appendChild(it, DocumentationReference.Kind.Detail) } @@ -524,7 +523,7 @@ class DocumentationBuilder(val session: ResolveSession, } fun PropertyDescriptor.build(): DocumentationNode { - val node = DocumentationNode(this, if (inClassObject()) Kind.DefaultObjectProperty else Kind.Property) + val node = DocumentationNode(this, if (inDefaultObject()) Kind.DefaultObjectProperty else Kind.Property) node.appendInPageChildren(getTypeParameters(), DocumentationReference.Kind.Detail) getExtensionReceiverParameter()?.let { node.appendChild(it, DocumentationReference.Kind.Detail) } node.appendType(getReturnType()) diff --git a/src/Markdown/MarkdownProcessor.kt b/src/Markdown/MarkdownProcessor.kt index 7e601905..a9b7003f 100644 --- a/src/Markdown/MarkdownProcessor.kt +++ b/src/Markdown/MarkdownProcessor.kt @@ -134,12 +134,12 @@ public fun MarkdownNode.toHtml(): String { fun parseMarkdown(markdown: String): MarkdownNode { if (markdown.isEmpty()) return MarkdownNode(LeafASTNode(MarkdownElementTypes.MARKDOWN_FILE, 0, 0), null, markdown) - return MarkdownNode(MarkdownParser(CommonMarkMarkerProcessor.Factory()).buildMarkdownTreeFromString(markdown), null, markdown) + return MarkdownNode(MarkdownParser(CommonMarkMarkerProcessor.Factory).buildMarkdownTreeFromString(markdown), null, markdown) } fun markdownToHtml(markdown: String): String { - val tree = MarkdownParser(CommonMarkMarkerProcessor.Factory()).buildMarkdownTreeFromString(markdown) + val tree = MarkdownParser(CommonMarkMarkerProcessor.Factory).buildMarkdownTreeFromString(markdown) val markdownTree = MarkdownNode(tree, null, markdown) val ast = markdownTree.toTestString() return markdownTree.toHtml() |