Skip to content

Commit

Permalink
feat: get json schema for ecalc yaml in cli (#715)
Browse files Browse the repository at this point in the history
* feat: get json schema for ecalc yaml in cli

eCalc show schema [--file my_file] will write the current json
schema for valid ecalc yaml to the file my_file. If no filename
is provided, it will write to stdout

Current json schema served in docs. This schema will represent
the latest changes on main (bleeding).

Will add support for versioning soon, this is atm. a PoC.
  • Loading branch information
TeeeJay authored Nov 27, 2024
1 parent fc849bd commit 43bf19a
Show file tree
Hide file tree
Showing 10 changed files with 4,469 additions and 9 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
- name: Generate CLI reference
run: |
cd src
poetry run python generate_docs.py > ../docs/docs/about/references/cli_reference.md
poetry run python generate_docs.py > ../docs/docs/about/getting_started/cli/cli_reference.md
- name: Generate JSON Schema
run: |
cd src
poetry run python generate_json_schema.py > ../docs/docs/about/getting_started/yaml/ecalc_json_schema.json
- name: Setup node
uses: actions/setup-node@v4
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ jobs:
- name: Generate CLI reference
run: |
cd src
poetry run python generate_docs.py > ../docs/docs/about/references/cli_reference.md
poetry run python generate_docs.py > ../docs/docs/about/getting_started/cli/cli_reference.md
- name: Generate JSON Schema
run: |
cd src
poetry run python generate_json_schema.py > ../docs/docs/about/getting_started/yaml/ecalc_json_schema.json
- name: Setup node
uses: actions/setup-node@v4
Expand Down
9 changes: 8 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ $ npm run serve
In order to generate the CLI reference documentation, use the following (from `src`):
```
$ cd src
$ poetry run python generate_docs.py > ../docs/docs/about/references/cli_reference.md
$ poetry run python generate_docs.py > ../docs/docs/about/getting_started/cli/cli_reference.md
```

### Generate JSON Schema
In order to generate the JSON Schema documentation, use the following (from `src`):
```
$ cd src
$ poetry run python generate_json_schema.py > ../docs/docs/about/getting_started/yaml/ecalc_json_schema.json
```

Then build the documentation:
Expand Down
Loading

0 comments on commit 43bf19a

Please sign in to comment.