Commit 6374e6f
authored
Docs/docsgen one version only (#587)
Allow the docs generators to run for a certain version.
Previously, they always ran for all in series.
---
> original from #507 from @Nicolas-Peiffer
The JSON Schema HTML viewer generator script `docgen/json/gen.sh`
supports generating only for one particular CycloneDX version, including
the possibility of generating the HTML only for draft version of
CycloneDX during dev time.
## Use Case
I want to propose new objects in the CycloneDX Specification. And for
checking the JSON Schema, I like to locally use the HTML view to check
the content of the JSON Schema.
However, during dev time when I was modifying the JSON Schema, I found
it not convenient that the script `docgen/json/gen.sh` regenerate the
HTML doc for every version of CycloneDX each time I run it when I only
need the version I am working on.
## Proposition
I modified the script `docgen/json/gen.sh` to be able to run `gen.sh`
only for a particular version of CycloneDX.
For example:
```bash
./gen.sh 1.6
```
But I also added a list `DRAFT_CYCLONEDX_VERSIONS` for when I am working
on a draft proposition of CycloneDX spec.
For example:
```bash
# I modify `docgen/json/gen.sh` to add the name of my draft file
DRAFT_CYCLONEDX_VERSIONS=(my_cdx_dev_draft)
```
I create a JSON schema draft file
`schema/bom-my_cdx_dev_draft.schema.json`:
Then I run:
```bash
./gen.sh my_cdx_dev_draft
```
Which creates only the HTML for `my_cdx_dev_draft`
```bash
tree docgen/json/docs/my_cdx_dev_draft/
docgen/json/docs/my_cdx_dev_draft/
├── index.html
├── schema_doc.css
└── schema_doc.min.j
```
And in order not to disturb the way `docgen/json/gen.sh` works now,
running it without argument generates the HTML for all the CDX versions:
```bash
./gen.sh
```
```bash
ls -1 docgen/json/docs/
1.2
1.3
1.4
1.5
1.6
```
I also added a small usage help message.
```bash
./gen.sh -h
Deleting folder /home/thedetective/Documents/dev-workspace/cyclonedx/cyclonedx-specification.thalesgroup/docgen/json/docs
Usage: Generate HTML JSON Schema navigator for CyccloneDX
Usage: ./gen.sh <version> : runs only for <version>
./gen.sh : loops over all valid and draft CycloneDX versions
```
## What about `docgen/xml/gen.sh` ?
I will probably propose the same kind of modification to the XML
`docgen/xml/gen.sh` script to achieve the same results.
## Conclusion
There are probably other way to achieve this result. I think this one is
the cheapest in terms of how the `gen.sh` script is modified.
----
supersedes #507
closes #5073 files changed
+219
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
4 | 22 | | |
5 | 23 | | |
6 | 24 | | |
7 | 25 | | |
8 | 26 | | |
9 | | - | |
10 | 27 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
17 | 40 | | |
18 | 41 | | |
19 | | - | |
20 | | - | |
| 42 | + | |
| 43 | + | |
21 | 44 | | |
22 | 45 | | |
23 | | - | |
24 | | - | |
| 46 | + | |
| 47 | + | |
25 | 48 | | |
26 | 49 | | |
27 | 50 | | |
28 | 51 | | |
29 | 52 | | |
30 | 53 | | |
31 | | - | |
32 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
33 | 58 | | |
34 | 59 | | |
35 | 60 | | |
| |||
47 | 72 | | |
48 | 73 | | |
49 | 74 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
4 | 21 | | |
5 | 22 | | |
6 | 23 | | |
7 | 24 | | |
8 | 25 | | |
9 | 26 | | |
10 | 27 | | |
| 28 | + | |
11 | 29 | | |
12 | 30 | | |
13 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
14 | 37 | | |
15 | 38 | | |
16 | | - | |
17 | | - | |
| 39 | + | |
| 40 | + | |
18 | 41 | | |
19 | 42 | | |
20 | | - | |
21 | | - | |
| 43 | + | |
| 44 | + | |
22 | 45 | | |
23 | 46 | | |
24 | | - | |
25 | 47 | | |
26 | 48 | | |
27 | 49 | | |
28 | 50 | | |
29 | | - | |
| 51 | + | |
30 | 52 | | |
31 | 53 | | |
32 | 54 | | |
33 | 55 | | |
34 | 56 | | |
35 | 57 | | |
36 | 58 | | |
37 | | - | |
| 59 | + | |
38 | 60 | | |
39 | 61 | | |
40 | 62 | | |
41 | 63 | | |
42 | 64 | | |
43 | 65 | | |
44 | 66 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
4 | 24 | | |
5 | 25 | | |
6 | 26 | | |
7 | 27 | | |
8 | 28 | | |
9 | 29 | | |
10 | | - | |
11 | 30 | | |
12 | | - | |
13 | | - | |
| 31 | + | |
14 | 32 | | |
15 | 33 | | |
16 | 34 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
22 | 42 | | |
23 | 43 | | |
24 | 44 | | |
25 | | - | |
26 | | - | |
| 45 | + | |
| 46 | + | |
27 | 47 | | |
28 | 48 | | |
29 | | - | |
30 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
31 | 53 | | |
32 | 54 | | |
33 | 55 | | |
| |||
38 | 60 | | |
39 | 61 | | |
40 | 62 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
0 commit comments