aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/pages
diff options
context:
space:
mode:
authorMarcin Aman <maman@virtuslab.com>2020-05-31 21:02:46 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-06-09 17:18:17 +0200
commit77c8777b7f66bddd374d68decd507547d356d602 (patch)
treef941a53d1591c56edd454ef40068e831a4ed9d48 /core/src/main/kotlin/pages
parent902b670bc764a6db4f49f96d08f2115dd08bdf9b (diff)
downloaddokka-77c8777b7f66bddd374d68decd507547d356d602.tar.gz
dokka-77c8777b7f66bddd374d68decd507547d356d602.tar.bz2
dokka-77c8777b7f66bddd374d68decd507547d356d602.zip
Improve CSS, pages navigation tree and create anchors on page
Diffstat (limited to 'core/src/main/kotlin/pages')
-rw-r--r--core/src/main/kotlin/pages/ContentNodes.kt14
-rw-r--r--core/src/main/kotlin/pages/PageNodes.kt1
2 files changed, 11 insertions, 4 deletions
diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt
index 95b7b371..d6105bec 100644
--- a/core/src/main/kotlin/pages/ContentNodes.kt
+++ b/core/src/main/kotlin/pages/ContentNodes.kt
@@ -13,6 +13,8 @@ interface ContentNode : WithExtraProperties<ContentNode> {
val dci: DCI
val sourceSets: Set<SourceSetData>
val style: Set<Style>
+
+ fun hasAnyContent(): Boolean
}
/** Simple text */
@@ -24,6 +26,8 @@ data class ContentText(
override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty()
) : ContentNode {
override fun withNewExtras(newExtras: PropertyContainer<ContentNode>): ContentNode = copy(extra = newExtras)
+
+ override fun hasAnyContent(): Boolean = !text.isBlank()
}
// TODO: Remove
@@ -34,6 +38,8 @@ data class ContentBreakLine(
override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty()
) : ContentNode {
override fun withNewExtras(newExtras: PropertyContainer<ContentNode>): ContentNode = copy(extra = newExtras)
+
+ override fun hasAnyContent(): Boolean = true
}
/** Headers */
@@ -106,6 +112,8 @@ data class ContentEmbeddedResource(
/** Logical grouping of [ContentNode]s */
interface ContentComposite : ContentNode {
val children: List<ContentNode>
+
+ override fun hasAnyContent(): Boolean = children.any { it.hasAnyContent() }
}
/** Tables */
@@ -144,7 +152,7 @@ data class ContentGroup(
}
/**
- * @property groupName is used for finding and copying [ContentDivergentInstance]s when merging [ContentPage]s
+ * @property groupID is used for finding and copying [ContentDivergentInstance]s when merging [ContentPage]s
*/
data class ContentDivergentGroup(
override val children: List<ContentDivergentInstance>,
@@ -216,11 +224,11 @@ enum class ContentKind : Kind {
}
enum class TextStyle : Style {
- Bold, Italic, Strong, Strikethrough, Paragraph, Block, Span, Monospace, Indented
+ Bold, Italic, Strong, Strikethrough, Paragraph, Block, Monospace, Indented, Cover, UnderCoverText
}
enum class ContentStyle : Style {
- RowTitle, TabbedContent, TabbedContentBody, WithExtraAttributes
+ RowTitle, TabbedContent, WithExtraAttributes
}
object CommentTable: Style
diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt
index b28e36d6..42ca25cc 100644
--- a/core/src/main/kotlin/pages/PageNodes.kt
+++ b/core/src/main/kotlin/pages/PageNodes.kt
@@ -89,7 +89,6 @@ class PackagePageNode(
override val name: String,
override val content: ContentNode,
override val dri: Set<DRI>,
-
override val documentable: Documentable?,
override val children: List<PageNode>,
override val embeddedResources: List<String> = listOf()