diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index da23a03..e4f4a1d 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index da23a03..e4f4a1d 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/k2html.iml b/.idea/modules/k2html.iml new file mode 100644 index 0000000..b49dabe --- /dev/null +++ b/.idea/modules/k2html.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index da23a03..e4f4a1d 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/k2html.iml b/.idea/modules/k2html.iml new file mode 100644 index 0000000..b49dabe --- /dev/null +++ b/.idea/modules/k2html.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_main.iml b/.idea/modules/k2html_main.iml new file mode 100644 index 0000000..4606a46 --- /dev/null +++ b/.idea/modules/k2html_main.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index da23a03..e4f4a1d 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/k2html.iml b/.idea/modules/k2html.iml new file mode 100644 index 0000000..b49dabe --- /dev/null +++ b/.idea/modules/k2html.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_main.iml b/.idea/modules/k2html_main.iml new file mode 100644 index 0000000..4606a46 --- /dev/null +++ b/.idea/modules/k2html_main.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_test.iml b/.idea/modules/k2html_test.iml new file mode 100644 index 0000000..d9a9466 --- /dev/null +++ b/.idea/modules/k2html_test.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index da23a03..e4f4a1d 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/k2html.iml b/.idea/modules/k2html.iml new file mode 100644 index 0000000..b49dabe --- /dev/null +++ b/.idea/modules/k2html.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_main.iml b/.idea/modules/k2html_main.iml new file mode 100644 index 0000000..4606a46 --- /dev/null +++ b/.idea/modules/k2html_main.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_test.iml b/.idea/modules/k2html_test.iml new file mode 100644 index 0000000..d9a9466 --- /dev/null +++ b/.idea/modules/k2html_test.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9c4001c..7a994f1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'nl.astraeus.tag' -version '1.2-SNAPSHOT' +version '1.3-SNAPSHOT' apply plugin: 'kotlin' apply plugin: 'idea' @@ -18,7 +18,7 @@ } buildscript { - ext.kotlin_version = '1.+' + ext.kotlin_version = '1.0.4' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index da23a03..e4f4a1d 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/k2html.iml b/.idea/modules/k2html.iml new file mode 100644 index 0000000..b49dabe --- /dev/null +++ b/.idea/modules/k2html.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_main.iml b/.idea/modules/k2html_main.iml new file mode 100644 index 0000000..4606a46 --- /dev/null +++ b/.idea/modules/k2html_main.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_test.iml b/.idea/modules/k2html_test.iml new file mode 100644 index 0000000..d9a9466 --- /dev/null +++ b/.idea/modules/k2html_test.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9c4001c..7a994f1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'nl.astraeus.tag' -version '1.2-SNAPSHOT' +version '1.3-SNAPSHOT' apply plugin: 'kotlin' apply plugin: 'idea' @@ -18,7 +18,7 @@ } buildscript { - ext.kotlin_version = '1.+' + ext.kotlin_version = '1.0.4' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" diff --git a/k2html.iml b/k2html.iml deleted file mode 100644 index 8f5996e..0000000 --- a/k2html.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index da23a03..e4f4a1d 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/k2html.iml b/.idea/modules/k2html.iml new file mode 100644 index 0000000..b49dabe --- /dev/null +++ b/.idea/modules/k2html.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_main.iml b/.idea/modules/k2html_main.iml new file mode 100644 index 0000000..4606a46 --- /dev/null +++ b/.idea/modules/k2html_main.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_test.iml b/.idea/modules/k2html_test.iml new file mode 100644 index 0000000..d9a9466 --- /dev/null +++ b/.idea/modules/k2html_test.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9c4001c..7a994f1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'nl.astraeus.tag' -version '1.2-SNAPSHOT' +version '1.3-SNAPSHOT' apply plugin: 'kotlin' apply plugin: 'idea' @@ -18,7 +18,7 @@ } buildscript { - ext.kotlin_version = '1.+' + ext.kotlin_version = '1.0.4' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" diff --git a/k2html.iml b/k2html.iml deleted file mode 100644 index 8f5996e..0000000 --- a/k2html.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/nl/astraeus/tag/TagCreator.kt b/src/nl/astraeus/tag/TagCreator.kt index 03b563a..ddd36a0 100644 --- a/src/nl/astraeus/tag/TagCreator.kt +++ b/src/nl/astraeus/tag/TagCreator.kt @@ -5,7 +5,7 @@ /** * Created by rnentjes on 15-9-15. */ -public fun escape(s: String): String { +fun escape(s: String): String { if ("" == s) { return "" } @@ -25,134 +25,134 @@ return out.toString() } -public object Attr { - public val HIDDEN: String = "hidden" - public val HIGH: String = "high" - public val HREF: String = "href" - public val HREFLANG: String = "hreflang" - public val HTTP_EQUIV: String = "http-equiv" - public val ICON: String = "icon" - public val ID: String = "id" - public val ISMAP: String = "ismap" - public val ITEMPROP: String = "itemprop" - public val KEYTYPE: String = "keytype" - public val KIND: String = "kind" - public val LABEL: String = "label" - public val LANG: String = "lang" - public val LANGUAGE: String = "language" - public val LIST: String = "list" - public val LOOP: String = "loop" - public val LOW: String = "low" - public val MANIFEST: String = "manifest" - public val MAX: String = "max" - public val MAXLENGTH: String = "maxlength" - public val MEDIA: String = "media" - public val METHOD: String = "method" - public val MIN: String = "min" - public val MULTIPLE: String = "multiple" - public val NAME: String = "name" - public val NOVALIDATE: String = "novalidate" - public val OPEN: String = "open" - public val OPTIMUM: String = "optimum" - public val PATTERN: String = "pattern" - public val PING: String = "ping" - public val PLACEHOLDER: String = "placeholder" - public val POSTER: String = "poster" - public val PRELOAD: String = "preload" - public val PUBDATE: String = "pubdate" - public val RADIOGROUP: String = "radiogroup" - public val READONLY: String = "readonly" - public val REL: String = "rel" - public val REQUIRED: String = "required" - public val REVERSED: String = "reversed" - public val ROWS: String = "rows" - public val ROWSPAN: String = "rowspan" - public val SANDBOX: String = "sandbox" - public val SPELLCHECK: String = "spellcheck" - public val SCOPE: String = "scope" - public val SCOPED: String = "scoped" - public val SEAMLESS: String = "seamless" - public val SELECTED: String = "selected" - public val SHAPE: String = "shape" - public val SIZE: String = "size" - public val SIZES: String = "sizes" - public val SPAN: String = "span" - public val SRC: String = "src" - public val SRCDOC: String = "srcdoc" - public val SRCLANG: String = "srclang" - public val SRCSET: String = "srcset" - public val START: String = "start" - public val STEP: String = "step" - public val STYLE: String = "style" - public val SUMMARY: String = "summary" - public val TABINDEX: String = "tabindex" - public val TARGET: String = "target" - public val TITLE: String = "title" - public val TYPE: String = "type" - public val USEMAP: String = "usemap" - public val VALUE: String = "value" - public val WIDTH: String = "width" - public val WRAP: String = "wrap" - public val BORDER: String = "border" - public val BUFFERED: String = "buffered" - public val CHALLENGE: String = "challenge" - public val CHARSET: String = "charset" - public val CHECKED: String = "checked" - public val CITE: String = "cite" - public val CLASS: String = "class" - public val COLOR: String = "color" - public val COLS: String = "cols" - public val COLSPAN: String = "colspan" - public val CONTENT: String = "content" - public val CONTENTEDITABLE: String = "contenteditable" - public val CONTEXTMENU: String = "contextmenu" - public val CONTROLS: String = "controls" - public val COORDS: String = "coords" - public val DATA: String = "data" - public val DATETIME: String = "datetime" - public val DEFAULT: String = "default" - public val DEFER: String = "defer" - public val DIR: String = "dir" - public val DIRNAME: String = "dirname" - public val DISABLED: String = "disabled" - public val DOWNLOAD: String = "download" - public val DRAGGABLE: String = "draggable" - public val DROPZONE: String = "dropzone" - public val ENCTYPE: String = "enctype" - public val FOR: String = "for" - public val FORM: String = "form" - public val FORMACTION: String = "formaction" - public val HEADERS: String = "headers" - public val HEIGHT: String = "height" - public val ACCEPT: String = "accept" - public val ACCEPT_CHARSET: String = "accept-charset" - public val ACCESSKEY: String = "accesskey" - public val ACTION: String = "action" - public val ALIGN: String = "align" - public val ALT: String = "alt" - public val ASYNC: String = "async" - public val AUTOCOMPLETE: String = "autocomplete" - public val AUTOFOCUS: String = "autofocus" - public val AUTOPLAY: String = "autoplay" - public val AUTOSAVE: String = "autosave" +object Attr { + val HIDDEN: String = "hidden" + val HIGH: String = "high" + val HREF: String = "href" + val HREFLANG: String = "hreflang" + val HTTP_EQUIV: String = "http-equiv" + val ICON: String = "icon" + val ID: String = "id" + val ISMAP: String = "ismap" + val ITEMPROP: String = "itemprop" + val KEYTYPE: String = "keytype" + val KIND: String = "kind" + val LABEL: String = "label" + val LANG: String = "lang" + val LANGUAGE: String = "language" + val LIST: String = "list" + val LOOP: String = "loop" + val LOW: String = "low" + val MANIFEST: String = "manifest" + val MAX: String = "max" + val MAXLENGTH: String = "maxlength" + val MEDIA: String = "media" + val METHOD: String = "method" + val MIN: String = "min" + val MULTIPLE: String = "multiple" + val NAME: String = "name" + val NOVALIDATE: String = "novalidate" + val OPEN: String = "open" + val OPTIMUM: String = "optimum" + val PATTERN: String = "pattern" + val PING: String = "ping" + val PLACEHOLDER: String = "placeholder" + val POSTER: String = "poster" + val PRELOAD: String = "preload" + val PUBDATE: String = "pubdate" + val RADIOGROUP: String = "radiogroup" + val READONLY: String = "readonly" + val REL: String = "rel" + val REQUIRED: String = "required" + val REVERSED: String = "reversed" + val ROWS: String = "rows" + val ROWSPAN: String = "rowspan" + val SANDBOX: String = "sandbox" + val SPELLCHECK: String = "spellcheck" + val SCOPE: String = "scope" + val SCOPED: String = "scoped" + val SEAMLESS: String = "seamless" + val SELECTED: String = "selected" + val SHAPE: String = "shape" + val SIZE: String = "size" + val SIZES: String = "sizes" + val SPAN: String = "span" + val SRC: String = "src" + val SRCDOC: String = "srcdoc" + val SRCLANG: String = "srclang" + val SRCSET: String = "srcset" + val START: String = "start" + val STEP: String = "step" + val STYLE: String = "style" + val SUMMARY: String = "summary" + val TABINDEX: String = "tabindex" + val TARGET: String = "target" + val TITLE: String = "title" + val TYPE: String = "type" + val USEMAP: String = "usemap" + val VALUE: String = "value" + val WIDTH: String = "width" + val WRAP: String = "wrap" + val BORDER: String = "border" + val BUFFERED: String = "buffered" + val CHALLENGE: String = "challenge" + val CHARSET: String = "charset" + val CHECKED: String = "checked" + val CITE: String = "cite" + val CLASS: String = "class" + val COLOR: String = "color" + val COLS: String = "cols" + val COLSPAN: String = "colspan" + val CONTENT: String = "content" + val CONTENTEDITABLE: String = "contenteditable" + val CONTEXTMENU: String = "contextmenu" + val CONTROLS: String = "controls" + val COORDS: String = "coords" + val DATA: String = "data" + val DATETIME: String = "datetime" + val DEFAULT: String = "default" + val DEFER: String = "defer" + val DIR: String = "dir" + val DIRNAME: String = "dirname" + val DISABLED: String = "disabled" + val DOWNLOAD: String = "download" + val DRAGGABLE: String = "draggable" + val DROPZONE: String = "dropzone" + val ENCTYPE: String = "enctype" + val FOR: String = "for" + val FORM: String = "form" + val FORMACTION: String = "formaction" + val HEADERS: String = "headers" + val HEIGHT: String = "height" + val ACCEPT: String = "accept" + val ACCEPT_CHARSET: String = "accept-charset" + val ACCESSKEY: String = "accesskey" + val ACTION: String = "action" + val ALIGN: String = "align" + val ALT: String = "alt" + val ASYNC: String = "async" + val AUTOCOMPLETE: String = "autocomplete" + val AUTOFOCUS: String = "autofocus" + val AUTOPLAY: String = "autoplay" + val AUTOSAVE: String = "autosave" } -public class Attribute { - public var name: String +class Attribute { + var name: String private set private var value: String? = null - public constructor(name: String, value: String) { + constructor(name: String, value: String) { this.name = name this.value = escape(value) } - public constructor(name: String) { + constructor(name: String) { this.name = name this.value = null } - public fun render(): String { + fun render(): String { if (value == null) { return " " + name } @@ -161,14 +161,14 @@ override fun toString() = this.render() - public fun setValue(value: String) { + fun setValue(value: String) { this.value = value } } -public abstract class Tag protected constructor(protected var tag: String) { +abstract class Tag protected constructor(protected var tag: String) { protected var attributes: ArrayList = ArrayList() - protected var parent: Tag? = null + var parent: Tag? = null /** * Sets an attribute on an element @@ -177,7 +177,7 @@ * * * @param value the attribute value */ - public fun setAttribute(name: String, value: String?): Boolean { + fun setAttribute(name: String, value: String?): Boolean { if (value == null) { return attributes.add(Attribute(name)) } @@ -200,7 +200,7 @@ return result.toString() } - open public fun render(indent: Int = 0, pretty: Boolean = false): String { + open fun render(indent: Int = 0, pretty: Boolean = false): String { var result = StringBuilder() if (pretty) { @@ -215,7 +215,7 @@ override fun toString() = this.render() - public fun renderOpenTag(): String { + fun renderOpenTag(): String { var tagAttributes = "" for (attribute in attributes) { tagAttributes += attribute.render() @@ -223,10 +223,10 @@ return "<$tag$tagAttributes>" } - public fun renderCloseTag() = "" + fun renderCloseTag() = "" } -public class EmptyTag(tagType: String) : Tag(tagType) { +class EmptyTag(tagType: String) : Tag(tagType) { /** * Sets a custom attribute @@ -236,7 +236,7 @@ * * * @return itself for easy chaining */ - public fun attr(attribute: String, value: String?): EmptyTag { + fun attr(attribute: String, value: String?): EmptyTag { setAttribute(attribute, value) return this } @@ -245,7 +245,7 @@ * Call attr-method based on condition * [.attr] */ - public fun condAttr(condition: Boolean, attribute: String, value: String?): EmptyTag { + fun condAttr(condition: Boolean, attribute: String, value: String?): EmptyTag { return if (condition) attr(attribute, value) else this } @@ -270,46 +270,46 @@ */ //TODO: TEST ? - public fun isAutoComplete() = attr(Attr.AUTOCOMPLETE, null) - public fun isAutoFocus() = attr(Attr.AUTOFOCUS, null) - public fun isHidden() = attr(Attr.HIDDEN, null) - public fun isRequired() = attr(Attr.REQUIRED, null) - public fun withAlt(alt: String) = attr(Attr.ALT, alt) - public fun withAction(action: String) = attr(Attr.ACTION, action) - public fun withCharset(charset: String) = attr(Attr.CHARSET, charset) - public fun withClass(className: String) = attr(Attr.CLASS, className) - public fun withContent(content: String) = attr(Attr.CONTENT, content) - public fun withHref(href: String) = attr(Attr.HREF, href) - public fun withId(id: String) = attr(Attr.ID, id) - public fun withData(dataAttr: String, value: String) = attr(Attr.DATA + "-" + dataAttr, value) - public fun withMethod(method: String) = attr(Attr.METHOD, method) - public fun withName(name: String) = attr(Attr.NAME, name) - public fun withPlaceholder(placeholder: String) = attr(Attr.PLACEHOLDER, placeholder) - public fun withTarget(target: String) = attr(Attr.TARGET, target) - public fun withType(type: String) = attr(Attr.TYPE, type) - public fun withRel(rel: String) = attr(Attr.REL, rel) - public fun withSrc(src: String) = attr(Attr.SRC, src) - public fun withValue(value: String) = attr(Attr.VALUE, value) - public fun withCondAutoComplete(condition: Boolean) = condAttr(condition, Attr.AUTOCOMPLETE, null) - public fun withCondAutoFocus(condition: Boolean) = condAttr(condition, Attr.AUTOFOCUS, null) - public fun withCondHidden(condition: Boolean) = condAttr(condition, Attr.HIDDEN, null) - public fun withCondRequired(condition: Boolean) = condAttr(condition, Attr.REQUIRED, null) - public fun withCondAlt(condition: Boolean, alt: String) = condAttr(condition, Attr.ALT, alt) - public fun withCondAction(condition: Boolean, action: String) = condAttr(condition, Attr.ACTION, action) - public fun withCharset(condition: Boolean, charset: String) = condAttr(condition, Attr.CHARSET, charset) - public fun withCondClass(condition: Boolean, className: String) = condAttr(condition, Attr.CLASS, className) - public fun withCondContent(condition: Boolean, content: String) = condAttr(condition, Attr.CONTENT, content) - public fun withCondHref(condition: Boolean, href: String) = condAttr(condition, Attr.HREF, href) - public fun withCondId(condition: Boolean, id: String) = condAttr(condition, Attr.ID, id) - public fun withCondData(condition: Boolean, dataAttr: String, value: String) = condAttr(condition, Attr.DATA + "-" + dataAttr, value) - public fun withCondMethod(condition: Boolean, method: String) = condAttr(condition, Attr.METHOD, method) - public fun withCondName(condition: Boolean, name: String) = condAttr(condition, Attr.NAME, name) - public fun withCondPlaceholder(condition: Boolean, placeholder: String) = condAttr(condition, Attr.PLACEHOLDER, placeholder) - public fun withCondTarget(condition: Boolean, target: String) = condAttr(condition, Attr.TARGET, target) - public fun withCondType(condition: Boolean, type: String) = condAttr(condition, Attr.TYPE, type) - public fun withCondRel(condition: Boolean, rel: String) = condAttr(condition, Attr.REL, rel) - public fun withCondSrc(condition: Boolean, src: String) = condAttr(condition, Attr.SRC, src) - public fun withCondValue(condition: Boolean, value: String) = condAttr(condition, Attr.VALUE, value) + fun isAutoComplete() = attr(Attr.AUTOCOMPLETE, null) + fun isAutoFocus() = attr(Attr.AUTOFOCUS, null) + fun isHidden() = attr(Attr.HIDDEN, null) + fun isRequired() = attr(Attr.REQUIRED, null) + fun withAlt(alt: String) = attr(Attr.ALT, alt) + fun withAction(action: String) = attr(Attr.ACTION, action) + fun withCharset(charset: String) = attr(Attr.CHARSET, charset) + fun withClass(className: String) = attr(Attr.CLASS, className) + fun withContent(content: String) = attr(Attr.CONTENT, content) + fun withHref(href: String) = attr(Attr.HREF, href) + fun withId(id: String) = attr(Attr.ID, id) + fun withData(dataAttr: String, value: String) = attr(Attr.DATA + "-" + dataAttr, value) + fun withMethod(method: String) = attr(Attr.METHOD, method) + fun withName(name: String) = attr(Attr.NAME, name) + fun withPlaceholder(placeholder: String) = attr(Attr.PLACEHOLDER, placeholder) + fun withTarget(target: String) = attr(Attr.TARGET, target) + fun withType(type: String) = attr(Attr.TYPE, type) + fun withRel(rel: String) = attr(Attr.REL, rel) + fun withSrc(src: String) = attr(Attr.SRC, src) + fun withValue(value: String) = attr(Attr.VALUE, value) + fun withCondAutoComplete(condition: Boolean) = condAttr(condition, Attr.AUTOCOMPLETE, null) + fun withCondAutoFocus(condition: Boolean) = condAttr(condition, Attr.AUTOFOCUS, null) + fun withCondHidden(condition: Boolean) = condAttr(condition, Attr.HIDDEN, null) + fun withCondRequired(condition: Boolean) = condAttr(condition, Attr.REQUIRED, null) + fun withCondAlt(condition: Boolean, alt: String) = condAttr(condition, Attr.ALT, alt) + fun withCondAction(condition: Boolean, action: String) = condAttr(condition, Attr.ACTION, action) + fun withCharset(condition: Boolean, charset: String) = condAttr(condition, Attr.CHARSET, charset) + fun withCondClass(condition: Boolean, className: String) = condAttr(condition, Attr.CLASS, className) + fun withCondContent(condition: Boolean, content: String) = condAttr(condition, Attr.CONTENT, content) + fun withCondHref(condition: Boolean, href: String) = condAttr(condition, Attr.HREF, href) + fun withCondId(condition: Boolean, id: String) = condAttr(condition, Attr.ID, id) + fun withCondData(condition: Boolean, dataAttr: String, value: String) = condAttr(condition, Attr.DATA + "-" + dataAttr, value) + fun withCondMethod(condition: Boolean, method: String) = condAttr(condition, Attr.METHOD, method) + fun withCondName(condition: Boolean, name: String) = condAttr(condition, Attr.NAME, name) + fun withCondPlaceholder(condition: Boolean, placeholder: String) = condAttr(condition, Attr.PLACEHOLDER, placeholder) + fun withCondTarget(condition: Boolean, target: String) = condAttr(condition, Attr.TARGET, target) + fun withCondType(condition: Boolean, type: String) = condAttr(condition, Attr.TYPE, type) + fun withCondRel(condition: Boolean, rel: String) = condAttr(condition, Attr.REL, rel) + fun withCondSrc(condition: Boolean, src: String) = condAttr(condition, Attr.SRC, src) + fun withCondValue(condition: Boolean, value: String) = condAttr(condition, Attr.VALUE, value) } class Text(text: String) : Tag(text) { @@ -322,7 +322,7 @@ } } -public class UnescapedText(text: String) : Tag(text) { +class UnescapedText(text: String) : Tag(text) { override fun render(indent: Int, pretty: Boolean): String { if (pretty ) { return indent(indent) + tag @@ -334,9 +334,9 @@ override fun toString() = this.render() } -public class ContainerTag(tagType: String) : Tag(tagType), Cloneable { +class ContainerTag(tagType: String) : Tag(tagType), Cloneable { - public var children: MutableList = ArrayList() + var children: MutableList = ArrayList() /** * Appends a tag to the end of this element @@ -345,7 +345,7 @@ * * * @return itself for easy chaining */ - public fun with(child: Tag): ContainerTag { + fun with(child: Tag): ContainerTag { if (this === child) { throw Error("Cannot append a tag to itself.") } @@ -354,7 +354,7 @@ return this } - public operator fun plus(child: Tag): ContainerTag { + operator fun plus(child: Tag): ContainerTag { if (this === child) { throw Error("Cannot append a tag to itself.") } @@ -366,11 +366,11 @@ return result } - public operator fun mod(child: Tag): ContainerTag { + operator fun mod(child: Tag): ContainerTag { return with(child) } - public fun copy(): ContainerTag { + fun copy(): ContainerTag { var result = ContainerTag(tag) result.children = ArrayList(children) return result; @@ -380,7 +380,7 @@ * Call with-method based on condition * [.with] */ - public fun condWith(condition: Boolean, child: Tag) = if (condition) this.with(child) else this + fun condWith(condition: Boolean, child: Tag) = if (condition) this.with(child) else this /** * Appends a list of tags to the end of this element @@ -389,7 +389,7 @@ * * * @return itself for easy chaining */ - public fun with(children: List?): ContainerTag { + fun with(children: List?): ContainerTag { children?.forEach { this.with(it) } return this @@ -399,7 +399,7 @@ * Call with-method based on condition * [.with] */ - public fun condWith(condition: Boolean, children: List) = if (condition) this.with(children) else this + fun condWith(condition: Boolean, children: List) = if (condition) this.with(children) else this /** * Appends the tags to the end of this element @@ -408,7 +408,7 @@ * * * @return itself for easy chaining */ - public fun with(vararg children: Tag): ContainerTag { + fun with(vararg children: Tag): ContainerTag { for (aChildren in children) { with(aChildren) } @@ -419,7 +419,7 @@ * Call with-method based on condition * [.with] */ - public fun condWith(condition: Boolean, vararg children: Tag) = if (condition) this.with(*children) else this + fun condWith(condition: Boolean, vararg children: Tag) = if (condition) this.with(*children) else this /** * Appends a text tag to this element @@ -428,7 +428,7 @@ * * * @return itself for easy chaining */ - public fun withText(text: String) = with(Text(text)) + fun withText(text: String) = with(Text(text)) /** * Sets a custom attribute @@ -439,7 +439,7 @@ * * * @return itself for easy chaining */ - public fun attr(attribute: String, value: String?): ContainerTag { + fun attr(attribute: String, value: String?): ContainerTag { setAttribute(attribute, value) return this } @@ -448,7 +448,7 @@ * Call attr-method based on condition * [.attr] */ - public fun condAttr(condition: Boolean, attribute: String, value: String?) = if (condition) attr(attribute, value) else this + fun condAttr(condition: Boolean, attribute: String, value: String?) = if (condition) attr(attribute, value) else this /** * Render the tag and its children diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..a6b6b3c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,5 +18,9 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml deleted file mode 100644 index d831e3f..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml new file mode 100644 index 0000000..859324a --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml deleted file mode 100644 index a33aad3..0000000 --- a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_0_beta_1038.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml new file mode 100644 index 0000000..3207038 --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1e1f62b..05dde8f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index da23a03..e4f4a1d 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/.idea/modules/k2html.iml b/.idea/modules/k2html.iml new file mode 100644 index 0000000..b49dabe --- /dev/null +++ b/.idea/modules/k2html.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_main.iml b/.idea/modules/k2html_main.iml new file mode 100644 index 0000000..4606a46 --- /dev/null +++ b/.idea/modules/k2html_main.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/k2html_test.iml b/.idea/modules/k2html_test.iml new file mode 100644 index 0000000..d9a9466 --- /dev/null +++ b/.idea/modules/k2html_test.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9c4001c..7a994f1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'nl.astraeus.tag' -version '1.2-SNAPSHOT' +version '1.3-SNAPSHOT' apply plugin: 'kotlin' apply plugin: 'idea' @@ -18,7 +18,7 @@ } buildscript { - ext.kotlin_version = '1.+' + ext.kotlin_version = '1.0.4' repositories { maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" diff --git a/k2html.iml b/k2html.iml deleted file mode 100644 index 8f5996e..0000000 --- a/k2html.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/nl/astraeus/tag/TagCreator.kt b/src/nl/astraeus/tag/TagCreator.kt index 03b563a..ddd36a0 100644 --- a/src/nl/astraeus/tag/TagCreator.kt +++ b/src/nl/astraeus/tag/TagCreator.kt @@ -5,7 +5,7 @@ /** * Created by rnentjes on 15-9-15. */ -public fun escape(s: String): String { +fun escape(s: String): String { if ("" == s) { return "" } @@ -25,134 +25,134 @@ return out.toString() } -public object Attr { - public val HIDDEN: String = "hidden" - public val HIGH: String = "high" - public val HREF: String = "href" - public val HREFLANG: String = "hreflang" - public val HTTP_EQUIV: String = "http-equiv" - public val ICON: String = "icon" - public val ID: String = "id" - public val ISMAP: String = "ismap" - public val ITEMPROP: String = "itemprop" - public val KEYTYPE: String = "keytype" - public val KIND: String = "kind" - public val LABEL: String = "label" - public val LANG: String = "lang" - public val LANGUAGE: String = "language" - public val LIST: String = "list" - public val LOOP: String = "loop" - public val LOW: String = "low" - public val MANIFEST: String = "manifest" - public val MAX: String = "max" - public val MAXLENGTH: String = "maxlength" - public val MEDIA: String = "media" - public val METHOD: String = "method" - public val MIN: String = "min" - public val MULTIPLE: String = "multiple" - public val NAME: String = "name" - public val NOVALIDATE: String = "novalidate" - public val OPEN: String = "open" - public val OPTIMUM: String = "optimum" - public val PATTERN: String = "pattern" - public val PING: String = "ping" - public val PLACEHOLDER: String = "placeholder" - public val POSTER: String = "poster" - public val PRELOAD: String = "preload" - public val PUBDATE: String = "pubdate" - public val RADIOGROUP: String = "radiogroup" - public val READONLY: String = "readonly" - public val REL: String = "rel" - public val REQUIRED: String = "required" - public val REVERSED: String = "reversed" - public val ROWS: String = "rows" - public val ROWSPAN: String = "rowspan" - public val SANDBOX: String = "sandbox" - public val SPELLCHECK: String = "spellcheck" - public val SCOPE: String = "scope" - public val SCOPED: String = "scoped" - public val SEAMLESS: String = "seamless" - public val SELECTED: String = "selected" - public val SHAPE: String = "shape" - public val SIZE: String = "size" - public val SIZES: String = "sizes" - public val SPAN: String = "span" - public val SRC: String = "src" - public val SRCDOC: String = "srcdoc" - public val SRCLANG: String = "srclang" - public val SRCSET: String = "srcset" - public val START: String = "start" - public val STEP: String = "step" - public val STYLE: String = "style" - public val SUMMARY: String = "summary" - public val TABINDEX: String = "tabindex" - public val TARGET: String = "target" - public val TITLE: String = "title" - public val TYPE: String = "type" - public val USEMAP: String = "usemap" - public val VALUE: String = "value" - public val WIDTH: String = "width" - public val WRAP: String = "wrap" - public val BORDER: String = "border" - public val BUFFERED: String = "buffered" - public val CHALLENGE: String = "challenge" - public val CHARSET: String = "charset" - public val CHECKED: String = "checked" - public val CITE: String = "cite" - public val CLASS: String = "class" - public val COLOR: String = "color" - public val COLS: String = "cols" - public val COLSPAN: String = "colspan" - public val CONTENT: String = "content" - public val CONTENTEDITABLE: String = "contenteditable" - public val CONTEXTMENU: String = "contextmenu" - public val CONTROLS: String = "controls" - public val COORDS: String = "coords" - public val DATA: String = "data" - public val DATETIME: String = "datetime" - public val DEFAULT: String = "default" - public val DEFER: String = "defer" - public val DIR: String = "dir" - public val DIRNAME: String = "dirname" - public val DISABLED: String = "disabled" - public val DOWNLOAD: String = "download" - public val DRAGGABLE: String = "draggable" - public val DROPZONE: String = "dropzone" - public val ENCTYPE: String = "enctype" - public val FOR: String = "for" - public val FORM: String = "form" - public val FORMACTION: String = "formaction" - public val HEADERS: String = "headers" - public val HEIGHT: String = "height" - public val ACCEPT: String = "accept" - public val ACCEPT_CHARSET: String = "accept-charset" - public val ACCESSKEY: String = "accesskey" - public val ACTION: String = "action" - public val ALIGN: String = "align" - public val ALT: String = "alt" - public val ASYNC: String = "async" - public val AUTOCOMPLETE: String = "autocomplete" - public val AUTOFOCUS: String = "autofocus" - public val AUTOPLAY: String = "autoplay" - public val AUTOSAVE: String = "autosave" +object Attr { + val HIDDEN: String = "hidden" + val HIGH: String = "high" + val HREF: String = "href" + val HREFLANG: String = "hreflang" + val HTTP_EQUIV: String = "http-equiv" + val ICON: String = "icon" + val ID: String = "id" + val ISMAP: String = "ismap" + val ITEMPROP: String = "itemprop" + val KEYTYPE: String = "keytype" + val KIND: String = "kind" + val LABEL: String = "label" + val LANG: String = "lang" + val LANGUAGE: String = "language" + val LIST: String = "list" + val LOOP: String = "loop" + val LOW: String = "low" + val MANIFEST: String = "manifest" + val MAX: String = "max" + val MAXLENGTH: String = "maxlength" + val MEDIA: String = "media" + val METHOD: String = "method" + val MIN: String = "min" + val MULTIPLE: String = "multiple" + val NAME: String = "name" + val NOVALIDATE: String = "novalidate" + val OPEN: String = "open" + val OPTIMUM: String = "optimum" + val PATTERN: String = "pattern" + val PING: String = "ping" + val PLACEHOLDER: String = "placeholder" + val POSTER: String = "poster" + val PRELOAD: String = "preload" + val PUBDATE: String = "pubdate" + val RADIOGROUP: String = "radiogroup" + val READONLY: String = "readonly" + val REL: String = "rel" + val REQUIRED: String = "required" + val REVERSED: String = "reversed" + val ROWS: String = "rows" + val ROWSPAN: String = "rowspan" + val SANDBOX: String = "sandbox" + val SPELLCHECK: String = "spellcheck" + val SCOPE: String = "scope" + val SCOPED: String = "scoped" + val SEAMLESS: String = "seamless" + val SELECTED: String = "selected" + val SHAPE: String = "shape" + val SIZE: String = "size" + val SIZES: String = "sizes" + val SPAN: String = "span" + val SRC: String = "src" + val SRCDOC: String = "srcdoc" + val SRCLANG: String = "srclang" + val SRCSET: String = "srcset" + val START: String = "start" + val STEP: String = "step" + val STYLE: String = "style" + val SUMMARY: String = "summary" + val TABINDEX: String = "tabindex" + val TARGET: String = "target" + val TITLE: String = "title" + val TYPE: String = "type" + val USEMAP: String = "usemap" + val VALUE: String = "value" + val WIDTH: String = "width" + val WRAP: String = "wrap" + val BORDER: String = "border" + val BUFFERED: String = "buffered" + val CHALLENGE: String = "challenge" + val CHARSET: String = "charset" + val CHECKED: String = "checked" + val CITE: String = "cite" + val CLASS: String = "class" + val COLOR: String = "color" + val COLS: String = "cols" + val COLSPAN: String = "colspan" + val CONTENT: String = "content" + val CONTENTEDITABLE: String = "contenteditable" + val CONTEXTMENU: String = "contextmenu" + val CONTROLS: String = "controls" + val COORDS: String = "coords" + val DATA: String = "data" + val DATETIME: String = "datetime" + val DEFAULT: String = "default" + val DEFER: String = "defer" + val DIR: String = "dir" + val DIRNAME: String = "dirname" + val DISABLED: String = "disabled" + val DOWNLOAD: String = "download" + val DRAGGABLE: String = "draggable" + val DROPZONE: String = "dropzone" + val ENCTYPE: String = "enctype" + val FOR: String = "for" + val FORM: String = "form" + val FORMACTION: String = "formaction" + val HEADERS: String = "headers" + val HEIGHT: String = "height" + val ACCEPT: String = "accept" + val ACCEPT_CHARSET: String = "accept-charset" + val ACCESSKEY: String = "accesskey" + val ACTION: String = "action" + val ALIGN: String = "align" + val ALT: String = "alt" + val ASYNC: String = "async" + val AUTOCOMPLETE: String = "autocomplete" + val AUTOFOCUS: String = "autofocus" + val AUTOPLAY: String = "autoplay" + val AUTOSAVE: String = "autosave" } -public class Attribute { - public var name: String +class Attribute { + var name: String private set private var value: String? = null - public constructor(name: String, value: String) { + constructor(name: String, value: String) { this.name = name this.value = escape(value) } - public constructor(name: String) { + constructor(name: String) { this.name = name this.value = null } - public fun render(): String { + fun render(): String { if (value == null) { return " " + name } @@ -161,14 +161,14 @@ override fun toString() = this.render() - public fun setValue(value: String) { + fun setValue(value: String) { this.value = value } } -public abstract class Tag protected constructor(protected var tag: String) { +abstract class Tag protected constructor(protected var tag: String) { protected var attributes: ArrayList = ArrayList() - protected var parent: Tag? = null + var parent: Tag? = null /** * Sets an attribute on an element @@ -177,7 +177,7 @@ * * * @param value the attribute value */ - public fun setAttribute(name: String, value: String?): Boolean { + fun setAttribute(name: String, value: String?): Boolean { if (value == null) { return attributes.add(Attribute(name)) } @@ -200,7 +200,7 @@ return result.toString() } - open public fun render(indent: Int = 0, pretty: Boolean = false): String { + open fun render(indent: Int = 0, pretty: Boolean = false): String { var result = StringBuilder() if (pretty) { @@ -215,7 +215,7 @@ override fun toString() = this.render() - public fun renderOpenTag(): String { + fun renderOpenTag(): String { var tagAttributes = "" for (attribute in attributes) { tagAttributes += attribute.render() @@ -223,10 +223,10 @@ return "<$tag$tagAttributes>" } - public fun renderCloseTag() = "" + fun renderCloseTag() = "" } -public class EmptyTag(tagType: String) : Tag(tagType) { +class EmptyTag(tagType: String) : Tag(tagType) { /** * Sets a custom attribute @@ -236,7 +236,7 @@ * * * @return itself for easy chaining */ - public fun attr(attribute: String, value: String?): EmptyTag { + fun attr(attribute: String, value: String?): EmptyTag { setAttribute(attribute, value) return this } @@ -245,7 +245,7 @@ * Call attr-method based on condition * [.attr] */ - public fun condAttr(condition: Boolean, attribute: String, value: String?): EmptyTag { + fun condAttr(condition: Boolean, attribute: String, value: String?): EmptyTag { return if (condition) attr(attribute, value) else this } @@ -270,46 +270,46 @@ */ //TODO: TEST ? - public fun isAutoComplete() = attr(Attr.AUTOCOMPLETE, null) - public fun isAutoFocus() = attr(Attr.AUTOFOCUS, null) - public fun isHidden() = attr(Attr.HIDDEN, null) - public fun isRequired() = attr(Attr.REQUIRED, null) - public fun withAlt(alt: String) = attr(Attr.ALT, alt) - public fun withAction(action: String) = attr(Attr.ACTION, action) - public fun withCharset(charset: String) = attr(Attr.CHARSET, charset) - public fun withClass(className: String) = attr(Attr.CLASS, className) - public fun withContent(content: String) = attr(Attr.CONTENT, content) - public fun withHref(href: String) = attr(Attr.HREF, href) - public fun withId(id: String) = attr(Attr.ID, id) - public fun withData(dataAttr: String, value: String) = attr(Attr.DATA + "-" + dataAttr, value) - public fun withMethod(method: String) = attr(Attr.METHOD, method) - public fun withName(name: String) = attr(Attr.NAME, name) - public fun withPlaceholder(placeholder: String) = attr(Attr.PLACEHOLDER, placeholder) - public fun withTarget(target: String) = attr(Attr.TARGET, target) - public fun withType(type: String) = attr(Attr.TYPE, type) - public fun withRel(rel: String) = attr(Attr.REL, rel) - public fun withSrc(src: String) = attr(Attr.SRC, src) - public fun withValue(value: String) = attr(Attr.VALUE, value) - public fun withCondAutoComplete(condition: Boolean) = condAttr(condition, Attr.AUTOCOMPLETE, null) - public fun withCondAutoFocus(condition: Boolean) = condAttr(condition, Attr.AUTOFOCUS, null) - public fun withCondHidden(condition: Boolean) = condAttr(condition, Attr.HIDDEN, null) - public fun withCondRequired(condition: Boolean) = condAttr(condition, Attr.REQUIRED, null) - public fun withCondAlt(condition: Boolean, alt: String) = condAttr(condition, Attr.ALT, alt) - public fun withCondAction(condition: Boolean, action: String) = condAttr(condition, Attr.ACTION, action) - public fun withCharset(condition: Boolean, charset: String) = condAttr(condition, Attr.CHARSET, charset) - public fun withCondClass(condition: Boolean, className: String) = condAttr(condition, Attr.CLASS, className) - public fun withCondContent(condition: Boolean, content: String) = condAttr(condition, Attr.CONTENT, content) - public fun withCondHref(condition: Boolean, href: String) = condAttr(condition, Attr.HREF, href) - public fun withCondId(condition: Boolean, id: String) = condAttr(condition, Attr.ID, id) - public fun withCondData(condition: Boolean, dataAttr: String, value: String) = condAttr(condition, Attr.DATA + "-" + dataAttr, value) - public fun withCondMethod(condition: Boolean, method: String) = condAttr(condition, Attr.METHOD, method) - public fun withCondName(condition: Boolean, name: String) = condAttr(condition, Attr.NAME, name) - public fun withCondPlaceholder(condition: Boolean, placeholder: String) = condAttr(condition, Attr.PLACEHOLDER, placeholder) - public fun withCondTarget(condition: Boolean, target: String) = condAttr(condition, Attr.TARGET, target) - public fun withCondType(condition: Boolean, type: String) = condAttr(condition, Attr.TYPE, type) - public fun withCondRel(condition: Boolean, rel: String) = condAttr(condition, Attr.REL, rel) - public fun withCondSrc(condition: Boolean, src: String) = condAttr(condition, Attr.SRC, src) - public fun withCondValue(condition: Boolean, value: String) = condAttr(condition, Attr.VALUE, value) + fun isAutoComplete() = attr(Attr.AUTOCOMPLETE, null) + fun isAutoFocus() = attr(Attr.AUTOFOCUS, null) + fun isHidden() = attr(Attr.HIDDEN, null) + fun isRequired() = attr(Attr.REQUIRED, null) + fun withAlt(alt: String) = attr(Attr.ALT, alt) + fun withAction(action: String) = attr(Attr.ACTION, action) + fun withCharset(charset: String) = attr(Attr.CHARSET, charset) + fun withClass(className: String) = attr(Attr.CLASS, className) + fun withContent(content: String) = attr(Attr.CONTENT, content) + fun withHref(href: String) = attr(Attr.HREF, href) + fun withId(id: String) = attr(Attr.ID, id) + fun withData(dataAttr: String, value: String) = attr(Attr.DATA + "-" + dataAttr, value) + fun withMethod(method: String) = attr(Attr.METHOD, method) + fun withName(name: String) = attr(Attr.NAME, name) + fun withPlaceholder(placeholder: String) = attr(Attr.PLACEHOLDER, placeholder) + fun withTarget(target: String) = attr(Attr.TARGET, target) + fun withType(type: String) = attr(Attr.TYPE, type) + fun withRel(rel: String) = attr(Attr.REL, rel) + fun withSrc(src: String) = attr(Attr.SRC, src) + fun withValue(value: String) = attr(Attr.VALUE, value) + fun withCondAutoComplete(condition: Boolean) = condAttr(condition, Attr.AUTOCOMPLETE, null) + fun withCondAutoFocus(condition: Boolean) = condAttr(condition, Attr.AUTOFOCUS, null) + fun withCondHidden(condition: Boolean) = condAttr(condition, Attr.HIDDEN, null) + fun withCondRequired(condition: Boolean) = condAttr(condition, Attr.REQUIRED, null) + fun withCondAlt(condition: Boolean, alt: String) = condAttr(condition, Attr.ALT, alt) + fun withCondAction(condition: Boolean, action: String) = condAttr(condition, Attr.ACTION, action) + fun withCharset(condition: Boolean, charset: String) = condAttr(condition, Attr.CHARSET, charset) + fun withCondClass(condition: Boolean, className: String) = condAttr(condition, Attr.CLASS, className) + fun withCondContent(condition: Boolean, content: String) = condAttr(condition, Attr.CONTENT, content) + fun withCondHref(condition: Boolean, href: String) = condAttr(condition, Attr.HREF, href) + fun withCondId(condition: Boolean, id: String) = condAttr(condition, Attr.ID, id) + fun withCondData(condition: Boolean, dataAttr: String, value: String) = condAttr(condition, Attr.DATA + "-" + dataAttr, value) + fun withCondMethod(condition: Boolean, method: String) = condAttr(condition, Attr.METHOD, method) + fun withCondName(condition: Boolean, name: String) = condAttr(condition, Attr.NAME, name) + fun withCondPlaceholder(condition: Boolean, placeholder: String) = condAttr(condition, Attr.PLACEHOLDER, placeholder) + fun withCondTarget(condition: Boolean, target: String) = condAttr(condition, Attr.TARGET, target) + fun withCondType(condition: Boolean, type: String) = condAttr(condition, Attr.TYPE, type) + fun withCondRel(condition: Boolean, rel: String) = condAttr(condition, Attr.REL, rel) + fun withCondSrc(condition: Boolean, src: String) = condAttr(condition, Attr.SRC, src) + fun withCondValue(condition: Boolean, value: String) = condAttr(condition, Attr.VALUE, value) } class Text(text: String) : Tag(text) { @@ -322,7 +322,7 @@ } } -public class UnescapedText(text: String) : Tag(text) { +class UnescapedText(text: String) : Tag(text) { override fun render(indent: Int, pretty: Boolean): String { if (pretty ) { return indent(indent) + tag @@ -334,9 +334,9 @@ override fun toString() = this.render() } -public class ContainerTag(tagType: String) : Tag(tagType), Cloneable { +class ContainerTag(tagType: String) : Tag(tagType), Cloneable { - public var children: MutableList = ArrayList() + var children: MutableList = ArrayList() /** * Appends a tag to the end of this element @@ -345,7 +345,7 @@ * * * @return itself for easy chaining */ - public fun with(child: Tag): ContainerTag { + fun with(child: Tag): ContainerTag { if (this === child) { throw Error("Cannot append a tag to itself.") } @@ -354,7 +354,7 @@ return this } - public operator fun plus(child: Tag): ContainerTag { + operator fun plus(child: Tag): ContainerTag { if (this === child) { throw Error("Cannot append a tag to itself.") } @@ -366,11 +366,11 @@ return result } - public operator fun mod(child: Tag): ContainerTag { + operator fun mod(child: Tag): ContainerTag { return with(child) } - public fun copy(): ContainerTag { + fun copy(): ContainerTag { var result = ContainerTag(tag) result.children = ArrayList(children) return result; @@ -380,7 +380,7 @@ * Call with-method based on condition * [.with] */ - public fun condWith(condition: Boolean, child: Tag) = if (condition) this.with(child) else this + fun condWith(condition: Boolean, child: Tag) = if (condition) this.with(child) else this /** * Appends a list of tags to the end of this element @@ -389,7 +389,7 @@ * * * @return itself for easy chaining */ - public fun with(children: List?): ContainerTag { + fun with(children: List?): ContainerTag { children?.forEach { this.with(it) } return this @@ -399,7 +399,7 @@ * Call with-method based on condition * [.with] */ - public fun condWith(condition: Boolean, children: List) = if (condition) this.with(children) else this + fun condWith(condition: Boolean, children: List) = if (condition) this.with(children) else this /** * Appends the tags to the end of this element @@ -408,7 +408,7 @@ * * * @return itself for easy chaining */ - public fun with(vararg children: Tag): ContainerTag { + fun with(vararg children: Tag): ContainerTag { for (aChildren in children) { with(aChildren) } @@ -419,7 +419,7 @@ * Call with-method based on condition * [.with] */ - public fun condWith(condition: Boolean, vararg children: Tag) = if (condition) this.with(*children) else this + fun condWith(condition: Boolean, vararg children: Tag) = if (condition) this.with(*children) else this /** * Appends a text tag to this element @@ -428,7 +428,7 @@ * * * @return itself for easy chaining */ - public fun withText(text: String) = with(Text(text)) + fun withText(text: String) = with(Text(text)) /** * Sets a custom attribute @@ -439,7 +439,7 @@ * * * @return itself for easy chaining */ - public fun attr(attribute: String, value: String?): ContainerTag { + fun attr(attribute: String, value: String?): ContainerTag { setAttribute(attribute, value) return this } @@ -448,7 +448,7 @@ * Call attr-method based on condition * [.attr] */ - public fun condAttr(condition: Boolean, attribute: String, value: String?) = if (condition) attr(attribute, value) else this + fun condAttr(condition: Boolean, attribute: String, value: String?) = if (condition) attr(attribute, value) else this /** * Render the tag and its children diff --git a/test/nl/astraeus/tag/BasicTest.kt b/test/nl/astraeus/tag/BasicTest.kt index 524cb1f..0d48d31 100644 --- a/test/nl/astraeus/tag/BasicTest.kt +++ b/test/nl/astraeus/tag/BasicTest.kt @@ -1,14 +1,13 @@ package nl.astraeus.tag import org.junit.Test -import kotlin.test.assertTrue /** * Created by rnentjes on 20-10-15. */ fun form(id: String, inline: Boolean = false): ContainerTag { - var result = form().withId(id) + val result = form().withId(id) if (inline) { result.withClass("form-online") @@ -20,7 +19,7 @@ } fun textInput(id: String, label: String = "", ph: String = "", value: String = ""): ContainerTag { - var result = div().withClass("form-group") + val result = div().withClass("form-group") result.with(label(label).attr("for", id)) result.with(input() @@ -38,29 +37,25 @@ class BasicTest { @Test fun basicTest() { - var html = div().with( + val html = div().with( h1("Hello world!") ).with(hr()) - assertTrue { - html.render().equals("

Hello world!


") - } + assert(html.render() == "

Hello world!


") - assertTrue { - html.render(pretty = true).equals("
\n

\n Hello world!\n

\n
\n
") - } + assert (html.render(pretty = true) == "
\n

\n Hello world!\n

\n
\n
") } @Test fun bsTest() { - var form = form("form", inline = true) + val form = form("form", inline = true) form.with(textInput("name", "Name", "Type your name here")) form.with(textInput("email", "Email", "Type your email here", "")) println(form.render(pretty=true)) - assertTrue { - form.render(pretty = true).equals("""
+ assert ( + form.render(pretty = true) == """
""") - } var head = head()