diff options
Diffstat (limited to 'src/Kotlin')
-rw-r--r-- | src/Kotlin/ContentBuilder.kt | 6 | ||||
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt index 742ac58b..f454c8fe 100644 --- a/src/Kotlin/ContentBuilder.kt +++ b/src/Kotlin/ContentBuilder.kt @@ -31,6 +31,12 @@ public fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver } when (node.type) { + MarkdownElementTypes.ATX_1 -> appendNodeWithChildren(ContentHeading(1)) + MarkdownElementTypes.ATX_2 -> appendNodeWithChildren(ContentHeading(2)) + MarkdownElementTypes.ATX_3 -> appendNodeWithChildren(ContentHeading(3)) + MarkdownElementTypes.ATX_4 -> appendNodeWithChildren(ContentHeading(4)) + MarkdownElementTypes.ATX_5 -> appendNodeWithChildren(ContentHeading(5)) + MarkdownElementTypes.ATX_6 -> appendNodeWithChildren(ContentHeading(6)) MarkdownElementTypes.UNORDERED_LIST -> appendNodeWithChildren(ContentUnorderedList()) MarkdownElementTypes.ORDERED_LIST -> appendNodeWithChildren(ContentOrderedList()) MarkdownElementTypes.LIST_ITEM -> appendNodeWithChildren(ContentListItem()) diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index e193817a..8910c3e3 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -389,7 +389,8 @@ class DocumentationBuilder(val session: ResolveSession, return this } - fun DocumentationNode.appendFragments(fragments: Collection<PackageFragmentDescriptor>) { + fun DocumentationModule.appendFragments(fragments: Collection<PackageFragmentDescriptor>, + packageContent: Map<String, Content>) { val descriptors = hashMapOf<String, List<DeclarationDescriptor>>() for ((name, parts) in fragments.groupBy { it.fqName }) { descriptors.put(name.asString(), parts.flatMap { it.getMemberScope().getAllDescriptors() }) @@ -397,7 +398,7 @@ class DocumentationBuilder(val session: ResolveSession, for ((packageName, declarations) in descriptors) { if (options.skipEmptyPackages && declarations.none { it.isDocumented()}) continue logger.info(" package $packageName: ${declarations.count()} declarations") - val packageNode = findOrCreatePackageNode(packageName) + val packageNode = findOrCreatePackageNode(packageName, packageContent) val externalClassNodes = hashMapOf<FqName, DocumentationNode>() declarations.forEach { descriptor -> if (descriptor.isDocumented()) { |