diff options
| author | Kamil Doległo <kamilok1965@interia.pl> | 2019-06-21 17:25:48 +0200 |
|---|---|---|
| committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-06-21 17:25:48 +0200 |
| commit | e9a40280ad49cc471143c0be6807b7cd4033b52c (patch) | |
| tree | 96ac1ba04eba87e93378a912717ca98cd910dfb7 | |
| parent | 26b05e709bb025da3d65e739c211aa0fb6350999 (diff) | |
| download | dokka-e9a40280ad49cc471143c0be6807b7cd4033b52c.tar.gz dokka-e9a40280ad49cc471143c0be6807b7cd4033b52c.tar.bz2 dokka-e9a40280ad49cc471143c0be6807b7cd4033b52c.zip | |
Fix format in KotlinWebsiteHtml, markdown format changed slightly
50 files changed, 125 insertions, 98 deletions
diff --git a/core/src/main/kotlin/Formats/MarkdownFormatService.kt b/core/src/main/kotlin/Formats/MarkdownFormatService.kt index 71356619..216dd2ef 100644 --- a/core/src/main/kotlin/Formats/MarkdownFormatService.kt +++ b/core/src/main/kotlin/Formats/MarkdownFormatService.kt @@ -177,10 +177,17 @@ open class MarkdownOutputBuilder(to: StringBuilder, } override fun appendHeader(level: Int, body: () -> Unit) { - ensureParagraph() - to.append("${"#".repeat(level)} ") - body() - ensureParagraph() + when { + inTableCell -> { + body() + } + else -> { + ensureParagraph() + to.append("${"#".repeat(level)} ") + body() + ensureParagraph() + } + } } override fun appendBlockCode(language: String, body: () -> Unit) { diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 264a176d..62ea1108 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -767,10 +767,10 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, if (summarized.platformPlacement == Summarized.PlatformPlacement.Row) { appendPlatforms(platforms) } -// appendHeader(level = 4) { -// appendParagraph { - appendLink(memberLocation) - + appendHeader(level = 4) { + // appendParagraph { + appendLink(memberLocation) + } if (node.sinceKotlin != null) { appendSinceKotlin(node.sinceKotlin.toString()) } @@ -832,6 +832,7 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, if (summarized.platformPlacement == Summarized.PlatformPlacement.Summary) { appendPlatforms(summary.platforms) } + appendContent(summary.content) summary.signatures.subList(0, summary.signatures.size - 1).forEach { appendSignatures( it, @@ -843,7 +844,6 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, summary.signatures.last(), summarized.platformPlacement == Summarized.PlatformPlacement.Signature ) - appendContent(summary.content) } } diff --git a/core/testdata/format/JavaSupertype.html b/core/testdata/format/JavaSupertype.html index 93346a4a..85fb6d84 100644 --- a/core/testdata/format/JavaSupertype.html +++ b/core/testdata/format/JavaSupertype.html @@ -13,7 +13,8 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> <code><span class="identifier">Bar</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> @@ -24,7 +25,8 @@ <tbody> <tr> <td> -<a href="return-foo.html">returnFoo</a></td> +<h4><a href="return-foo.html">returnFoo</a></h4> +</td> <td> <code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">returnFoo</span><span class="symbol">(</span><span class="identifier" id="JavaSupertype.Bar$returnFoo(JavaSupertype.Foo)/foo">foo</span><span class="symbol">:</span> <a href="../-foo/index.html"><span class="identifier">JavaSupertype.Foo</span></a><span class="symbol">!</span><span class="symbol">)</span><span class="symbol">: </span><a href="../-foo/index.html"><span class="identifier">JavaSupertype.Foo</span></a><span class="symbol">!</span></code></td> </tr> diff --git a/core/testdata/format/classWithCompanionObject.html b/core/testdata/format/classWithCompanionObject.html index 95fcbf6b..e477b53b 100644 --- a/core/testdata/format/classWithCompanionObject.html +++ b/core/testdata/format/classWithCompanionObject.html @@ -13,7 +13,8 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> <code><span class="identifier">Klass</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> @@ -24,7 +25,8 @@ <tbody> <tr> <td> -<a href="x.html">x</a></td> +<h4><a href="x.html">x</a></h4> +</td> <td> <code><span class="keyword">val </span><span class="identifier">x</span><span class="symbol">: </span><span class="identifier">Int</span></code></td> </tr> @@ -35,7 +37,8 @@ <tbody> <tr> <td> -<a href="foo.html">foo</a></td> +<h4><a href="foo.html">foo</a></h4> +</td> <td> <code><span class="keyword">fun </span><span class="identifier">foo</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td> </tr> diff --git a/core/testdata/format/codeBlock.html b/core/testdata/format/codeBlock.html index a877e8c6..ead4dbc0 100644 --- a/core/testdata/format/codeBlock.html +++ b/core/testdata/format/codeBlock.html @@ -19,11 +19,11 @@ fun readFile(name: String): String {...} <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> -<code><span class="identifier">Throws</span><span class="symbol">(</span><span class="symbol">)</span></code> <p>This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.</p> -</td> +<code><span class="identifier">Throws</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> </tbody> </table> @@ -48,11 +48,11 @@ fun readFile(name: String): String {...} <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> -<code><span class="identifier">ItDoesSomeObfuscatedThing</span><span class="symbol">(</span><span class="symbol">)</span></code> <p>Check output of</p> -</td> +<code><span class="identifier">ItDoesSomeObfuscatedThing</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> </tbody> </table> diff --git a/core/testdata/format/codeBlock.md b/core/testdata/format/codeBlock.md index b6163a37..c14fc7bd 100644 --- a/core/testdata/format/codeBlock.md +++ b/core/testdata/format/codeBlock.md @@ -16,7 +16,7 @@ fun readFile(name: String): String {...} ### Constructors -| [<init>](-init-.md) | `Throws()`<br>This annotation indicates what exceptions should be declared by a function when compiled to a JVM method. | +| [<init>](-init-.md) | This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.`Throws()` | <!-- File: test/--root--/-it-does-some-obfuscated-thing/index.md --> [test](../../index.md) / [ItDoesSomeObfuscatedThing](./index.md) @@ -33,5 +33,5 @@ Check output of ### Constructors -| [<init>](-init-.md) | `ItDoesSomeObfuscatedThing()`<br>Check output of | +| [<init>](-init-.md) | Check output of`ItDoesSomeObfuscatedThing()` | diff --git a/core/testdata/format/companionImplements.md b/core/testdata/format/companionImplements.md index ead95193..2734e1fe 100644 --- a/core/testdata/format/companionImplements.md +++ b/core/testdata/format/companionImplements.md @@ -12,5 +12,5 @@ Correct ref [Foo.Companion](-companion.md) ### Constructors -| [<init>](-init-.md) | `Foo()`<br>Correct ref [Foo.Companion](-companion.md) | +| [<init>](-init-.md) | Correct ref [Foo.Companion](-companion.md)`Foo()` | diff --git a/core/testdata/format/companionObjectExtension.md b/core/testdata/format/companionObjectExtension.md index f62c856e..43dff899 100644 --- a/core/testdata/format/companionObjectExtension.md +++ b/core/testdata/format/companionObjectExtension.md @@ -10,5 +10,5 @@ ### Companion Object Extension Properties -| [x](../x.md) | `val Foo.Default.x: Int`<br>The default object property. | +| [x](../x.md) | The default object property.`val Foo.Default.x: Int` | diff --git a/core/testdata/format/crossLanguage/kotlinExtendsJava/Bar.html b/core/testdata/format/crossLanguage/kotlinExtendsJava/Bar.html index c413595b..4d08043c 100644 --- a/core/testdata/format/crossLanguage/kotlinExtendsJava/Bar.html +++ b/core/testdata/format/crossLanguage/kotlinExtendsJava/Bar.html @@ -14,11 +14,11 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> -<code><span class="identifier">Bar</span><span class="symbol">(</span><span class="symbol">)</span></code> <p>See <a href="../-foo/xyzzy.html">xyzzy</a></p> -</td> +<code><span class="identifier">Bar</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> </tbody> </table> @@ -27,7 +27,8 @@ <tbody> <tr> <td> -<a href="../-foo/xyzzy.html">xyzzy</a></td> +<h4><a href="../-foo/xyzzy.html">xyzzy</a></h4> +</td> <td> <code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">xyzzy</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td> </tr> diff --git a/core/testdata/format/deprecated.class.html b/core/testdata/format/deprecated.class.html index d0e27e88..11d2e944 100644 --- a/core/testdata/format/deprecated.class.html +++ b/core/testdata/format/deprecated.class.html @@ -16,7 +16,8 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> <code><span class="identifier">C</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> diff --git a/core/testdata/format/deprecated.package.html b/core/testdata/format/deprecated.package.html index a02783b6..5b218f74 100644 --- a/core/testdata/format/deprecated.package.html +++ b/core/testdata/format/deprecated.package.html @@ -12,7 +12,8 @@ <tbody> <tr> <td> -<a href="-c/index.html">C</a></td> +<h4><a href="-c/index.html">C</a></h4> +</td> <td> <code><span class="keyword">class </span><s><span class="identifier">C</span></s></code></td> </tr> @@ -23,7 +24,8 @@ <tbody> <tr> <td> -<a href="p.html">p</a></td> +<h4><a href="p.html">p</a></h4> +</td> <td> <code><span class="keyword">val </span><s><span class="identifier">p</span></s><span class="symbol">: </span><span class="identifier">Int</span></code></td> </tr> @@ -34,7 +36,8 @@ <tbody> <tr> <td> -<a href="f.html">f</a></td> +<h4><a href="f.html">f</a></h4> +</td> <td> <code><span class="keyword">fun </span><s><span class="identifier">f</span></s><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td> </tr> diff --git a/core/testdata/format/entity.html b/core/testdata/format/entity.html index 2068009e..bfeb34ea 100644 --- a/core/testdata/format/entity.html +++ b/core/testdata/format/entity.html @@ -14,11 +14,11 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> -<code><span class="identifier">Bar</span><span class="symbol">(</span><span class="symbol">)</span></code> <p>Copyright © JetBrains 2015 "</p> -</td> +<code><span class="identifier">Bar</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> </tbody> </table> diff --git a/core/testdata/format/extensions.class.md b/core/testdata/format/extensions.class.md index b8fa200a..cd1bb70e 100644 --- a/core/testdata/format/extensions.class.md +++ b/core/testdata/format/extensions.class.md @@ -2,6 +2,6 @@ ### Extensions for kotlin.String -| [fn](fn.md) | `fun String.fn(): Unit`<br>`fun String.fn(x: Int): Unit`<br>Function with receiver | -| [foobar](foobar.md) | `val String.foobar: Int`<br>Property with receiver. | +| [fn](fn.md) | Function with receiver`fun String.fn(): Unit`<br>`fun String.fn(x: Int): Unit` | +| [foobar](foobar.md) | Property with receiver.`val String.foobar: Int` | diff --git a/core/testdata/format/functionalTypeWithNamedParameters.html b/core/testdata/format/functionalTypeWithNamedParameters.html index c0b0306b..af97eb4e 100644 --- a/core/testdata/format/functionalTypeWithNamedParameters.html +++ b/core/testdata/format/functionalTypeWithNamedParameters.html @@ -14,7 +14,8 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> <code><span class="identifier">A</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> @@ -38,7 +39,8 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> <code><span class="identifier">B</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> @@ -62,7 +64,8 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> <code><span class="identifier">C</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> diff --git a/core/testdata/format/gfm/listInTableCell.md b/core/testdata/format/gfm/listInTableCell.md index 59fba5c4..1cafb61a 100644 --- a/core/testdata/format/gfm/listInTableCell.md +++ b/core/testdata/format/gfm/listInTableCell.md @@ -14,4 +14,4 @@ | Name | Summary | |---|---| -| [foo](foo.md) | `fun foo(): Unit`<ol><li>Foo</li><li>Bar</li></ol> | +| [foo](foo.md) | <ol><li>Foo</li><li>Bar</li></ol>`fun foo(): Unit` | diff --git a/core/testdata/format/gfm/sample.md b/core/testdata/format/gfm/sample.md index a720881f..a9464ea3 100644 --- a/core/testdata/format/gfm/sample.md +++ b/core/testdata/format/gfm/sample.md @@ -10,11 +10,11 @@ The class Foo. | Name | Summary | |---|---| -| [<init>](-init-.md) | `Foo()`<br>The class Foo. | +| [<init>](-init-.md) | The class Foo.`Foo()` | ### Functions | Name | Summary | |---|---| -| [bar](bar.md) | `fun bar(): Unit`<br>The method bar. | -| [baz](baz.md) | `fun baz(): Unit`<br>The method baz. | +| [bar](bar.md) | The method bar.`fun bar(): Unit` | +| [baz](baz.md) | The method baz.`fun baz(): Unit` | diff --git a/core/testdata/format/javaCodeLiteralTags.md b/core/testdata/format/javaCodeLiteralTags.md index 83d535fc..88472b87 100644 --- a/core/testdata/format/javaCodeLiteralTags.md +++ b/core/testdata/format/javaCodeLiteralTags.md @@ -12,5 +12,5 @@ A<B>C ### Constructors -| [<init>](-init-.md) | `C()`<br>`A<B>C` | +| [<init>](-init-.md) | `A<B>C``C()` | diff --git a/core/testdata/format/javaLinkTag.html b/core/testdata/format/javaLinkTag.html index 0a027c0e..f61673d5 100644 --- a/core/testdata/format/javaLinkTag.html +++ b/core/testdata/format/javaLinkTag.html @@ -14,11 +14,11 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> -<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code> <p>Call <code><a href="bar.html">#bar()</a></code> to do the job.</p> -</td> +<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> </tbody> </table> @@ -27,7 +27,8 @@ <tbody> <tr> <td> -<a href="bar.html">bar</a></td> +<h4><a href="bar.html">bar</a></h4> +</td> <td> <code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">bar</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td> </tr> diff --git a/core/testdata/format/javaLinkTagWithLabel.html b/core/testdata/format/javaLinkTagWithLabel.html index f592f85e..92c67795 100644 --- a/core/testdata/format/javaLinkTagWithLabel.html +++ b/core/testdata/format/javaLinkTagWithLabel.html @@ -14,11 +14,11 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> -<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code> <p>Call <code><a href="bar.html">this wonderful method</a></code> to do the job.</p> -</td> +<code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> </tbody> </table> @@ -27,7 +27,8 @@ <tbody> <tr> <td> -<a href="bar.html">bar</a></td> +<h4><a href="bar.html">bar</a></h4> +</td> <td> <code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">bar</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td> </tr> diff --git a/core/testdata/format/javaSeeTag.html b/core/testdata/format/javaSeeTag.html index 0f5465aa..dd19c56c 100644 --- a/core/testdata/format/javaSeeTag.html +++ b/core/testdata/format/javaSeeTag.html @@ -15,7 +15,8 @@ <tbody> <tr> <td> -<a href="-init-.html"><init></a></td> +<h4><a href="-init-.html"><init></a></h4> +</td> <td> <code><span class="identifier">Foo</span><span class="symbol">(</span><span class="symbol">)</span></code></td> </tr> @@ -26,7 +27,8 @@ <tbody> <tr> <td> -<a href="bar.html">bar</a></td> +<h4><a href="bar.html">bar</a></h4> +</td> <td> <code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">bar</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td> </tr> diff --git a/core/testdata/format/javadocHtml.md b/core/testdata/format/javadocHtml.md index 0e8c7ca8..b6a03cd6 100644 --- a/core/testdata/format/javadocHtml.md |
