Skip to content

Commit e4cc15b

Browse files
committed
Added 00-docs CONFIG/VERSIONS files in CompanyDocsGenerator.
1 parent 9aaec94 commit e4cc15b

File tree

1 file changed

+81
-27
lines changed

1 file changed

+81
-27
lines changed

04-helper/src/main/scala/camundala/helper/dev/company/CompanyDocsGenerator.scala

Lines changed: 81 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@ package camundala.helper.dev.company
22

33
import camundala.helper.dev.update.createIfNotExists
44

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"
710

811
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
1926

2027
private lazy val contact =
21-
createIfNotExists(docs / "contact.md",
28+
createIfNotExists(
29+
docsSrc / "contact.md",
2230
s"""|## Contact
2331
|If you have questions, spot a bug or you miss something, please let us know🤓.
2432
|
@@ -29,7 +37,8 @@ case class CompanyDocsGenerator (companyCamundala: os.Path):
2937
|""".stripMargin
3038
)
3139
private lazy val instructions =
32-
createIfNotExists(docs / "instructions.md",
40+
createIfNotExists(
41+
docsSrc / "instructions.md",
3342
s"""|## Create This Page
3443
|This is a semi-automatic process. This should be done either to prepare a Release or after a Release.
3544
|
@@ -40,7 +49,8 @@ case class CompanyDocsGenerator (companyCamundala: os.Path):
4049
)
4150

4251
private lazy val pattern =
43-
createIfNotExists(docs / "pattern.md",
52+
createIfNotExists(
53+
docsSrc / "pattern.md",
4454
s"""|# Process Pattern
4555
|We try to establish Patterns for doing the same tasks.
4656
|This documentation lists them and gives you some examples.
@@ -49,17 +59,20 @@ case class CompanyDocsGenerator (companyCamundala: os.Path):
4959
|""".stripMargin
5060
)
5161
private lazy val statistics =
52-
createIfNotExists(docs / "statistics.md",
62+
createIfNotExists(
63+
docsSrc / "statistics.md",
5364
s"""|# Process Statistics
5465
|
5566
|The Process Statistics you find new in Camunda Optimize.
5667
|
5768
|TODO - Create here a link to the Optimize Dashboard or add some statistics manually.
5869
|
5970
|<iframe id="optimizeFrame" src="https://TODO/" frameborder="0" style="width: 1000px; height: 700px; allowtransparency; overflow: scroll"></iframe>
60-
|""".stripMargin)
71+
|""".stripMargin
72+
)
6173
private lazy val style =
62-
createIfNotExists(docs / "style.md",
74+
createIfNotExists(
75+
docsSrc / "style.md",
6376
s"""|.mermaid svg {
6477
| height: 400px;
6578
|}
@@ -68,24 +81,65 @@ case class CompanyDocsGenerator (companyCamundala: os.Path):
6881
| margin-right: 40px;
6982
| width: 400px;
7083
|}
71-
|""".stripMargin)
84+
|""".stripMargin
85+
)
7286

7387
private lazy val favicon =
74-
val faviconPath = docs / "favicon.ico"
88+
val faviconPath = docsSrc / "favicon.ico"
7589
if !os.exists(faviconPath) then
7690
os.write(faviconPath, (os.resource / "favicon.ico").toSource)
7791

7892
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",
8196
s"""|${laikaVersioned(isVersioned)}
82-
|
83-
|${laikaTitle(title)}
84-
|
85-
|$laikaNavigationOrder
86-
|""".stripMargin
97+
|
98+
|${laikaTitle(title)}
99+
|
100+
|$laikaNavigationOrder
101+
|""".stripMargin
87102
)
103+
end directory
88104

89105
private def laikaVersioned(isVersioned: Boolean) = s"laika.versioned = $isVersioned"
90106
private def laikaTitle(title: String) = s"laika.title = $title"
91107
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

Comments
 (0)