aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/StructuredFormatService.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-03 15:57:16 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-03 15:57:16 +0400
commita52e1d543d22fdacf87ec00988b753d2d1107c1d (patch)
tree0b27f4aa91494d715044af79dead49c6e4f3fc00 /src/Formats/StructuredFormatService.kt
parente93b629e4b2fa70330d94b8cb77f3ae34d1a9960 (diff)
downloaddokka-a52e1d543d22fdacf87ec00988b753d2d1107c1d.tar.gz
dokka-a52e1d543d22fdacf87ec00988b753d2d1107c1d.tar.bz2
dokka-a52e1d543d22fdacf87ec00988b753d2d1107c1d.zip
Work on cross-references.
Diffstat (limited to 'src/Formats/StructuredFormatService.kt')
-rw-r--r--src/Formats/StructuredFormatService.kt50
1 files changed, 28 insertions, 22 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt
index 40feaf21..f2fb9b41 100644
--- a/src/Formats/StructuredFormatService.kt
+++ b/src/Formats/StructuredFormatService.kt
@@ -103,30 +103,36 @@ public abstract class StructuredFormatService(val locationService: LocationServi
}
for (node in nodes) {
- if (node.members.any()) {
- appendHeader(to, "Members", 3)
+ appendSection("Members", node.members, node, to)
+ appendSection("Extensions", node.extensions, node, to)
+ appendSection("Links", node.links, node, to)
+ }
+ }
- val children = node.members.sortBy { it.name }
- val membersMap = children.groupBy { link(node, it) }
+ private fun StructuredFormatService.appendSection(caption: String, nodes: List<DocumentationNode>, node: DocumentationNode, to: StringBuilder) {
+ if (nodes.any()) {
+ appendHeader(to, caption, 3)
- appendTable(to) {
- appendTableBody(to) {
- for ((location, members) in membersMap) {
- appendTableRow(to) {
- appendTableCell(to) {
- appendText(to, formatLink(location))
- }
- appendTableCell(to) {
- val breakdownBySummary = members.groupBy { it.doc.summary }
- for ((summary, items) in breakdownBySummary) {
- val signatures = items.map { formatCode("${languageService.render(it)}") }
- for (signature in signatures) {
- appendText(to, signature)
- }
-
- if (!summary.isEmpty()) {
- appendText(to, formatText(summary))
- }
+ val children = nodes.sortBy { it.name }
+ val membersMap = children.groupBy { link(node, it) }
+
+ appendTable(to) {
+ appendTableBody(to) {
+ for ((location, members) in membersMap) {
+ appendTableRow(to) {
+ appendTableCell(to) {
+ appendText(to, formatLink(location))
+ }
+ appendTableCell(to) {
+ val breakdownBySummary = members.groupBy { it.doc.summary }
+ for ((summary, items) in breakdownBySummary) {
+ val signatures = items.map { formatCode("${languageService.render(it)}") }
+ for (signature in signatures) {
+ appendText(to, signature)
+ }
+
+ if (!summary.isEmpty()) {
+ appendText(to, formatText(summary))
}
}
}