diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-10-14 16:08:10 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-10-14 16:08:10 +0400 |
commit | 280dc29f14d0aa66f4c799d15d478a6d9920841e (patch) | |
tree | f87e78e16cdb762ce88e3d3b6f1925b437b67f30 /src/Formats/StructuredFormatService.kt | |
parent | 66e5e16bbe4b73531a34ad033d49350dd019d182 (diff) | |
download | dokka-280dc29f14d0aa66f4c799d15d478a6d9920841e.tar.gz dokka-280dc29f14d0aa66f4c799d15d478a6d9920841e.tar.bz2 dokka-280dc29f14d0aa66f4c799d15d478a6d9920841e.zip |
Use module.md to get package descriptors, filter sections with names of members, fix markdown for kotlin website, propagate content from parent to child with the name of section.
Diffstat (limited to 'src/Formats/StructuredFormatService.kt')
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index 5287e688..280aa6b5 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -73,7 +73,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi } fun appendDescription(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) { - val described = nodes.filter { !it.doc.isEmpty } + val described = nodes.filter { !it.content.isEmpty } if (described.any()) { val single = described.size == 1 appendHeader(to, "Description", 3) @@ -81,11 +81,13 @@ public abstract class StructuredFormatService(val locationService: LocationServi if (!single) { appendBlockCode(to, formatText(location, languageService.render(node))) } - appendLine(to, formatText(location,node.doc.description)) + appendLine(to, formatText(location,node.content.description)) appendLine(to) - for ((label, section) in node.doc.sections) { + for ((label, section) in node.content.sections) { if (label.startsWith("$")) continue + if (node.members.any { it.name == label }) + continue appendLine(to, formatStrong(formatText(label))) appendLine(to, formatText(location, section)) } @@ -95,14 +97,14 @@ public abstract class StructuredFormatService(val locationService: LocationServi fun appendSummary(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) { val breakdownBySummary = nodes.groupByTo(LinkedHashMap()) { node -> - node.doc.summary + formatText(location, node.summary) } for ((summary, items) in breakdownBySummary) { items.forEach { appendBlockCode(to, formatText(location, languageService.render(it))) } - appendLine(to, formatText(location, summary)) + appendLine(to, summary) appendLine(to) } } @@ -131,7 +133,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi appendText(to, formatLink(memberLocation)) } appendTableCell(to) { - val breakdownBySummary = members.groupBy { formatText(location, it.doc.summary) } + val breakdownBySummary = members.groupBy { formatText(location, it.summary) } for ((summary, items) in breakdownBySummary) { for (signature in items) { appendBlockCode(to, formatText(location, languageService.render(signature))) |