From 333091e5c5f896769c3371dd74c87a52ffa9562a Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Fri, 21 Aug 2020 10:19:07 +0200 Subject: Implement ParseModuleAndPackageDocFragments API --- core/src/main/kotlin/DokkaException.kt | 2 +- core/src/main/kotlin/model/doc/DocTag.kt | 167 +++++++++++++++++-------------- 2 files changed, 93 insertions(+), 76 deletions(-) (limited to 'core') diff --git a/core/src/main/kotlin/DokkaException.kt b/core/src/main/kotlin/DokkaException.kt index 0010249c..9a5e3d04 100644 --- a/core/src/main/kotlin/DokkaException.kt +++ b/core/src/main/kotlin/DokkaException.kt @@ -1,3 +1,3 @@ package org.jetbrains.dokka -class DokkaException(message: String) : RuntimeException(message) +open class DokkaException(message: String) : RuntimeException(message) diff --git a/core/src/main/kotlin/model/doc/DocTag.kt b/core/src/main/kotlin/model/doc/DocTag.kt index dc2cd2be..0d3b0612 100644 --- a/core/src/main/kotlin/model/doc/DocTag.kt +++ b/core/src/main/kotlin/model/doc/DocTag.kt @@ -9,88 +9,105 @@ sealed class DocTag( ) : WithChildren { override fun equals(other: Any?): Boolean = ( - other != null && - other::class == this::class && - this.children == (other as DocTag).children && - this.params == other.params - ) + other != null && + other::class == this::class && + this.children == (other as DocTag).children && + this.params == other.params + ) override fun hashCode(): Int = children.hashCode() + params.hashCode() } -class A(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Big(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class B(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class BlockQuote(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -object Br : DocTag(emptyList(), emptyMap()) -class Cite(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -sealed class Code(children: List, params: Map) : DocTag(children, params) -class CodeInline(children: List = emptyList(), params: Map = emptyMap()) : Code(children, params) -class CodeBlock(children: List = emptyList(), params: Map = emptyMap()) : Code(children, params) -class Dd(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Dfn(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Dir(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Div(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Dl(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Dt(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Em(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Font(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Footer(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Frame(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class FrameSet(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class H1(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class H2(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class H3(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class H4(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class H5(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class H6(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Head(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Header(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Html(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class I(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class IFrame(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Img(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Input(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Li(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Link(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Listing(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Main(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Menu(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Meta(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Nav(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class NoFrames(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class NoScript(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Ol(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class P(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Pre(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Script(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Section(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Small(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Span(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Strikethrough(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Strong(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Sub(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Sup(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Table(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Text(val body: String = "", children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) { +class A(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Big(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class B(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class BlockQuote(children: List = emptyList(), params: Map = emptyMap()) : + DocTag(children, params) + +object Br : DocTag(emptyList(), emptyMap()) +class Cite(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +sealed class Code(children: List, params: Map) : DocTag(children, params) +class CodeInline(children: List = emptyList(), params: Map = emptyMap()) : + Code(children, params) + +class CodeBlock(children: List = emptyList(), params: Map = emptyMap()) : Code(children, params) +class Dd(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Dfn(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Dir(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Div(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Dl(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Dt(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Em(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Font(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Footer(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Frame(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class FrameSet(children: List = emptyList(), params: Map = emptyMap()) : + DocTag(children, params) + +class H1(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class H2(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class H3(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class H4(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class H5(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class H6(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Head(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Header(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Html(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class I(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class IFrame(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Img(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Input(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Li(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Link(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Listing(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Main(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Menu(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Meta(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Nav(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class NoFrames(children: List = emptyList(), params: Map = emptyMap()) : + DocTag(children, params) + +class NoScript(children: List = emptyList(), params: Map = emptyMap()) : + DocTag(children, params) + +class Ol(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class P(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Pre(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Script(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Section(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Small(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Span(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Strikethrough(children: List = emptyList(), params: Map = emptyMap()) : + DocTag(children, params) + +class Strong(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Sub(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Sup(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Table(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Text(val body: String = "", children: List = emptyList(), params: Map = emptyMap()) : + DocTag(children, params) { override fun equals(other: Any?): Boolean = super.equals(other) && this.body == (other as Text).body override fun hashCode(): Int = super.hashCode() + body.hashCode() } -class TBody(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Td(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class TFoot(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Th(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class THead(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Title(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Tr(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Tt(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class U(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Ul(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class Var(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class DocumentationLink(val dri: DRI, children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) { + +class TBody(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Td(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class TFoot(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Th(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class THead(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Title(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Tr(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Tt(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class U(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Ul(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class Var(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class DocumentationLink(val dri: DRI, children: List = emptyList(), params: Map = emptyMap()) : + DocTag(children, params) { override fun equals(other: Any?): Boolean = super.equals(other) && this.dri == (other as DocumentationLink).dri override fun hashCode(): Int = super.hashCode() + dri.hashCode() } -object HorizontalRule : DocTag(emptyList(), emptyMap()) -class Index(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) -class CustomDocTag(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) + +object HorizontalRule : DocTag(emptyList(), emptyMap()) +class Index(children: List = emptyList(), params: Map = emptyMap()) : DocTag(children, params) +class CustomDocTag(children: List = emptyList(), params: Map = emptyMap()) : + DocTag(children, params) -- cgit