diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt | 5 | ||||
-rw-r--r-- | core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt | 4 | ||||
-rw-r--r-- | core/testdata/format/website/overloadGroup.kt | 15 | ||||
-rw-r--r-- | core/testdata/format/website/overloadGroup.md | 34 | ||||
-rw-r--r-- | core/testdata/format/website/sample.md | 9 |
5 files changed, 64 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt index 03cf7fc8..bc9358ac 100644 --- a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt +++ b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt @@ -52,8 +52,11 @@ class KotlinWebsiteOutputBuilder(to: StringBuilder, } override fun appendAsOverloadGroup(to: StringBuilder, block: () -> Unit) { + to.append("<div class=\"overload-group\" markdown=\"1\">") + ensureParagraph() block() - to.append("<div class=\"overload-group\"></div>") + ensureParagraph() + to.append("</div>") } override fun appendLink(href: String, body: () -> Unit) = wrap("<a href=\"$href\">", "</a>", body) diff --git a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt index e6ef792a..e7419ec8 100644 --- a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt +++ b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt @@ -15,6 +15,10 @@ class KotlinWebSiteFormatTest { verifyKWSNodeByName("returnTag", "indexOf") } + @Test fun overloadGroup() { + verifyKWSNodeByName("overloadGroup", "magic") + } + private fun verifyKWSNodeByName(fileName: String, name: String) { verifyOutput("testdata/format/website/$fileName.kt", ".md") { model, output -> kwsService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members.filter { it.name == name }) diff --git a/core/testdata/format/website/overloadGroup.kt b/core/testdata/format/website/overloadGroup.kt new file mode 100644 index 00000000..5bc98e3d --- /dev/null +++ b/core/testdata/format/website/overloadGroup.kt @@ -0,0 +1,15 @@ +/** + * @param spell The text of spell, often distributed on scrolls + * @return Spell ID for future casts + */ +fun magic(spell: String): Int { + +} + +/** + * @param spell Spell ID of previously casted spell + * @return Spell ID for future casts + */ +fun magic(spell: Int): Int { + +}
\ No newline at end of file diff --git a/core/testdata/format/website/overloadGroup.md b/core/testdata/format/website/overloadGroup.md new file mode 100644 index 00000000..81cb7822 --- /dev/null +++ b/core/testdata/format/website/overloadGroup.md @@ -0,0 +1,34 @@ +--- +title: magic - test +layout: api +--- + +<div class='api-docs-breadcrumbs'><a href="test/index">test</a> / <a href="test/magic">magic</a></div> + +# magic + +<div class="overload-group" markdown="1"> + +<div class="signature"><code><span class="keyword">fun </span><span class="identifier">magic</span><span class="symbol">(</span><span class="parameterName" id="$magic(kotlin.String)/spell">spell</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Int</span></code></div> + +### Parameters + +<code>spell</code> - The text of spell, often distributed on scrolls + +**Return** +Spell ID for future casts + +</div> + +<div class="overload-group" markdown="1"> + +<div class="signature"><code><span class="keyword">fun </span><span class="identifier">magic</span><span class="symbol">(</span><span class="parameterName" id="$magic(kotlin.Int)/spell">spell</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Int</span></code></div> + +### Parameters + +<code>spell</code> - Spell ID of previously casted spell + +**Return** +Spell ID for future casts + +</div>
\ No newline at end of file diff --git a/core/testdata/format/website/sample.md b/core/testdata/format/website/sample.md index 3a52379b..1a683da7 100644 --- a/core/testdata/format/website/sample.md +++ b/core/testdata/format/website/sample.md @@ -7,6 +7,8 @@ layout: api # foo +<div class="overload-group" markdown="1"> + <div class="signature"><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">Int</span></code></div> Groups elements of the original sequence by the key returned by the given <a href="#">keySelector</a> function @@ -18,7 +20,10 @@ if (true) { } ``` -<div class="overload-group"></div> +</div> + +<div class="overload-group" markdown="1"> <div class="signature"><code><span class="keyword">fun </span><span class="identifier">foo</span><span class="symbol">(</span><span class="parameterName" id="$foo(kotlin.Int)/i">i</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Int</span></code></div> -<div class="overload-group"></div>
\ No newline at end of file + +</div>
\ No newline at end of file |