diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2019-12-13 16:24:16 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2019-12-16 16:43:35 +0100 |
commit | 288431f21b18f5311de77c9afcb29346cb7c6498 (patch) | |
tree | 0dbadd88532daae26f4edacba15cd43c3cc19b20 /core/src/main/kotlin/model/doc | |
parent | 54f587baf12ecf8f0115cb406203df14c4d6ab5d (diff) | |
download | dokka-288431f21b18f5311de77c9afcb29346cb7c6498.tar.gz dokka-288431f21b18f5311de77c9afcb29346cb7c6498.tar.bz2 dokka-288431f21b18f5311de77c9afcb29346cb7c6498.zip |
Changes naming and applies pull request's requirements
Diffstat (limited to 'core/src/main/kotlin/model/doc')
-rw-r--r-- | core/src/main/kotlin/model/doc/DocNode.kt | 74 | ||||
-rw-r--r-- | core/src/main/kotlin/model/doc/DocTag.kt | 81 | ||||
-rw-r--r-- | core/src/main/kotlin/model/doc/DocType.kt | 18 | ||||
-rw-r--r-- | core/src/main/kotlin/model/doc/DocumentationNode.kt | 4 | ||||
-rw-r--r-- | core/src/main/kotlin/model/doc/TagWrapper.kt | 18 |
5 files changed, 101 insertions, 94 deletions
diff --git a/core/src/main/kotlin/model/doc/DocNode.kt b/core/src/main/kotlin/model/doc/DocNode.kt deleted file mode 100644 index 0c643551..00000000 --- a/core/src/main/kotlin/model/doc/DocNode.kt +++ /dev/null @@ -1,74 +0,0 @@ -package model.doc - -import org.jetbrains.dokka.links.DRI - -sealed class DocNode( - val children: List<DocNode>, - val params: Map<String, String> -) - -class A(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Big(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class B(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class BlockQuote(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Cite(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Code(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Dd(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Dfn(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Dir(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Div(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Dl(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Dt(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Em(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Font(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Footer(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Frame(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class FrameSet(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class H1(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class H2(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class H3(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class H4(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class H5(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class H6(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Head(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Header(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Html(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class I(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class IFrame(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Img(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Input(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Li(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Link(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Listing(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Main(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Menu(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Meta(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Nav(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class NoFrames(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class NoScript(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Ol(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class P(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Pre(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Script(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Section(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Small(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Span(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Strong(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Sub(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Sup(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Table(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Text(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap(), val body: String = "") : DocNode(children, params) -class TBody(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Td(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class TFoot(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Th(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class THead(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Title(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Tr(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Tt(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class U(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Ul(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class Var(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params) -class DocumentationLink(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap(), val dri: DRI) : DocNode(children, params) -class HorizontalRule() : DocNode(emptyList(), emptyMap()) -class CustomNode(children: List<DocNode> = emptyList(), params: Map<String, String> = emptyMap()) : DocNode(children, params)
\ No newline at end of file diff --git a/core/src/main/kotlin/model/doc/DocTag.kt b/core/src/main/kotlin/model/doc/DocTag.kt new file mode 100644 index 00000000..6d5850a0 --- /dev/null +++ b/core/src/main/kotlin/model/doc/DocTag.kt @@ -0,0 +1,81 @@ +package org.jetbrains.dokka.model.doc + +import org.jetbrains.dokka.links.DRI + +sealed class DocTag( + val children: List<DocTag>, + val params: Map<String, String> +) { + fun docTagSummary(): String { + if(this.children.isEmpty() && this is Text) + return this.body + + return this.children.joinToString(" ") { it.docTagSummary() } + } +} + +class A(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Big(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class B(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class BlockQuote(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Cite(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Code(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Dd(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Dfn(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Dir(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Div(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Dl(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Dt(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Em(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Font(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Footer(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Frame(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class FrameSet(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class H1(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class H2(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class H3(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class H4(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class H5(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class H6(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Head(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Header(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Html(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class I(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class IFrame(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Img(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Input(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Li(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Link(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Listing(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Main(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Menu(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Meta(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Nav(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class NoFrames(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class NoScript(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Ol(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class P(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Pre(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Script(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Section(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Small(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Span(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Strong(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Sub(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Sup(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Table(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Text(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap(), val body: String = "") : DocTag(children, params) +class TBody(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Td(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class TFoot(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Th(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class THead(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Title(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Tr(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Tt(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class U(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Ul(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class Var(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params) +class DocumentationLink(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap(), val dri: DRI) : DocTag(children, params) +class HorizontalRule : DocTag(emptyList(), emptyMap()) +class CustomDocTag(children: List<DocTag> = emptyList(), params: Map<String, String> = emptyMap()) : DocTag(children, params)
\ No newline at end of file diff --git a/core/src/main/kotlin/model/doc/DocType.kt b/core/src/main/kotlin/model/doc/DocType.kt deleted file mode 100644 index 0888876e..00000000 --- a/core/src/main/kotlin/model/doc/DocType.kt +++ /dev/null @@ -1,18 +0,0 @@ -package model.doc - -sealed class DocType(val root: DocNode) -class Description(root: DocNode) : DocType(root) -class Author(root: DocNode) : DocType(root) -class Version(root: DocNode) : DocType(root) -class Since(root: DocNode) : DocType(root) -class See(root: DocNode, val name: String) : DocType(root) -class Param(root: DocNode, val name: String) : DocType(root) -class Return(root: DocNode) : DocType(root) -class Receiver(root: DocNode) : DocType(root) -class Constructor(root: DocNode) : DocType(root) -class Throws(root: DocNode, val name: String) : DocType(root) -class Sample(root: DocNode, val name: String) : DocType(root) -class Deprecated(root: DocNode) : DocType(root) -class Property(root: DocNode, val name: String) : DocType(root) -class Suppress(root: DocNode) : DocType(root) -class CustomTag(root: DocNode, val name: String) : DocType(root) diff --git a/core/src/main/kotlin/model/doc/DocumentationNode.kt b/core/src/main/kotlin/model/doc/DocumentationNode.kt index 73424616..a143a941 100644 --- a/core/src/main/kotlin/model/doc/DocumentationNode.kt +++ b/core/src/main/kotlin/model/doc/DocumentationNode.kt @@ -1,3 +1,3 @@ -package model.doc +package org.jetbrains.dokka.model.doc -data class DocumentationNode(val children: List<DocType>)
\ No newline at end of file +data class DocumentationNode(val children: List<TagWrapper>)
\ No newline at end of file diff --git a/core/src/main/kotlin/model/doc/TagWrapper.kt b/core/src/main/kotlin/model/doc/TagWrapper.kt new file mode 100644 index 00000000..8def013e --- /dev/null +++ b/core/src/main/kotlin/model/doc/TagWrapper.kt @@ -0,0 +1,18 @@ +package org.jetbrains.dokka.model.doc + +sealed class TagWrapper(val root: DocTag) +class Description(root: DocTag) : TagWrapper(root) +class Author(root: DocTag) : TagWrapper(root) +class Version(root: DocTag) : TagWrapper(root) +class Since(root: DocTag) : TagWrapper(root) +class See(root: DocTag, val name: String) : TagWrapper(root) +class Param(root: DocTag, val name: String) : TagWrapper(root) +class Return(root: DocTag) : TagWrapper(root) +class Receiver(root: DocTag) : TagWrapper(root) +class Constructor(root: DocTag) : TagWrapper(root) +class Throws(root: DocTag, val name: String) : TagWrapper(root) +class Sample(root: DocTag, val name: String) : TagWrapper(root) +class Deprecated(root: DocTag) : TagWrapper(root) +class Property(root: DocTag, val name: String) : TagWrapper(root) +class Suppress(root: DocTag) : TagWrapper(root) +class CustomWrapperTag(root: DocTag, val name: String) : TagWrapper(root)
\ No newline at end of file |