File tree Expand file tree Collapse file tree 8 files changed +164
-219
lines changed
io/github/tscholze/kotlog Expand file tree Collapse file tree 8 files changed +164
-219
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,12 @@ Clone the [kotlog-template repository](https://github.com/tscholze/kotlin-kotlog
33
33
-g : Generates HTML output
34
34
-p : Publish aka pushes changes to remote
35
35
-co : Clears the output
36
+ -cc : To create a new configuration file
36
37
```
37
38
38
39
## Configuration
39
40
41
+ ### Using configuration instance
40
42
A Kotlog-generated blog ist configurated using the ` BlogConfiguration ` parameter of the ` Kotlog ` invocation.
41
43
See ` Main.kt ` for a working example:
42
44
@@ -54,8 +56,20 @@ fun main(args: Array<String>) {
54
56
}
55
57
```
56
58
59
+ ### Using configuration file
60
+ Otherwise, Kotlog will try to load the configuration file (` ~/.kotlog ` ) from the file system. Run ` ./kotlog -cc ` to create a new file.
61
+
62
+ ``` json
63
+ {
64
+ "baseUrl" : " https://tscholze.github.io/blog" ,
65
+ "titleText" : " Tobias Scholze | The Stuttering Nerd" ,
66
+ "footerText" : " Made with ❤️ without JavaScript| Kotlog | Tobias Scholze" ,
67
+ "outputDirectoryName" : " www"
68
+ }
69
+ ```
70
+
57
71
## How it looks
58
- ![ ] ( https://github.com/tscholze/kotlin-kotlog-cli/blob/main/docs/kotlog-markdown2html.png?raw=true )
72
+ ![ Flow ] ( https://github.com/tscholze/kotlin-kotlog-cli/blob/main/docs/kotlog-markdown2html.png?raw=true )
59
73
(Design, look and feel and other ui elements my differ from version to version)
60
74
61
75
## Features
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
2
3
+ // MARK: - Properties -
4
+
5
+ group = " io.github.tscholze"
6
+ version = " 1.0.5"
7
+
8
+ // MARK: - Plugins -
9
+
3
10
plugins {
4
11
kotlin(" jvm" ) version " 1.7.10"
5
12
kotlin(" plugin.serialization" ) version " 1.7.10"
6
13
application
7
14
}
8
15
9
- group = " io.github.tscholze"
10
- version = " 1.0.5"
16
+ // MARK: - Repositories -
11
17
12
18
repositories {
13
19
mavenCentral()
14
20
}
15
21
22
+ // MARK: - Dependencies -
23
+
16
24
dependencies {
17
25
// Markdown
18
26
implementation(" org.commonmark:commonmark:0.19.0" )
@@ -34,6 +42,14 @@ dependencies {
34
42
testImplementation(kotlin(" test" ))
35
43
}
36
44
45
+ // MARK: - Application settings -
46
+
47
+ application {
48
+ mainClass.set(" MainKt" )
49
+ }
50
+
51
+ // MARK: - Gradle tasks -
52
+
37
53
tasks.jar {
38
54
manifest {
39
55
attributes[" Main-Class" ] = " MainKt"
@@ -50,8 +66,4 @@ tasks.test {
50
66
51
67
tasks.withType<KotlinCompile > {
52
68
kotlinOptions.jvmTarget = " 1.8"
53
- }
54
-
55
- application {
56
- mainClass.set(" MainKt" )
57
69
}
Original file line number Diff line number Diff line change 1
1
import io.github.tscholze.kotlog.Kotlog
2
- import io.github.tscholze.kotlog.models.BlogConfiguration
3
2
4
3
fun main (args : Array <String >) {
5
4
6
- // 1. Create a configuration for the blog
7
- val configuration = BlogConfiguration (
8
- baseUrl = " https://tscholze.github.io/blog" ,
9
- titleText = " Tobias Scholze | The Stuttering Nerd" ,
10
- footerText = " Made with ❤️ without JavaScript| Kotlog | Tobias Scholze" ,
11
- outputDirectoryName = " www"
12
- )
5
+ // 1. Create a configuration for the blog,
6
+ // or it will be fetched from `~/.kotlog file`
7
+ //
8
+ // Sample:
9
+
10
+ // val configuration = BlogConfiguration(
11
+ // baseUrl = "https://tscholze.github.io/blog",
12
+ // titleText = "Tobias Scholze | The Stuttering Nerd",
13
+ // footerText = "Made with ❤️ without JavaScript| Kotlog | Tobias Scholze",
14
+ // outputDirectoryName = "www"
15
+ // )
13
16
14
17
// 2. Call and run Kotlog with command line arguments and configuration.
15
- Kotlog (args, configuration )
18
+ Kotlog (args)
16
19
}
17
20
You can’t perform that action at this time.
0 commit comments