Skip to content

Commit e303c5b

Browse files
germainlefebvre4Germain LEFEBVRE
andauthored
docs: Update on validate feature and CLI helper (#80)
Co-authored-by: Germain LEFEBVRE <germain.lefebvre@external.waykonect.com>
1 parent 5f83c26 commit e303c5b

File tree

9 files changed

+34
-16
lines changed

9 files changed

+34
-16
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ repos:
2020
entry: bash -c 'mockery'
2121
language: system
2222
verbose: false
23+
- id: cli-helper
24+
name: cli-helper
25+
entry: bash -c 'go run ./cmd/cvwonder > docs/github-pages/static/helper.out'
26+
language: system
27+
verbose: true
2328
# - id: cvwonder-documentation
2429
# name: cvwonder-documentation
2530
# entry: bash -c 'cd docs/github-pages && pnpm build'

cmd/cvwonder/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ func main() {
3030
Long: `CV Wonder - Generate your CV with Wonder!`,
3131
}
3232

33-
rootCmd.PersistentFlags().StringVarP(&utils.CliArgs.InputFile, "input", "i", "cv.yml", "Input file in YAML format (required). Default is 'cv.yml'")
34-
rootCmd.PersistentFlags().StringVarP(&utils.CliArgs.OutputDirectory, "output", "o", "generated/", "Output directory (optional). Default is 'generated/'")
35-
rootCmd.PersistentFlags().StringVarP(&utils.CliArgs.ThemeName, "theme", "t", "default", "Name of the theme (optional). Default is 'default'.")
36-
rootCmd.PersistentFlags().StringVarP(&utils.CliArgs.Format, "format", "f", "html", "Format for the export (optional). Default is 'html'.")
33+
rootCmd.PersistentFlags().StringVarP(&utils.CliArgs.InputFile, "input", "i", "cv.yml", "Input file in YAML format.")
34+
rootCmd.PersistentFlags().StringVarP(&utils.CliArgs.OutputDirectory, "output", "o", "generated/", "Output directory.")
35+
rootCmd.PersistentFlags().StringVarP(&utils.CliArgs.ThemeName, "theme", "t", "default", "Name of the theme.")
36+
rootCmd.PersistentFlags().StringVarP(&utils.CliArgs.Format, "format", "f", "html", "Format for the export.")
3737
rootCmd.PersistentFlags().BoolVarP(&utils.CliArgs.Debug, "debug", "d", false, "Debug mode: more verbose.")
3838

3939
rootCmd.AddCommand(cmdGenerate.GenerateCmd())

cmd/cvwonder/serve/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func ServeCmd() *cobra.Command {
8787
serveService.StartLiveReloader(utils.CliArgs.Port, outputDir.FullPath, inputFile.FullPath)
8888
},
8989
}
90-
cobraCmd.Flags().BoolVarP(&utils.CliArgs.Browser, "browser", "b", false, "Open the browser (optional). Default is 'false'.")
90+
cobraCmd.Flags().BoolVarP(&utils.CliArgs.Browser, "browser", "b", false, "Open the browser.")
9191
cobraCmd.Flags().BoolVarP(&utils.CliArgs.Watch, "watch", "w", false, "Watch for file changes")
9292
cobraCmd.Flags().IntVarP(&utils.CliArgs.Port, "port", "p", 3000, "Listening port for local server")
9393

cmd/cvwonder/themes/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func CmdCreate() *cobra.Command {
7676
},
7777
}
7878

79-
cobraCmd.Flags().StringVarP(&utils.CliArgs.CreateThemeName, "name", "n", "New Theme", "Name of the new theme (required). Default is 'New Theme'")
79+
cobraCmd.Flags().StringVarP(&utils.CliArgs.CreateThemeName, "name", "n", "New Theme", "Name of the new theme.")
8080

8181
return cobraCmd
8282
}

docs/dockerhub/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,17 @@ Available Commands:
5151
help Help about any command
5252
serve Generate and serve the CV
5353
themes Manage themes
54+
validate Validate the CV YAML file
55+
version Show version
5456
5557
Flags:
56-
-f, --format string Format for the export (optional). Default is 'html'. (default "html")
58+
-d, --debug Debug mode: more verbose.
59+
-f, --format string Format for the export. (default "html")
5760
-h, --help help for cvwonder
58-
-i, --input string Input file in YAML format (required). Default is 'cv.yml' (default "cv.yml")
59-
-o, --output string Output directory (optional). Default is 'generated/' (default "generated/")
60-
-t, --theme string Name of the theme (optional). Default is 'default'. (default "default")
61-
-v, --verbose Debug mode.
61+
-i, --input string Input file in YAML format. (default "cv.yml")
62+
-o, --output string Output directory. (default "generated/")
63+
-t, --theme string Name of the theme. (default "default")
64+
-v, --version version for cvwonder
6265
6366
Use "cvwonder [command] --help" for more information about a command.
6467
```

docs/github-pages/docs/validation/schema-reference.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ sidebar_position: 3
55

66
---
77

8+
:::info
9+
Available since `v0.5.0`
10+
:::
11+
812
The validator uses a JSON Schema to define the CV structure. Key validation rules:
913

1014
### Required Fields

docs/github-pages/docs/validation/schema.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ sidebar_position: 2
33
---
44
# Schema
55

6+
:::info
7+
Available since `v0.5.0`
8+
:::
69

710
## View Schema
811

docs/github-pages/docs/validation/validate.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ sidebar_position: 1
66
---
77

88
:::info
9-
Consider validating your CV file before generating to ensure quality and correctness.
9+
Available since `v0.5.0`
1010
:::
1111

12+
Validation is a crucial step in ensuring the integrity and correctness of your CV data. CVWonder provides built-in validation features to help you catch errors and inconsistencies before generating your CV.
13+
1214
## Getting Started
1315

1416
### Basic Validation

docs/github-pages/static/helper.out

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ Available Commands:
99
help Help about any command
1010
serve Generate and serve the CV
1111
themes Manage themes
12+
validate Validate the CV YAML file
1213
version Show version
1314

1415
Flags:
1516
-d, --debug Debug mode: more verbose.
16-
-f, --format string Format for the export (optional). Default is 'html'. (default "html")
17+
-f, --format string Format for the export. (default "html")
1718
-h, --help help for cvwonder
18-
-i, --input string Input file in YAML format (required). Default is 'cv.yml' (default "cv.yml")
19-
-o, --output string Output directory (optional). Default is 'generated/' (default "generated/")
20-
-t, --theme string Name of the theme (optional). Default is 'default'. (default "default")
19+
-i, --input string Input file in YAML format. (default "cv.yml")
20+
-o, --output string Output directory. (default "generated/")
21+
-t, --theme string Name of the theme. (default "default")
2122
-v, --version version for cvwonder
2223

2324
Use "cvwonder [command] --help" for more information about a command.

0 commit comments

Comments
 (0)