Skip to content

Commit

Permalink
Generate api docs from source code
Browse files Browse the repository at this point in the history
  • Loading branch information
trotttrotttrott committed May 3, 2020
1 parent f1ceb29 commit b34b896
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jobs:
- run:
name: unit tests
command: make test
- run:
name: api-docs
command: make gen-api-docs
- run:
name: docs
command: docker run --rm -u $UID -it -p 8000:8000 -v $PWD:/docs squidfunk/mkdocs-material build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
site
docs/api-docs.md
*_test_output.json
e2e/node_modules
.DS_Store
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
help: # Show this message.
help: # Show this message.
@echo "\nAvailable Targets:\n"
@sed -ne '/@sed/!s/# //p' $(MAKEFILE_LIST)

test: # Run all unit tests.
@docker run \
test: # Run all unit tests.
@docker run --rm \
-w $$PWD \
-v $$PWD:$$PWD \
--entrypoint sh \
sparkprime/jsonnet \
tests.sh

test-update: # Run all unit tests while copying test_output.json to compiled.json file.
@docker run \
test-update: # Run all unit tests while copying test_output.json to compiled.json file.
@docker run --rm \
-w $$PWD \
-v $$PWD:$$PWD \
--entrypoint sh \
sparkprime/jsonnet \
tests.sh update

gen-api-docs: # Generate api-docs.md from source code comments.
@docker run --rm \
-u $$UID \
-v $$PWD:$$PWD \
-w $$PWD \
trotttrotttrott/jsonnetdoc:4f806c6 \
grafonnet --markdown \
> docs/api-docs.md
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ nav:
- Examples: 'examples.md'
- Style Guide: 'style-guide.md'
- Comunity Plugins: 'community-plugins.md'
- API Docs: 'api-docs.md'

0 comments on commit b34b896

Please sign in to comment.