From 02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Thu, 31 Aug 2023 20:16:01 +0200 Subject: Enable explicit API mode (#3139) --- .../org/jetbrains/dokka/analysis/markdown/jb/MarkdownApi.kt | 2 +- .../org/jetbrains/dokka/analysis/markdown/jb/MarkdownParser.kt | 8 ++++---- .../kotlin/org/jetbrains/dokka/analysis/markdown/jb/ParseUtils.kt | 2 +- .../kotlin/org/jetbrains/dokka/analysis/markdown/jb/Parser.kt | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'subprojects/analysis-markdown-jb/src') diff --git a/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/MarkdownApi.kt b/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/MarkdownApi.kt index 58ab5e70..bc56b596 100644 --- a/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/MarkdownApi.kt +++ b/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/MarkdownApi.kt @@ -9,4 +9,4 @@ import org.jetbrains.dokka.InternalDokkaApi // TODO [beresnev] move/rename if it's only used for CustomDocTag. for now left as is for compatibility @InternalDokkaApi -val MARKDOWN_ELEMENT_FILE_NAME = MarkdownElementTypes.MARKDOWN_FILE.name +public val MARKDOWN_ELEMENT_FILE_NAME: String = MarkdownElementTypes.MARKDOWN_FILE.name diff --git a/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/MarkdownParser.kt b/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/MarkdownParser.kt index 00f1e25d..256c7b98 100644 --- a/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/MarkdownParser.kt +++ b/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/MarkdownParser.kt @@ -24,7 +24,7 @@ import java.net.URL import org.intellij.markdown.parser.MarkdownParser as IntellijMarkdownParser @InternalDokkaApi -open class MarkdownParser( +public open class MarkdownParser( private val externalDri: (String) -> DRI?, private val kdocLocation: String?, ) : Parser() { @@ -45,7 +45,7 @@ open class MarkdownParser( return CustomDocTag(children = parsed, params = emptyMap(), name = "") } - override fun preparse(text: String) = text.replace("\r\n", "\n").replace("\r", "\n") + override fun preparse(text: String): String = text.replace("\r\n", "\n").replace("\r", "\n") override fun parseTagWithBody(tagName: String, content: String): TagWrapper = when (tagName) { @@ -501,8 +501,8 @@ open class MarkdownParser( ) - companion object { - fun DRI.fqDeclarationName(): String? { + public companion object { + public fun DRI.fqDeclarationName(): String? { if (this.target !is PointingToDeclaration) { return null } diff --git a/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/ParseUtils.kt b/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/ParseUtils.kt index ba5d2df2..0293d470 100644 --- a/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/ParseUtils.kt +++ b/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/ParseUtils.kt @@ -13,7 +13,7 @@ import org.jsoup.internal.StringUtil import org.jsoup.nodes.Entities @InternalDokkaApi -fun String.parseHtmlEncodedWithNormalisedSpaces( +public fun String.parseHtmlEncodedWithNormalisedSpaces( renderWhiteCharactersAsSpaces: Boolean ): List { val accum = StringBuilder() diff --git a/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/Parser.kt b/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/Parser.kt index e97d7b0c..28afa0c4 100644 --- a/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/Parser.kt +++ b/subprojects/analysis-markdown-jb/src/main/kotlin/org/jetbrains/dokka/analysis/markdown/jb/Parser.kt @@ -8,13 +8,13 @@ import org.jetbrains.dokka.InternalDokkaApi import org.jetbrains.dokka.model.doc.* @InternalDokkaApi -abstract class Parser { +public abstract class Parser { - abstract fun parseStringToDocNode(extractedString: String): DocTag + public abstract fun parseStringToDocNode(extractedString: String): DocTag protected abstract fun preparse(text: String): String - open fun parse(text: String): DocumentationNode = + public open fun parse(text: String): DocumentationNode = DocumentationNode(extractTagsToListOfPairs(preparse(text)).map { (tag, content) -> parseTagWithBody(tag, content) }) protected open fun parseTagWithBody(tagName: String, content: String): TagWrapper = -- cgit