aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/pages/ContentNodes.kt
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-10-31 23:13:09 +0100
committerKamil Doległo <kamilok1965@interia.pl>2019-10-31 23:13:36 +0100
commit41b9edd65e58735e69f29369942ef953baadeb3b (patch)
tree97979272908bc99fb38f1354e4de589b7b556e21 /core/src/main/kotlin/pages/ContentNodes.kt
parent5f36bdd75e32743f54193aa8eff8cd5185b3cf67 (diff)
downloaddokka-41b9edd65e58735e69f29369942ef953baadeb3b.tar.gz
dokka-41b9edd65e58735e69f29369942ef953baadeb3b.tar.bz2
dokka-41b9edd65e58735e69f29369942ef953baadeb3b.zip
Add markdown content builder
Diffstat (limited to 'core/src/main/kotlin/pages/ContentNodes.kt')
-rw-r--r--core/src/main/kotlin/pages/ContentNodes.kt41
1 files changed, 27 insertions, 14 deletions
diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt
index afb81995..2dffbb17 100644
--- a/core/src/main/kotlin/pages/ContentNodes.kt
+++ b/core/src/main/kotlin/pages/ContentNodes.kt
@@ -9,8 +9,8 @@ interface ContentNode {
/** Comment consisting of parts, eg. [ContentText]s, [ContentLink]s and so on */
data class ContentComment(val parts: List<ContentNode>,
- override val platforms: List<PlatformData>,
- override val annotations: List<Annotation> = emptyList()
+ override val platforms: List<PlatformData>,
+ override val annotations: List<Annotation> = emptyList()
): ContentNode
/** Simple text */
@@ -20,24 +20,24 @@ data class ContentText(val text: String,
): ContentNode
///** Headers */ TODO for next iteration
-data class ContentHeader(val text: String,
+data class ContentHeader(val items: List<ContentNode>,
val level: Int,
- override val platforms: List<PlatformData>,
- override val annotations: List<Annotation> = emptyList()
+ override val platforms: List<PlatformData>,
+ override val annotations: List<Annotation> = emptyList()
): ContentNode
/** Lists */
data class ContentList(val items: List<ContentNode>,
- val ordered: Boolean,
- override val platforms: List<PlatformData>,
- override val annotations: List<Annotation> = emptyList()
+ val ordered: Boolean,
+ override val platforms: List<PlatformData>,
+ override val annotations: List<Annotation> = emptyList()
): ContentNode
/** Styled elements, eg. bold, strikethrough, emphasis and so on **/
data class ContentStyle(val items: List<ContentNode>,
- val style: ContentNode,
- override val platforms: List<PlatformData>,
- override val annotations: List<Annotation> = emptyList()
+ val style: IStyle,
+ override val platforms: List<PlatformData>,
+ override val annotations: List<Annotation> = emptyList()
): ContentNode
/** Code blocks */
@@ -53,13 +53,20 @@ data class ContentSymbol(val parts: List<ContentNode>,
override val annotations: List<Annotation> = emptyList()
): ContentNode
-/** All links that have te be resolved */
+/** All links to classes, packages, etc. that have te be resolved */
data class ContentLink(val text: String,
val address: DRI,
override val platforms: List<PlatformData>,
override val annotations: List<Annotation> = emptyList()
): ContentNode
+/** All links that do not need to be resolved */
+data class ContentResolvedLink(val text: String,
+ val address: String,
+ override val platforms: List<PlatformData>,
+ override val annotations: List<Annotation> = emptyList()
+): ContentNode
+
/** Blocks of [ContentNode]s with name, eg. Functions, Types, Properties, etc. */
data class ContentBlock(val name: String,
val children: List<ContentNode>,
@@ -69,9 +76,15 @@ data class ContentBlock(val name: String,
/** Logical grouping of [ContentNode]s, eg. [ContentLink], [ContentText] and [ContentSymbol] for one entity */
data class ContentGroup(val children: List<ContentNode>,
- override val platforms: List<PlatformData>,
- override val annotations: List<Annotation> = emptyList()
+ override val platforms: List<PlatformData>,
+ override val annotations: List<Annotation> = emptyList()
): ContentNode
/** All annotations */
data class Annotation(val name: String)
+
+interface IStyle
+
+enum class Style: IStyle {
+ Emphasis, Strong, Paragraph
+} \ No newline at end of file