aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/FormatService.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-12-22 09:50:17 +0200
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-12-22 09:50:17 +0200
commit18399493263820cf6098603025802ddf862f1920 (patch)
treeb8c915c272cdc484df2b511ad50a9ff829c33612 /src/Formats/FormatService.kt
parentbd6cddd932c308519ce386197b93de145462bec2 (diff)
downloaddokka-18399493263820cf6098603025802ddf862f1920.tar.gz
dokka-18399493263820cf6098603025802ddf862f1920.tar.bz2
dokka-18399493263820cf6098603025802ddf862f1920.zip
Document some types in Dokka and fix to make them work.
Diffstat (limited to 'src/Formats/FormatService.kt')
-rw-r--r--src/Formats/FormatService.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Formats/FormatService.kt b/src/Formats/FormatService.kt
index 9af74590..bb6da985 100644
--- a/src/Formats/FormatService.kt
+++ b/src/Formats/FormatService.kt
@@ -1,10 +1,26 @@
package org.jetbrains.dokka
+/**
+ * Abstract representation of a formatting service used to output documentation in desired format
+ *
+ * Bundled Formatters:
+ * * [HtmlFormatService] – outputs documentation to HTML format
+ * * [MarkdownFormatService] – outputs documentation in Markdown format
+ * * [TextFormatService] – outputs documentation in Text format
+ */
public trait FormatService {
+ /** Returns extension for output files */
val extension: String
+
+ /** Appends formatted content to [StringBuilder](to) using specified [location] */
fun appendNodes(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>)
+
+ /** Appends formatted outline to [StringBuilder](to) using specified [location] */
fun appendOutline(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>)
}
+/** Format content to [String] using specified [location] */
fun FormatService.format(location: Location, nodes: Iterable<DocumentationNode>): String = StringBuilder { appendNodes(location, this, nodes) }.toString()
+
+/** Format outline to [String] using specified [location] */
fun FormatService.formatOutline(location: Location, nodes: Iterable<DocumentationNode>): String = StringBuilder { appendOutline(location, this, nodes) }.toString() \ No newline at end of file