Skip to content

Commit 5585392

Browse files
committed
Sample kotlin source
1 parent 2a940c3 commit 5585392

File tree

5 files changed

+70
-27
lines changed

5 files changed

+70
-27
lines changed

fj-doc-playground-quarkus/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<exec-plugin.version>3.2.0</exec-plugin.version>
2525
<antrun-plugin.version>3.1.0</antrun-plugin.version>
2626
<fj-service-helper-bom-version>1.4.0</fj-service-helper-bom-version>
27-
<fj-doc-ext-kotlin-version>0.2.0</fj-doc-ext-kotlin-version>
27+
<fj-doc-ext-kotlin-version>0.3.1</fj-doc-ext-kotlin-version>
2828
</properties>
2929
<dependencyManagement>
3030
<dependencies>

fj-doc-sample/src/main/resources/sample_docs/doc_catalog.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
<doc id="full_document_yaml" type="yaml" path="playground/full-document.yaml" description="More complex YAML source document"/>
2424
<doc id="doc-01" type="xml" path="playground/doc_test_01.xml" description="Image loading (does not work in excel format)"/>
2525
<doc id="doc-02" type="xml" path="playground/full_doc_header_footer.xml" description="Document which contains most tags"/>
26-
<doc id="kts-01" type="kts" path="playground/sample-1.kts" description="Sample fugerit kotlin document"/>
26+
<doc id="kts-01" type="kts" path="playground/sample-1.kts" jsonDataPath="playground/data/kotlin.json"
27+
description="Sample fugerit kotlin document 1 with params"/>
28+
<doc id="kts-02" type="kts" path="playground/sample-2.kts" jsonDataPath="playground/data/kotlin.json"
29+
description="Sample fugerit kotlin document 2 with no params"/>
2730
</catalog>
2831

2932
</doc-catalog>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"docTitle":"My Kotlin Template Sample Doc Title",
3+
"listPeople": [
4+
{ "name":"Luthien", "surname":"Tinuviel", "title":"Queen" },
5+
{ "name":"Thorin", "surname":"Oakshield", "title":"King" }
6+
]
7+
}
Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
11
import org.fugerit.java.doc.base.kotlin.dsl.dslDoc
22

33
dslDoc {
4+
val docTitle = attStr( data, "docTitle" )
45
meta {
5-
info( ( "DSL Kotlin Document From JUnit 2" ) ).name( "doc-title" )
6+
info( ( docTitle ) ).name( "doc-title" )
7+
info( ( "10;10;10;30" ) ).name( "margins" )
8+
info( ( "fj doc venus sample source Kotlin Template - kts" ) ).name( "doc-subject" )
9+
info( ( "fugerit79" ) ).name( "dock-author" )
10+
info( ( "en" ) ).name( "doc-language" )
11+
info( ( "TitilliumWeb" ) ).name( "default-font-name" )
12+
info( ( "data-table=print" ) ).name( "excel-table-id" )
13+
info( ( "data-table" ) ).name( "csv-table-id" )
14+
footerExt {
15+
para( '$'+"{currentPage} / "+'$'+"{pageCount}" ).align( "right" )
16+
}
617
}
718
body {
8-
para( "Concise paragraph" )
9-
.align( "center" )
10-
.style( "bold" )
11-
.whiteSpaceCollapse( true )
12-
.spaceLeft( 10 )
13-
.leading( 1 )
14-
.format( "{}" )
15-
para {
16-
setText("Verbose paragraph")
17-
align( "left" )
18-
style( "italic" )
19-
whiteSpaceCollapse( true )
20-
spaceAfter( 10 )
21-
foreColor( "#000000" )
22-
backColor( "#ffffff" )
23-
}
24-
phrase( "Inline phrase" ).style( "normal" ).size( 8 )
19+
h( docTitle ).headLevel( 1 )
2520
table {
2621
row {
27-
cell { para( "col 1" ) }
28-
cell { para( "col 2" ) }
22+
cell { para( "Name" ) }.align( "center" )
23+
cell { para( "Surname" ) }.align( "center" )
24+
cell { para( "Title" ) }.align( "center" )
2925
}.header( true )
30-
row {
31-
cell { para( "data 1" ) }
32-
cell { para( "data 2" ) }
33-
}
34-
}.width( 100 ).columns( 2 ).colwidths( "50;50" )
26+
attListMap( data, "listPeople" ).forEach( { e -> row {
27+
cell { para( attStr( e, "name" ) ) }
28+
cell { para( attStr( e, "surname" ) ) }
29+
cell { para( attStr( e, "title" ) ) }
30+
} } )
31+
}.columns( 3 ).colwidths( "30;30;40" ).width( 100 ).id( "data-table" ).padding( 2 )
3532
}
3633
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import org.fugerit.java.doc.base.kotlin.dsl.dslDoc
2+
3+
dslDoc {
4+
meta {
5+
info( ( "DSL Kotlin Document From JUnit 2" ) ).name( "doc-title" )
6+
}
7+
body {
8+
para( "Concise paragraph" )
9+
.align( "center" )
10+
.style( "bold" )
11+
.whiteSpaceCollapse( true )
12+
.spaceLeft( 10 )
13+
.leading( 1 )
14+
.format( "{}" )
15+
para {
16+
setText("Verbose paragraph")
17+
align( "left" )
18+
style( "italic" )
19+
whiteSpaceCollapse( true )
20+
spaceAfter( 10 )
21+
foreColor( "#000000" )
22+
backColor( "#ffffff" )
23+
}
24+
phrase( "Inline phrase" ).style( "normal" ).size( 8 )
25+
table {
26+
row {
27+
cell { para( "col 1" ) }
28+
cell { para( "col 2" ) }
29+
}.header( true )
30+
row {
31+
cell { para( "data 1" ) }
32+
cell { para( "data 2" ) }
33+
}
34+
}.width( 100 ).columns( 2 ).colwidths( "50;50" )
35+
}
36+
}

0 commit comments

Comments
 (0)