From 69abe980af6d0e83c04d355ac27aa0acec56e0e9 Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Mon, 14 Jul 2014 18:38:22 +0400 Subject: Do not include block if no members, display description and summary. --- src/Formats/MarkdownFormatService.kt | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/Formats/MarkdownFormatService.kt b/src/Formats/MarkdownFormatService.kt index 27ebb8ce..2e541113 100644 --- a/src/Formats/MarkdownFormatService.kt +++ b/src/Formats/MarkdownFormatService.kt @@ -8,10 +8,11 @@ public class MarkdownFormatService(val locationService: LocationService, appendln(node.path.map { "[${it.name}](${locationService.relativeLocation(node, it, extension)})" }.joinToString(" / ")) appendln() appendln("# ${node.name}") + appendln(node.doc.summary) appendln("```") appendln(signatureGenerator.render(node)) appendln("```") - appendln(node.doc.summary) + appendln(node.doc.description) appendln() for (section in node.doc.sections) { append("### ") @@ -19,15 +20,17 @@ public class MarkdownFormatService(val locationService: LocationService, appendln(section.text) } - appendln("### Members") - appendln("| Name | Signature | Summary |") - appendln("|------|-----------|---------|") - for (member in node.members.sortBy { it.name }) { - val relativePath = locationService.relativeLocation(node, member, extension) - append("|[${member.name}](${relativePath})") - append("|${signatureGenerator.render(member)}") - append("|${member.doc.summary} ") - appendln("|") + if (node.members.any()) { + appendln("### Members") + appendln("| Name | Signature | Summary |") + appendln("|------|-----------|---------|") + for (member in node.members.sortBy { it.name }) { + val relativePath = locationService.relativeLocation(node, member, extension) + append("|[${member.name}](${relativePath})") + append("|`${signatureGenerator.render(member)}`") + append("|${member.doc.summary} ") + appendln("|") + } } } } -- cgit