diff options
Diffstat (limited to 'src/Formats')
-rw-r--r-- | src/Formats/HtmlFormatService.kt | 34 | ||||
-rw-r--r-- | src/Formats/JekyllFormatService.kt | 2 |
2 files changed, 20 insertions, 16 deletions
diff --git a/src/Formats/HtmlFormatService.kt b/src/Formats/HtmlFormatService.kt index a50f2c8b..1ae6a81b 100644 --- a/src/Formats/HtmlFormatService.kt +++ b/src/Formats/HtmlFormatService.kt @@ -9,12 +9,15 @@ public open class HtmlFormatService(locationService: LocationService, override public fun formatText(text: String): String { return text.htmlEscape() } + override fun formatSymbol(text: String): String { return "<span class=\"symbol\">${formatText(text)}</span>" } + override fun formatKeyword(text: String): String { return "<span class=\"keyword\">${formatText(text)}</span>" } + override fun formatIdentifier(text: String): String { return "<span class=\"identifier\">${formatText(text)}</span>" } @@ -122,23 +125,24 @@ public open class HtmlFormatService(locationService: LocationService, override fun appendOutlineChildren(to: StringBuilder, nodes: Iterable<DocumentationNode>) { } + override fun appendOutlineHeader(to: StringBuilder, node: DocumentationNode) { } +} - fun getPageTitle(nodes: Iterable<DocumentationNode>): String? { - val breakdownByLocation = nodes.groupBy { node -> formatPageTitle(node) } - return breakdownByLocation.keySet().singleOrNull() - } +fun getPageTitle(nodes: Iterable<DocumentationNode>): String? { + val breakdownByLocation = nodes.groupBy { node -> formatPageTitle(node) } + return breakdownByLocation.keySet().singleOrNull() +} - fun formatPageTitle(node: DocumentationNode): String { - val path = node.path - if (path.size() == 1) { - return path.first().name - } - val qualifiedName = path.drop(1).map { it.name }.filter { it.length() > 0 }.join(".") - if (qualifiedName.length() == 0 && path.size() == 2) { - return path.first().name + " / root package" - } - return path.first().name + " / " + qualifiedName +fun formatPageTitle(node: DocumentationNode): String { + val path = node.path + if (path.size() == 1) { + return path.first().name + } + val qualifiedName = path.drop(1).map { it.name }.filter { it.length() > 0 }.join(".") + if (qualifiedName.length() == 0 && path.size() == 2) { + return path.first().name + " / root package" } -}
\ No newline at end of file + return path.first().name + " / " + qualifiedName +} diff --git a/src/Formats/JekyllFormatService.kt b/src/Formats/JekyllFormatService.kt index 93861113..93ba4704 100644 --- a/src/Formats/JekyllFormatService.kt +++ b/src/Formats/JekyllFormatService.kt @@ -15,6 +15,6 @@ public open class JekyllFormatService(locationService: LocationService, } protected open fun appendFrontMatter(nodes: Iterable<DocumentationNode>, to: StringBuilder) { - to.appendln("title: ${nodes.first().name}") + to.appendln("title: ${getPageTitle(nodes)}") } }
\ No newline at end of file |