diff options
| author | Marcin Aman <marcin.aman@gmail.com> | 2020-10-01 08:38:31 +0200 |
|---|---|---|
| committer | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2020-10-08 16:35:33 +0200 |
| commit | 68553bf4c1de2b640a376f0ac4755a6c5bc7dd79 (patch) | |
| tree | 034b33e61920f1fa21a1ba44f28ce1d529a79b17 /plugins/base/src/main/kotlin/translators | |
| parent | fd88f63f7f2874df7a4a58a5c7126d8a5a15225b (diff) | |
| download | dokka-68553bf4c1de2b640a376f0ac4755a6c5bc7dd79.tar.gz dokka-68553bf4c1de2b640a376f0ac4755a6c5bc7dd79.tar.bz2 dokka-68553bf4c1de2b640a376f0ac4755a6c5bc7dd79.zip | |
Improve styles
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
| -rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt | 34 | ||||
| -rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt | 4 |
2 files changed, 21 insertions, 17 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 41881baf..f5fbb51e 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -117,7 +117,7 @@ open class DefaultPageCreator( link(it.name, it.dri) if (it.sourceSets.size == 1 || (documentations.isNotEmpty() && haveSameContent)) { - documentations.first()?.let { firstSentenceComment(kind = ContentKind.Comment, content = it) } + documentations.first()?.let { firstSentenceComment(kind = ContentKind.Comment, content = it.root) } } } } @@ -169,8 +169,8 @@ open class DefaultPageCreator( ) { link(it.name, it.dri, kind = ContentKind.Main) sourceSetDependentHint(it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependentHint) { - contentForBrief(it) +buildSignature(it) + contentForBrief(it) } } s.safeAs<WithExtraProperties<Documentable>>()?.let { it.extra[InheritorsInfo] }?.let { inheritors -> @@ -206,8 +206,8 @@ open class DefaultPageCreator( group(kind = ContentKind.Cover) { cover(e.name) sourceSetDependentHint(e.dri, e.sourceSets.toSet()) { - +contentForDescription(e) +buildSignature(e) + +contentForDescription(e) } } group(styles = setOf(ContentStyle.TabbedContent)) { @@ -226,8 +226,8 @@ open class DefaultPageCreator( group(kind = ContentKind.Cover, sourceSets = mainSourcesetData + extensions.sourceSets) { cover(c.name.orEmpty()) sourceSetDependentHint(c.dri, c.sourceSets) { - +contentForDescription(c) +buildSignature(c) + +contentForDescription(c) } } @@ -249,8 +249,8 @@ open class DefaultPageCreator( kind = ContentKind.SourceSetDependentHint, styles = emptySet() ) { - contentForBrief(it) +buildSignature(it) + contentForBrief(it) } } } @@ -267,8 +267,8 @@ open class DefaultPageCreator( ) { link(it.name, it.dri) sourceSetDependentHint(it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependentHint) { - contentForBrief(it) +buildSignature(it) + contentForBrief(it) } } } @@ -464,7 +464,8 @@ open class DefaultPageCreator( documentable.sourceSets.forEach { sourceSet -> documentable.documentation[sourceSet]?.children?.firstOrNull()?.root?.let { group(sourceSets = setOf(sourceSet), kind = ContentKind.BriefComment) { - comment(it) + if(documentable.hasSeparatePage) firstSentenceComment(it) + else comment(it) } } } @@ -495,13 +496,13 @@ open class DefaultPageCreator( } divergentGroup(ContentDivergentGroup.GroupID("member")) { instance(setOf(d.dri), d.sourceSets.toSet()) { - before { - +contentForDescription(d) - +contentForComments(d) - } divergent(kind = ContentKind.Symbol) { +buildSignature(d) } + after { + +contentForDescription(d) + +contentForComments(d) + } } } } @@ -535,15 +536,15 @@ open class DefaultPageCreator( ) { elements.map { instance(setOf(it.dri), it.sourceSets.toSet(), extra = PropertyContainer.withAll(SymbolAnchorHint)) { - before { - contentForBrief(it) - contentForSinceKotlin(it) - } divergent { group { +buildSignature(it) } } + after { + contentForBrief(it) + contentForSinceKotlin(it) + } } } } @@ -566,4 +567,7 @@ open class DefaultPageCreator( private val Documentable.descriptions: SourceSetDependent<Description> get() = groupedTags.withTypeUnnamed<Description>() + + private val Documentable.hasSeparatePage: Boolean + get() = this !is DTypeAlias } diff --git a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt index 42700f20..4bebd9f1 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt @@ -289,14 +289,14 @@ open class PageContentBuilder( } fun firstSentenceComment( - content: Description, + content: DocTag, kind: Kind = ContentKind.Comment, sourceSets: Set<DokkaSourceSet> = mainSourcesetData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra ){ val builtDescription = commentsConverter.buildContent( - content.root, + content, DCI(mainDRI, kind), sourceSets ) |
