aboutsummaryrefslogtreecommitdiff
path: root/core/testdata
diff options
context:
space:
mode:
authorSimon Ogorodnik <sem-oro@yandex.ru>2016-11-29 15:53:53 +0300
committerGitHub <noreply@github.com>2016-11-29 15:53:53 +0300
commit37cbd962b7493aef63067a9f6b7f4abbaa56bc80 (patch)
tree9535169caa2899dab75417b0b788f1ec341b4b0b /core/testdata
parentedda34b73bbbd9537eb499668c47a7a901b284c2 (diff)
parent875e7e5e39c6c1668729685bbc7f51bc07aed4b6 (diff)
downloaddokka-37cbd962b7493aef63067a9f6b7f4abbaa56bc80.tar.gz
dokka-37cbd962b7493aef63067a9f6b7f4abbaa56bc80.tar.bz2
dokka-37cbd962b7493aef63067a9f6b7f4abbaa56bc80.zip
Merge pull request #111 from Kotlin/website-samples
Tweaked output for kotlin-website samples feature
Diffstat (limited to 'core/testdata')
-rw-r--r--core/testdata/format/website/overloadGroup.md2
-rw-r--r--core/testdata/format/website/sample.md11
-rw-r--r--core/testdata/format/website/sampleWithAsserts.kt15
-rw-r--r--core/testdata/format/website/sampleWithAsserts.md23
4 files changed, 49 insertions, 2 deletions
diff --git a/core/testdata/format/website/overloadGroup.md b/core/testdata/format/website/overloadGroup.md
index 81cb7822..d81f86bf 100644
--- a/core/testdata/format/website/overloadGroup.md
+++ b/core/testdata/format/website/overloadGroup.md
@@ -31,4 +31,4 @@ Spell ID for future casts
**Return**
Spell ID for future casts
-</div> \ No newline at end of file
+</div>
diff --git a/core/testdata/format/website/sample.md b/core/testdata/format/website/sample.md
index 1a683da7..203f1b02 100644
--- a/core/testdata/format/website/sample.md
+++ b/core/testdata/format/website/sample.md
@@ -14,16 +14,25 @@ layout: api
Groups elements of the original sequence by the key returned by the given <a href="#">keySelector</a> function
applied to each element and returns a map where each group key is associated with a list of corresponding elements.
+<div class="sample" markdown="1">
+
``` kotlin
+
+fun main(args: Array<String>) {
+//sampleStart
if (true) {
println(property)
}
+//sampleEnd
+}
```
</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>&nbsp;<span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Int</span></code></div>
-</div> \ No newline at end of file
+</div>
diff --git a/core/testdata/format/website/sampleWithAsserts.kt b/core/testdata/format/website/sampleWithAsserts.kt
new file mode 100644
index 00000000..bb9732d5
--- /dev/null
+++ b/core/testdata/format/website/sampleWithAsserts.kt
@@ -0,0 +1,15 @@
+/**
+ * @sample sample
+ */
+fun a(): String {
+ return "Hello, Work"
+}
+
+fun b(): String {
+ return "Hello, Rest"
+}
+
+fun sample() {
+ assertPrints(a(), "Hello, Work")
+ assertTrue(a() == b())
+} \ No newline at end of file
diff --git a/core/testdata/format/website/sampleWithAsserts.md b/core/testdata/format/website/sampleWithAsserts.md
new file mode 100644
index 00000000..98d7df33
--- /dev/null
+++ b/core/testdata/format/website/sampleWithAsserts.md
@@ -0,0 +1,23 @@
+---
+title: a - test
+layout: api
+---
+
+<div class='api-docs-breadcrumbs'><a href="test/index">test</a> / <a href="test/a">a</a></div>
+
+# a
+
+<div class="signature"><code><span class="keyword">fun </span><span class="identifier">a</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">String</span></code></div>
+<div class="sample" markdown="1">
+
+``` kotlin
+
+fun main(args: Array<String>) {
+//sampleStart
+println(a()) // Hello, Work
+println("a() == b() is ${a() == b()}") // true
+//sampleEnd
+}
+```
+
+</div>