Skip to content

Commit

Permalink
Imporove interations with documentation durign development
Browse files Browse the repository at this point in the history
`workflows` script has new useful commands which simplify the workflow
of documentation generation and preview. It's fully compatible with MAC
OS, but may not work on other OSs.
  • Loading branch information
extsoft committed Oct 4, 2019
1 parent 48e8374 commit c51a116
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ Use the following test name template - `'<command args>': <describe what will be

### Updating documentation
In order to get the documentation preview locally, please install required dependencies with
`pip install -r docs/requirements.txt`. After, run `mkdocs serve` and open <http://127.0.0.1:8000/>
in a browser. That's it!
`pip install -r docs/requirements.txt`. After, run `./workflows serve-docs`. That's it!

The [docs/commands.md](docs/commands.md) generates by running `./workflows documentation` script.
The [docs/commands.md](docs/commands.md) generates by running `./workflows generate-docs` script.
All other files in ["docs" directory](docs/) require manual corrections.
20 changes: 17 additions & 3 deletions workflows
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@ testing() {
docker run -it --rm -v $PWD:/eg ${WORKER_IMAGE} .workflows/bats-pipeline.bash "$@"
}

documentation() {
generate-docs() {
.workflows/docs-generation.bash
}

preview-docs() {
sleep 5 && open http://localhost:8000 &
mkdocs serve
}

serve-docs() {
generate-docs
preview-docs
}

repository() {
info-text "Start container..."
docker run -idt --rm --name repository --workdir /tmp/elegant-git-repo -v $PWD:/eg ${WORKER_IMAGE} bash
Expand Down Expand Up @@ -52,8 +62,10 @@ Available commands:
filtering ("${BASH_SOURCE[0]} testing work" run all tests
which have the word in the test name)
repository creates a git repository and installs Elegant Git within
documentation generates fresh commands documentation bases on the latest
generate-docs generates fresh commands documentation bases on the latest
changes
preview-docs shows current documentation
serve-docs generates and shows latest documentation
ci runs CI quality assessment workflow
prepare-worker builds a new worker image
publish-worker pushes a new worker image
Expand All @@ -64,7 +76,9 @@ commands=(
usage
testing
repository
documentation
generate-docs
preview-docs
serve-docs
ci
prepare-worker
publish-worker
Expand Down

0 comments on commit c51a116

Please sign in to comment.