aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Content.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-26 21:34:27 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-26 21:34:27 +0100
commit4494fd064900fc9ddd9766eed581980c2e360e96 (patch)
tree7f953cc7b8d7d99bb7d64de495303d31b2ec39eb /src/Model/Content.kt
parent4b61be354510cf88fed33860c987bd210502e91d (diff)
downloaddokka-4494fd064900fc9ddd9766eed581980c2e360e96.tar.gz
dokka-4494fd064900fc9ddd9766eed581980c2e360e96.tar.bz2
dokka-4494fd064900fc9ddd9766eed581980c2e360e96.zip
allow applying different styles to different kinds of identifiers
Diffstat (limited to 'src/Model/Content.kt')
-rw-r--r--src/Model/Content.kt11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Model/Content.kt b/src/Model/Content.kt
index ca5dd49b..d343c648 100644
--- a/src/Model/Content.kt
+++ b/src/Model/Content.kt
@@ -26,9 +26,16 @@ public open class ContentBlock() : ContentNode() {
children.hashCode()
}
+enum class IdentifierKind {
+ TypeName
+ ParameterName
+ AnnotationName
+ Other
+}
+
public data class ContentText(val text: String) : ContentNode()
public data class ContentKeyword(val text: String) : ContentNode()
-public data class ContentIdentifier(val text: String) : ContentNode()
+public data class ContentIdentifier(val text: String, val kind: IdentifierKind = IdentifierKind.Other) : ContentNode()
public data class ContentSymbol(val text: String) : ContentNode()
public object ContentNonBreakingSpace: ContentNode()
@@ -89,7 +96,7 @@ fun content(body: ContentBlock.() -> Unit): ContentBlock {
fun ContentBlock.text(value: String) = append(ContentText(value))
fun ContentBlock.keyword(value: String) = append(ContentKeyword(value))
fun ContentBlock.symbol(value: String) = append(ContentSymbol(value))
-fun ContentBlock.identifier(value: String) = append(ContentIdentifier(value))
+fun ContentBlock.identifier(value: String, kind: IdentifierKind = IdentifierKind.Other) = append(ContentIdentifier(value, kind))
fun ContentBlock.nbsp() = append(ContentNonBreakingSpace)
fun ContentBlock.link(to: DocumentationNode, body: ContentBlock.() -> Unit) {