diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-03-09 17:47:09 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-03-20 18:20:19 +0300 |
commit | 2eb805e47505388c0e47102e9257f6f79681e699 (patch) | |
tree | b50cc77717f4c9565579419ad197f21ec7938d24 /core/testdata/format/website-html/newLinesInSamples.html | |
parent | 8eff2cf33d1ba671191d6e2873f005e6b5f7057e (diff) | |
download | dokka-2eb805e47505388c0e47102e9257f6f79681e699.tar.gz dokka-2eb805e47505388c0e47102e9257f6f79681e699.tar.bz2 dokka-2eb805e47505388c0e47102e9257f6f79681e699.zip |
Create HTML based format for kotlin-website
Diffstat (limited to 'core/testdata/format/website-html/newLinesInSamples.html')
-rw-r--r-- | core/testdata/format/website-html/newLinesInSamples.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/testdata/format/website-html/newLinesInSamples.html b/core/testdata/format/website-html/newLinesInSamples.html new file mode 100644 index 00000000..0babe122 --- /dev/null +++ b/core/testdata/format/website-html/newLinesInSamples.html @@ -0,0 +1,19 @@ +<div class='api-docs-breadcrumbs'><a href="test/index">test</a> / <a href="test/foo">foo</a></div> +<h1>foo</h1> +<a name="$foo()"></a> +<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">Unit</span></code></div> +<div class="sample"><pre><code class="lang-kotlin"> + +fun main(args: Array<String>) { +//sampleStart +val words = listOf("a", "abc", "ab", "def", "abcd") +val byLength = words.groupBy { it.length } + +println(byLength.keys) // [1, 3, 2, 4] +println(byLength.values) // [[a], [abc, def], [ab], [abcd]] + +val mutableByLength: MutableMap<Int, MutableList<String>> = words.groupByTo(mutableMapOf()) { it.length } +// same content as in byLength map, but the map is mutable +println("mutableByLength == byLength is ${mutableByLength == byLength}") // true +//sampleEnd +}</code></pre></div> |