diff options
| author | Dmitry Jemerov <yole@jetbrains.com> | 2015-01-14 18:46:36 +0100 |
|---|---|---|
| committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-01-14 18:46:36 +0100 |
| commit | 6146fa8b996a7d74f58ce1c926c114bc54bda0d1 (patch) | |
| tree | 6ccba7e186e1e0de734fc9744274c982d396c0cd /src/Formats | |
| parent | 60e610ebdd86663bedf113d2235ac3c8364171d0 (diff) | |
| download | dokka-6146fa8b996a7d74f58ce1c926c114bc54bda0d1.tar.gz dokka-6146fa8b996a7d74f58ce1c926c114bc54bda0d1.tar.bz2 dokka-6146fa8b996a7d74f58ce1c926c114bc54bda0d1.zip | |
generate source links in the documentation
Diffstat (limited to 'src/Formats')
| -rw-r--r-- | src/Formats/StructuredFormatService.kt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index bfb69d1d..458fda35 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -121,6 +121,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi appendBlockCode(to, formatText(location, languageService.render(it))) it.appendOverrides(to) it.appendDeprecation(to) + it.appendSourceLink(to) } appendLine(to, summary) appendLine(to) @@ -148,6 +149,13 @@ public abstract class StructuredFormatService(val locationService: LocationServi } } + private fun DocumentationNode.appendSourceLink(to: StringBuilder) { + val sourceUrl = details(DocumentationNode.Kind.SourceUrl).firstOrNull() + if (sourceUrl != null) { + appendLine(to, formatLink("Source", sourceUrl.name)) + } + } + fun appendLocation(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) { val breakdownByName = nodes.groupBy { node -> node.name } for ((name, items) in breakdownByName) { |
