@@ -2,23 +2,31 @@ package camundala.helper.dev.company
2
2
3
3
import camundala .helper .dev .update .createIfNotExists
4
4
5
- case class CompanyDocsGenerator (companyCamundala : os.Path ):
6
- private lazy val docs = companyCamundala / s " 00-docs " / " src" / " docs"
5
+ import java .time .LocalDate
6
+
7
+ case class CompanyDocsGenerator (companyCamundala : os.Path ):
8
+ private lazy val docsBase = companyCamundala / s " 00-docs "
9
+ private lazy val docsSrc = docsBase / " src" / " docs"
7
10
8
11
lazy val generate : Unit =
9
- println(" Generate Company Docs" )
10
- // generate docs
11
- directory(" dependencies" , " Dependencies" , isVersioned = true )
12
- directory(" helium" , " Helium" , isVersioned = false )
13
- contact
14
- instructions
15
- favicon
16
- pattern
17
- statistics
18
- style
12
+ println(" Generate Company Docs" )
13
+ // generate docs
14
+ directory(" dependencies" , " Dependencies" , isVersioned = true )
15
+ directory(" helium" , " Helium" , isVersioned = false )
16
+ contact
17
+ instructions
18
+ favicon
19
+ pattern
20
+ statistics
21
+ style
22
+ config
23
+ versions(" VERSIONS" )
24
+ versions(" VERSIONS_PREVIOUS" )
25
+ end generate
19
26
20
27
private lazy val contact =
21
- createIfNotExists(docs / " contact.md" ,
28
+ createIfNotExists(
29
+ docsSrc / " contact.md" ,
22
30
s """ |## Contact
23
31
|If you have questions, spot a bug or you miss something, please let us know🤓.
24
32
|
@@ -29,7 +37,8 @@ case class CompanyDocsGenerator (companyCamundala: os.Path):
29
37
| """ .stripMargin
30
38
)
31
39
private lazy val instructions =
32
- createIfNotExists(docs / " instructions.md" ,
40
+ createIfNotExists(
41
+ docsSrc / " instructions.md" ,
33
42
s """ |## Create This Page
34
43
|This is a semi-automatic process. This should be done either to prepare a Release or after a Release.
35
44
|
@@ -40,7 +49,8 @@ case class CompanyDocsGenerator (companyCamundala: os.Path):
40
49
)
41
50
42
51
private lazy val pattern =
43
- createIfNotExists(docs / " pattern.md" ,
52
+ createIfNotExists(
53
+ docsSrc / " pattern.md" ,
44
54
s """ |# Process Pattern
45
55
|We try to establish Patterns for doing the same tasks.
46
56
|This documentation lists them and gives you some examples.
@@ -49,17 +59,20 @@ case class CompanyDocsGenerator (companyCamundala: os.Path):
49
59
| """ .stripMargin
50
60
)
51
61
private lazy val statistics =
52
- createIfNotExists(docs / " statistics.md" ,
62
+ createIfNotExists(
63
+ docsSrc / " statistics.md" ,
53
64
s """ |# Process Statistics
54
65
|
55
66
|The Process Statistics you find new in Camunda Optimize.
56
67
|
57
68
|TODO - Create here a link to the Optimize Dashboard or add some statistics manually.
58
69
|
59
70
|<iframe id="optimizeFrame" src="https://TODO/" frameborder="0" style="width: 1000px; height: 700px; allowtransparency; overflow: scroll"></iframe>
60
- | """ .stripMargin)
71
+ | """ .stripMargin
72
+ )
61
73
private lazy val style =
62
- createIfNotExists(docs / " style.md" ,
74
+ createIfNotExists(
75
+ docsSrc / " style.md" ,
63
76
s """ |.mermaid svg {
64
77
| height: 400px;
65
78
|}
@@ -68,24 +81,65 @@ case class CompanyDocsGenerator (companyCamundala: os.Path):
68
81
| margin-right: 40px;
69
82
| width: 400px;
70
83
|}
71
- | """ .stripMargin)
84
+ | """ .stripMargin
85
+ )
72
86
73
87
private lazy val favicon =
74
- val faviconPath = docs / " favicon.ico"
88
+ val faviconPath = docsSrc / " favicon.ico"
75
89
if ! os.exists(faviconPath) then
76
90
os.write(faviconPath, (os.resource / " favicon.ico" ).toSource)
77
91
78
92
private def directory (name : String , title : String , isVersioned : Boolean ) =
79
- os.makeDir.all(docs / name)
80
- createIfNotExists(docs / name / " directory.md" ,
93
+ os.makeDir.all(docsSrc / name)
94
+ createIfNotExists(
95
+ docsSrc / name / " directory.md" ,
81
96
s """ | ${laikaVersioned(isVersioned)}
82
- |
83
- | ${laikaTitle(title)}
84
- |
85
- | $laikaNavigationOrder
86
- | """ .stripMargin
97
+ |
98
+ | ${laikaTitle(title)}
99
+ |
100
+ | $laikaNavigationOrder
101
+ | """ .stripMargin
87
102
)
103
+ end directory
88
104
89
105
private def laikaVersioned (isVersioned : Boolean ) = s " laika.versioned = $isVersioned"
90
106
private def laikaTitle (title : String ) = s " laika.title = $title"
91
107
private lazy val laikaNavigationOrder = s " laika.navigationOrder = [ \n ] "
108
+
109
+ private lazy val config =
110
+ createIfNotExists(
111
+ docsBase / " CONFIG.conf" ,
112
+ s """ |// year and month you want to release
113
+ |release.tag = " ${LocalDate .now().toString.take(7 )}"
114
+ |// a list with existing Releases on the web server
115
+ |releases.older = []
116
+ |// flag of this is for the release or just from the TST to see what is going on.
117
+ |released = true
118
+ |// this is the url of the release planing, e.g. Jira
119
+ |jira.release.url = "https://yourReleasePage/versions/64209"
120
+ |// who is responsible for the Release
121
+ |release.responsible {
122
+ | name = "Peter Blank"
123
+ | date = "CHANGE to release date"
124
+ |}
125
+ |// what is the release about (abstract as markup)
126
+ |release.notes = \"\"\"
127
+ |- TODO: Describe the Release here
128
+ | """ .stripMargin
129
+ )
130
+ private def versions (name : String ) =
131
+ createIfNotExists(
132
+ docsBase / s " $name.conf " ,
133
+ s """ |// START VERSIONS
134
+ |
135
+ |myProjectWorkerVersion = "1.0.0"
136
+ |//..
137
+ |
138
+ |// END WOKRER
139
+ |
140
+ |myProjectVersion = "1.0.3"
141
+ |//..
142
+ |
143
+ |// END VERSIONS
144
+ | """ .stripMargin)
145
+ end CompanyDocsGenerator
0 commit comments