diff options
| author | Dmitry Jemerov <yole@jetbrains.com> | 2016-01-04 19:39:39 +0100 |
|---|---|---|
| committer | Dmitry Jemerov <yole@jetbrains.com> | 2016-01-04 19:39:39 +0100 |
| commit | 3b3c2841674d9b7044494d16d4396662d273f1f9 (patch) | |
| tree | 268f6d3085b05da702d5d61eff505000cd9ea36a /core/src | |
| parent | 0260b37dd051fc5d728820fa20b0ad7d94c33c0f (diff) | |
| download | dokka-3b3c2841674d9b7044494d16d4396662d273f1f9.tar.gz dokka-3b3c2841674d9b7044494d16d4396662d273f1f9.tar.bz2 dokka-3b3c2841674d9b7044494d16d4396662d273f1f9.zip | |
cleanup: remove redundant 'public' modifiers
Diffstat (limited to 'core/src')
26 files changed, 174 insertions, 172 deletions
diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt index a5e35a0e..b0c39ee5 100644 --- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt +++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt @@ -57,7 +57,7 @@ import java.io.File * $messageCollector: required by compiler infrastructure and will receive all compiler messages * $body: optional and can be used to configure environment without creating local variable */ -public class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { +class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { val configuration = CompilerConfiguration(); init { @@ -119,14 +119,14 @@ public class AnalysisEnvironment(val messageCollector: MessageCollector) : Dispo /** * Classpath for this environment. */ - public val classpath: List<File> + val classpath: List<File> get() = configuration.jvmClasspathRoots /** * Adds list of paths to classpath. * $paths: collection of files to add */ - public fun addClasspath(paths: List<File>) { + fun addClasspath(paths: List<File>) { configuration.addJvmClasspathRoots(paths) } @@ -134,14 +134,14 @@ public class AnalysisEnvironment(val messageCollector: MessageCollector) : Dispo * Adds path to classpath. * $path: path to add */ - public fun addClasspath(path: File) { + fun addClasspath(path: File) { configuration.addJvmClasspathRoot(path) } /** * List of source roots for this environment. */ - public val sources: List<String> + val sources: List<String> get() = configuration.get(CommonConfigurationKeys.CONTENT_ROOTS) ?.filterIsInstance<KotlinSourceRoot>() ?.map { it.path } ?: emptyList() @@ -150,25 +150,25 @@ public class AnalysisEnvironment(val messageCollector: MessageCollector) : Dispo * Adds list of paths to source roots. * $list: collection of files to add */ - public fun addSources(list: List<String>) { + fun addSources(list: List<String>) { list.forEach { configuration.add(CommonConfigurationKeys.CONTENT_ROOTS, contentRootFromPath(it)) } } - public fun addRoots(list: List<ContentRoot>) { + fun addRoots(list: List<ContentRoot>) { configuration.addAll(CommonConfigurationKeys.CONTENT_ROOTS, list) } /** * Disposes the environment and frees all associated resources. */ - public override fun dispose() { + override fun dispose() { Disposer.dispose(this) } } -public fun contentRootFromPath(path: String): ContentRoot { +fun contentRootFromPath(path: String): ContentRoot { val file = File(path) return if (file.extension == "java") JavaSourceRoot(file, null) else KotlinSourceRoot(path) } diff --git a/core/src/main/kotlin/Formats/FormatDescriptor.kt b/core/src/main/kotlin/Formats/FormatDescriptor.kt index 0c7ca794..e384f223 100644 --- a/core/src/main/kotlin/Formats/FormatDescriptor.kt +++ b/core/src/main/kotlin/Formats/FormatDescriptor.kt @@ -3,7 +3,7 @@ package org.jetbrains.dokka.Formats import org.jetbrains.dokka.* import kotlin.reflect.KClass -public interface FormatDescriptor { +interface FormatDescriptor { val formatServiceClass: KClass<out FormatService>? val outlineServiceClass: KClass<out OutlineFormatService>? val generatorServiceClass: KClass<out Generator> diff --git a/core/src/main/kotlin/Formats/FormatService.kt b/core/src/main/kotlin/Formats/FormatService.kt index 73e54956..aa4e925c 100644 --- a/core/src/main/kotlin/Formats/FormatService.kt +++ b/core/src/main/kotlin/Formats/FormatService.kt @@ -7,7 +7,7 @@ package org.jetbrains.dokka * * [HtmlFormatService] – outputs documentation to HTML format * * [MarkdownFormatService] – outputs documentation in Markdown format */ -public interface FormatService { +interface FormatService { /** Returns extension for output files */ val extension: String diff --git a/core/src/main/kotlin/Formats/HtmlFormatService.kt b/core/src/main/kotlin/Formats/HtmlFormatService.kt index d513e41f..f78439ba 100644 --- a/core/src/main/kotlin/Formats/HtmlFormatService.kt +++ b/core/src/main/kotlin/Formats/HtmlFormatService.kt @@ -6,11 +6,11 @@ import java.io.File import java.nio.file.Path import java.nio.file.Paths -public open class HtmlFormatService @Inject constructor(@Named("folders") locationService: LocationService, - signatureGenerator: LanguageService, - val templateService: HtmlTemplateService) +open class HtmlFormatService @Inject constructor(@Named("folders") locationService: LocationService, + signatureGenerator: LanguageService, + val templateService: HtmlTemplateService) : StructuredFormatService(locationService, signatureGenerator, "html"), OutlineFormatService { - override public fun formatText(text: String): String { + override fun formatText(text: String): String { return text.htmlEscape() } diff --git a/core/src/main/kotlin/Formats/HtmlTemplateService.kt b/core/src/main/kotlin/Formats/HtmlTemplateService.kt index ae42a31b..13587b05 100644 --- a/core/src/main/kotlin/Formats/HtmlTemplateService.kt +++ b/core/src/main/kotlin/Formats/HtmlTemplateService.kt @@ -2,12 +2,12 @@ package org.jetbrains.dokka import java.nio.file.Path -public interface HtmlTemplateService { +interface HtmlTemplateService { fun appendHeader(to: StringBuilder, title: String?, basePath: Path) fun appendFooter(to: StringBuilder) companion object { - public fun default(css: String? = null): HtmlTemplateService { + fun default(css: String? = null): HtmlTemplateService { return object : HtmlTemplateService { override fun appendFooter(to: StringBuilder) { to.appendln("</BODY>") diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt index 870347ab..f869bc75 100644 --- a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt +++ b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt @@ -2,7 +2,7 @@ package org.jetbrains.dokka import com.google.inject.Inject -public class KotlinWebsiteFormatService @Inject constructor(locationService: LocationService, +class KotlinWebsiteFormatService @Inject constructor(locationService: LocationService, signatureGenerator: LanguageService) : JekyllFormatService(locationService, signatureGenerator, "html") { private var needHardLineBreaks = false @@ -13,7 +13,7 @@ public class KotlinWebsiteFormatService @Inject constructor(locationService: Loc to.appendln("layout: api") } - override public fun formatBreadcrumbs(items: Iterable<FormatLink>): String { + override fun formatBreadcrumbs(items: Iterable<FormatLink>): String { items.drop(1) if (items.count() > 1) { @@ -25,7 +25,7 @@ public class KotlinWebsiteFormatService @Inject constructor(locationService: Loc return "" } - override public fun formatCode(code: String): String = if (code.length > 0) "<code>$code</code>" else "" + override fun formatCode(code: String): String = if (code.length > 0) "<code>$code</code>" else "" override fun formatStrikethrough(text: String): String = "<s>$text</s>" @@ -106,7 +106,7 @@ public class KotlinWebsiteFormatService @Inject constructor(locationService: Loc to.appendln("\n</td>") } - override public fun appendBlockCode(to: StringBuilder, line: String, language: String) { + override fun appendBlockCode(to: StringBuilder, line: String, language: String) { if (language.isNotEmpty()) { super.appendBlockCode(to, line, language) } else { diff --git a/core/src/main/kotlin/Formats/MarkdownFormatService.kt b/core/src/main/kotlin/Formats/MarkdownFormatService.kt index 07202b7e..4e16b1a8 100644 --- a/core/src/main/kotlin/Formats/MarkdownFormatService.kt +++ b/core/src/main/kotlin/Formats/MarkdownFormatService.kt @@ -3,16 +3,16 @@ package org.jetbrains.dokka import com.google.inject.Inject -public open class MarkdownFormatService +open class MarkdownFormatService @Inject constructor(locationService: LocationService, signatureGenerator: LanguageService, linkExtension: String = "md") : StructuredFormatService(locationService, signatureGenerator, "md", linkExtension) { - override public fun formatBreadcrumbs(items: Iterable<FormatLink>): String { + override fun formatBreadcrumbs(items: Iterable<FormatLink>): String { return items.map { formatLink(it) }.joinToString(" / ") } - override public fun formatText(text: String): String { + override fun formatText(text: String): String { return text.htmlEscape() } @@ -27,19 +27,19 @@ public open class MarkdownFormatService return text.htmlEscape() } - override public fun formatCode(code: String): String { + override fun formatCode(code: String): String { return "`$code`" } - override public fun formatUnorderedList(text: String): String = text + "\n" - override public fun formatOrderedList(text: String): String = text + "\n" + override fun formatUnorderedList(text: String): String = text + "\n" + override fun formatOrderedList(text: String): String = text + "\n" override fun formatListItem(text: String, kind: ListKind): String { val itemText = if (text.endsWith("\n")) text else text + "\n" return if (kind == ListKind.Unordered) "* $itemText" else "1. $itemText" } - override public fun formatStrong(text: String): String { + override fun formatStrong(text: String): String { return "**$text**" } @@ -55,7 +55,7 @@ public open class MarkdownFormatService return "[$text]($href)" } - override public fun appendLine(to: StringBuilder, text: String) { + override fun appendLine(to: StringBuilder, text: String) { to.appendln(text) } @@ -63,19 +63,19 @@ public open class MarkdownFormatService // no anchors in Markdown } - override public fun appendParagraph(to: StringBuilder, text: String) { + override fun appendParagraph(to: StringBuilder, text: String) { to.appendln() to.appendln(text) to.appendln() } - override public fun appendHeader(to: StringBuilder, text: String, level: Int) { + override fun appendHeader(to: StringBuilder, text: String, level: Int) { appendLine(to) appendLine(to, "${"#".repeat(level)} $text") appendLine(to) } - override public fun appendBlockCode(to: StringBuilder, line: String, language: String) { + override fun appendBlockCode(to: StringBuilder, line: String, language: String) { appendLine(to) to.appendln("``` ${language}") to.appendln(line) diff --git a/core/src/main/kotlin/Formats/OutlineService.kt b/core/src/main/kotlin/Formats/OutlineService.kt index 6626cf51..3c31ba57 100644 --- a/core/src/main/kotlin/Formats/OutlineService.kt +++ b/core/src/main/kotlin/Formats/OutlineService.kt @@ -5,14 +5,14 @@ import java.io.File /** * Service for building the outline of the package contents. */ -public interface OutlineFormatService { +interface OutlineFormatService { fun getOutlineFileName(location: Location): File - public fun appendOutlineHeader(location: Location, node: DocumentationNode, to: StringBuilder) - public fun appendOutlineLevel(to: StringBuilder, body: () -> Unit) + fun appendOutlineHeader(location: Location, node: DocumentationNode, to: StringBuilder) + fun appendOutlineLevel(to: StringBuilder, body: () -> Unit) /** Appends formatted outline to [StringBuilder](to) using specified [location] */ - public fun appendOutline(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) { + fun appendOutline(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) { for (node in nodes) { appendOutlineHeader(location, node, to) if (node.members.any()) { diff --git a/core/src/main/kotlin/Generation/ConsoleGenerator.kt b/core/src/main/kotlin/Generation/ConsoleGenerator.kt index 803a16e4..301f86b9 100644 --- a/core/src/main/kotlin/Generation/ConsoleGenerator.kt +++ b/core/src/main/kotlin/Generation/ConsoleGenerator.kt @@ -1,9 +1,9 @@ package org.jetbrains.dokka -public class ConsoleGenerator(val signatureGenerator: LanguageService, val locationService: LocationService) { +class ConsoleGenerator(val signatureGenerator: LanguageService, val locationService: LocationService) { val IndentStep = " " - public fun generate(node: DocumentationNode, indent: String = "") { + fun generate(node: DocumentationNode, indent: String = "") { println("@${locationService.location(node).path}") generateHeader(node, indent) //generateDetails(node, indent) @@ -11,7 +11,7 @@ public class ConsoleGenerator(val signatureGenerator: LanguageService, val locat generateLinks(node, indent) } - public fun generateHeader(node: DocumentationNode, indent: String = "") { + fun generateHeader(node: DocumentationNode, indent: String = "") { println(indent + signatureGenerator.render(node)) val docString = node.content.toString() if (!docString.isEmpty()) @@ -19,19 +19,19 @@ public class ConsoleGenerator(val signatureGenerator: LanguageService, val locat println() } - public fun generateMembers(node: DocumentationNode, indent: String = "") { + fun generateMembers(node: DocumentationNode, indent: String = "") { val items = node.members.sortedBy { it.name } for (child in items) generate(child, indent + IndentStep) } - public fun generateDetails(node: DocumentationNode, indent: String = "") { + fun generateDetails(node: DocumentationNode, indent: String = "") { val items = node.details for (child in items) generate(child, indent + " ") } - public fun generateLinks(node: DocumentationNode, indent: String = "") { + fun generateLinks(node: DocumentationNode, indent: String = "") { val items = node.links if (items.isEmpty()) return diff --git a/core/src/main/kotlin/Generation/FileGenerator.kt b/core/src/main/kotlin/Generation/FileGenerator.kt index e3d1d1fe..86ebd6b7 100644 --- a/core/src/main/kotlin/Generation/FileGenerator.kt +++ b/core/src/main/kotlin/Generation/FileGenerator.kt @@ -6,7 +6,7 @@ import java.io.FileOutputStream import java.io.IOException import java.io.OutputStreamWriter -public class FileGenerator @Inject constructor(val locationService: FileLocationService) : Generator { +class FileGenerator @Inject constructor(val locationService: FileLocationService) : Generator { @set:Inject(optional = true) var outlineService: OutlineFormatService? = null @set:Inject(optional = true) lateinit var formatService: FormatService diff --git a/core/src/main/kotlin/Generation/Generator.kt b/core/src/main/kotlin/Generation/Generator.kt index ac10a6a5..83ddd04f 100644 --- a/core/src/main/kotlin/Generation/Generator.kt +++ b/core/src/main/kotlin/Generation/Generator.kt @@ -1,6 +1,6 @@ package org.jetbrains.dokka -public interface Generator { +interface Generator { fun buildPages(nodes: Iterable<DocumentationNode>) fun buildOutlines(nodes: Iterable<DocumentationNode>) fun buildSupportFiles() diff --git a/core/src/main/kotlin/Kotlin/ContentBuilder.kt b/core/src/main/kotlin/Kotlin/ContentBuilder.kt index 1a6ffb98..e4ed3962 100644 --- a/core/src/main/kotlin/Kotlin/ContentBuilder.kt +++ b/core/src/main/kotlin/Kotlin/ContentBuilder.kt @@ -5,7 +5,7 @@ import org.intellij.markdown.MarkdownTokenTypes import org.intellij.markdown.html.entities.EntityConverter import java.util.* -public fun buildContent(tree: MarkdownNode, linkResolver: (String) -> ContentBlock, inline: Boolean = false): MutableContent { +fun buildContent(tree: MarkdownNode, linkResolver: (String) -> ContentBlock, inline: Boolean = false): MutableContent { val result = MutableContent() if (inline) { buildInlineContentTo(tree, result, linkResolver) @@ -16,7 +16,7 @@ public fun buildContent(tree: MarkdownNode, linkResolver: (String) -> ContentBlo return result } -public fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver: (String) -> ContentBlock) { +fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver: (String) -> ContentBlock) { // println(tree.toTestString()) val nodeStack = ArrayDeque<ContentBlock>() nodeStack.push(target) @@ -129,7 +129,7 @@ public fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver private fun keepWhitespace(node: ContentNode) = node is ContentParagraph || node is ContentSection -public fun buildInlineContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver: (String) -> ContentBlock) { +fun buildInlineContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver: (String) -> ContentBlock) { val inlineContent = tree.children.singleOrNull { it.type == MarkdownElementTypes.PARAGRAPH }?.children ?: listOf(tree) inlineContent.forEach { buildContentTo(it, target, linkResolver) diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index 6551ded6..7ac5c020 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -33,13 +33,13 @@ import org.jetbrains.kotlin.types.ErrorUtils import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeProjection -public data class DocumentationOptions(val outputDir: String, - val outputFormat: String, - val includeNonPublic: Boolean = false, - val reportUndocumented: Boolean = true, - val skipEmptyPackages: Boolean = true, - val skipDeprecated: Boolean = false, - val sourceLinks: List<SourceLinkDefinition>) +data class DocumentationOptions(val outputDir: String, + val outputFormat: String, + val includeNonPublic: Boolean = false, + val reportUndocumented: Boolean = true, + val skipEmptyPackages: Boolean = true, + val skipDeprecated: Boolean = false, + val sourceLinks: List<SourceLinkDefinition>) private fun isSamePackage(descriptor1: DeclarationDescriptor, descriptor2: DeclarationDescriptor): Boolean { val package1 = DescriptorUtils.getParentOfType(descriptor1, PackageFragmentDescriptor::class.java) diff --git a/core/src/main/kotlin/Languages/JavaLanguageService.kt b/core/src/main/kotlin/Languages/JavaLanguageService.kt index 7e40beff..8be9f13e 100644 --- a/core/src/main/kotlin/Languages/JavaLanguageService.kt +++ b/core/src/main/kotlin/Languages/JavaLanguageService.kt @@ -6,7 +6,7 @@ import org.jetbrains.dokka.LanguageService.RenderMode /** * Implements [LanguageService] and provides rendering of symbols in Java language */ -public class JavaLanguageService : LanguageService { +class JavaLanguageService : LanguageService { override fun render(node: DocumentationNode, renderMode: RenderMode): ContentNode { return ContentText(when (node.kind) { Kind.Package -> renderPackage(node) @@ -44,19 +44,19 @@ public class JavaLanguageService : LanguageService { } } - public fun getArrayElementType(node: DocumentationNode): DocumentationNode? = when (node.name) { + fun getArrayElementType(node: DocumentationNode): DocumentationNode? = when (node.name) { "Array" -> node.details(Kind.Type).singleOrNull()?.let { et -> getArrayElementType(et) ?: et } ?: DocumentationNode("Object", node.content, DocumentationNode.Kind.ExternalClass) "IntArray", "LongArray", "ShortArray", "ByteArray", "CharArray", "DoubleArray", "FloatArray", "BooleanArray" -> DocumentationNode(node.name.removeSuffix("Array").toLowerCase(), node.content, DocumentationNode.Kind.Type) else -> null } - public fun getArrayDimension(node: DocumentationNode): Int = when (node.name) { + fun getArrayDimension(node: DocumentationNode): Int = when (node.name) { "Array" -> 1 + (node.details(DocumentationNode.Kind.Type).singleOrNull()?.let { getArrayDimension(it) } ?: 0) "IntArray", "LongArray", "ShortArray", "ByteArray", "CharArray", "DoubleArray", "FloatArray", "BooleanArray" -> 1 else -> 0 } - public fun renderType(node: DocumentationNode): String { + fun renderType(node: DocumentationNode): String { return when (node.name) { "Unit" -> "void" "Int" -> "int" diff --git a/core/src/main/kotlin/Locations/FoldersLocationService.kt b/core/src/main/kotlin/Locations/FoldersLocationService.kt index 89b34ed1..83e1cf6a 100644 --- a/core/src/main/kotlin/Locations/FoldersLocationService.kt +++ b/core/src/main/kotlin/Locations/FoldersLocationService.kt @@ -4,8 +4,9 @@ import com.google.inject.Inject import com.google.inject.name.Named import java.io.File -public fun FoldersLocationService(root: String): FoldersLocationService = FoldersLocationService(File(root), "") -public class FoldersLocationService @Inject constructor(@Named("outputDir") val rootFile: File, val extension: String) : FileLocationService { +class FoldersLocationService @Inject constructor(@Named("outputDir") val rootFile: File, val extension: String) : FileLocationService { + constructor(root: String): this(File(root), "") + override val root: Location get() = FileLocation(rootFile) diff --git a/core/src/main/kotlin/Locations/LocationService.kt b/core/src/main/kotlin/Locations/LocationService.kt index 80bc0236..63c236ed 100644 --- a/core/src/main/kotlin/Locations/LocationService.kt +++ b/core/src/main/kotlin/Locations/LocationService.kt @@ -2,7 +2,7 @@ package org.jetbrains.dokka import java.io.File -public interface Location { +interface Location { val path: String get fun relativePathTo(other: Location, anchor: String? = null): String } @@ -15,7 +15,7 @@ public interface Location { * $file: [File] for this location * $path: [String] representing path of this location */ -public data class FileLocation(val file: File): Location { +data class FileLocation(val file: File): Location { override val path : String get() = file.path @@ -41,7 +41,7 @@ public data class FileLocation(val file: File): Location { * * [SingleFolderLocationService] – all documentation is generated into single folder using fully qualified names * for file names. */ -public interface LocationService { +interface LocationService { fun withExtension(newExtension: String) = this fun location(node: DocumentationNode): Location = location(node.path.map { it.name }, node.members.any()) @@ -56,7 +56,7 @@ public interface LocationService { } -public interface FileLocationService: LocationService { +interface FileLocationService: LocationService { override fun withExtension(newExtension: String): FileLocationService = this override fun location(node: DocumentationNode): FileLocation = location(node.path.map { it.name }, node.members.any()) @@ -64,7 +64,7 @@ public interface FileLocationService: LocationService { } -public fun identifierToFilename(path: String): String { +fun identifierToFilename(path: String): String { val escaped = path.replace('<', '-').replace('>', '-') val lowercase = escaped.replace("[A-Z]".toRegex()) { matchResult -> "-" + matchResult.value.toLowerCase() } return if (lowercase == "index") "--index--" else lowercase diff --git a/core/src/main/kotlin/Locations/SingleFolderLocationService.kt b/core/src/main/kotlin/Locations/SingleFolderLocationService.kt index e313ac28..1b4fdc28 100644 --- a/core/src/main/kotlin/Locations/SingleFolderLocationService.kt +++ b/core/src/main/kotlin/Locations/SingleFolderLocationService.kt @@ -4,8 +4,9 @@ import com.google.inject.Inject import com.google.inject.name.Named import java.io.File -public fun SingleFolderLocationService(root: String): SingleFolderLocationService = SingleFolderLocationService(File(root), "") -public class SingleFolderLocationService @Inject constructor(@Named("outputDir") val rootFile: File, val extension: String) : FileLocationService { +class SingleFolderLocationService @Inject constructor(@Named("outputDir") val rootFile: File, val extension: String) : FileLocationService { + constructor(root: String): this(File(root), "") + override fun withExtension(newExtension: String): FileLocationService = SingleFolderLocationService(rootFile, newExtension) diff --git a/core/src/main/kotlin/Markdown/MarkdownProcessor.kt b/core/src/main/kotlin/Markdown/MarkdownProcessor.kt index 99caddc4..46b72c03 100644 --- a/core/src/main/kotlin/Markdown/MarkdownProcessor.kt +++ b/core/src/main/kotlin/Markdown/MarkdownProcessor.kt @@ -24,7 +24,7 @@ fun MarkdownNode.visit(action: (MarkdownNode, () -> Unit) -> Unit) { } } -public fun MarkdownNode.toTestString(): String { +fun MarkdownNode.toTestString(): String { val sb = StringBuilder() var level = 0 visit { node, visitChildren -> diff --git a/core/src/main/kotlin/Model/Content.kt b/core/src/main/kotlin/Model/Content.kt index 6556b09e..1bf1da48 100644 --- a/core/src/main/kotlin/Model/Content.kt +++ b/core/src/main/kotlin/Model/Content.kt @@ -1,14 +1,14 @@ package org.jetbrains.dokka -public interface ContentNode { +interface ContentNode { val textLength: Int } -public object ContentEmpty : ContentNode { +object ContentEmpty : ContentNode { override val textLength: Int get() = 0 } -public open class ContentBlock() : ContentNode { +open class ContentBlock() : ContentNode { val children = arrayListOf<ContentNode>() fun append(node: ContentNode) { @@ -35,58 +35,58 @@ enum class IdentifierKind { Other } -public data class ContentText(val text: String) : ContentNode { +data class ContentText(val text: String) : ContentNode { override val textLength: Int get() = text.length } -public data class ContentKeyword(val text: String) : ContentNode { +data class ContentKeyword(val text: String) : ContentNode { override val textLength: Int get() = text.length } -public data class ContentIdentifier(val text: String, val kind: IdentifierKind = IdentifierKind.Other) : ContentNode { +data class ContentIdentifier(val text: String, val kind: IdentifierKind = IdentifierKind.Other) : ContentNode { override val textLength: Int get() = text.length } -public data class ContentSymbol(val text: String) : ContentNode { +data class ContentSymbol(val text: String) : ContentNode { override val textLength: Int get() = text.length } -public data class ContentEntity(val text: String) : ContentNode { +data class ContentEntity(val text: String) : ContentNode { override val textLength: Int get() = text.length } -public object ContentNonBreakingSpace: ContentNode { +object ContentNonBreakingSpace: ContentNode { override val textLength: Int get() = 1 } -public object ContentSoftLineBreak: ContentNode { +object ContentSoftLineBreak: ContentNode { override val textLength: Int get() = 0 } -public object ContentIndentedSoftLineBreak: ContentNode { +object ContentIndentedSoftLineBreak: ContentNode { override val textLength: Int get() = 0 } -public class ContentParagraph() : ContentBlock() -public class ContentEmphasis() : ContentBlock() -public class ContentStrong() : ContentBlock() -public class ContentStrikethrough() : ContentBlock() -public class ContentCode() : ContentBlock() -public class ContentBlockCode(val language: String = "") : ContentBlock() +class ContentParagraph() : ContentBlock() +class ContentEmphasis() : ContentBlock() +class ContentStrong() : ContentBlock() +class ContentStrikethrough() : ContentBlock() +class ContentCode() : ContentBlock() +class ContentBlockCode(val language: String = "") : ContentBlock() |
