diff options
author | Zubakov <aleks.zubakov@gmail.com> | 2018-08-27 16:27:41 +0300 |
---|---|---|
committer | Zubakov <aleks.zubakov@gmail.com> | 2018-08-27 16:30:32 +0300 |
commit | 0b43db4ff81746e44d06780d8d14bb49dc1d87aa (patch) | |
tree | 86783b7a4be37295e00abfd10293360e1f97433f /core/src/main/kotlin/Formats | |
parent | b265a9ffacb8f8e8e6226a9458a92697b02355a8 (diff) | |
download | dokka-0b43db4ff81746e44d06780d8d14bb49dc1d87aa.tar.gz dokka-0b43db4ff81746e44d06780d8d14bb49dc1d87aa.tar.bz2 dokka-0b43db4ff81746e44d06780d8d14bb49dc1d87aa.zip |
Introduce origin reference kind, change documentation graph merge logic, minor refactoring
Diffstat (limited to 'core/src/main/kotlin/Formats')
-rw-r--r-- | core/src/main/kotlin/Formats/StructuredFormatService.kt | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index b810dfca..1ca636ec 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -192,22 +192,20 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, } } - open fun link(from: DocumentationNode, - to: DocumentationNode, - name: (DocumentationNode) -> String = DocumentationNode::name): FormatLink = link(from, to, extension, name) + open fun link( + from: DocumentationNode, + to: DocumentationNode, + name: (DocumentationNode) -> String = DocumentationNode::name + ): FormatLink = link(from, to, extension, name) + + open fun link( + from: DocumentationNode, + to: DocumentationNode, + extension: String, + name: (DocumentationNode) -> String = DocumentationNode::name + ): FormatLink = + FormatLink(name(to), from.location().relativePathTo(to.location())) - open fun link(from: DocumentationNode, - to: DocumentationNode, - extension: String, - name: (DocumentationNode) -> String = DocumentationNode::name): FormatLink { - if (to.owner?.kind == NodeKind.GroupNode) - return link(from, to.owner!!, extension, name) - - if (from.owner?.kind == NodeKind.GroupNode) - return link(from.owner!!, to, extension, name) - - return FormatLink(name(to), from.location().relativePathTo(to.location())) - } fun locationHref(from: Location, to: DocumentationNode): String { val topLevelPage = to.references(RefKind.TopLevelPage).singleOrNull()?.to |