- make sure the target directory is created if missing
- add support for custom ID's in headings through `<a>` tags (e.g.
`<a name=heading2></a>`). This allows use of custom anchors that
work both on GitHub (GFM doesn't support extended MarkDown), and
in Jekyll (which does).
- add code to cleanup markdown for use in our docs:
- remove absolute URLs to https://docs.docker.com
- remove tabs in MarkDown, and convert them to 4 spaces. This
prevents the YAML conversion from switching between "short"
and "long" syntax. Tabs in code examples also don't always
work well, so using spaces doesn't hurt for that.
- refactor some code for readability, and to be less "hacky" (still
lots to be improved though)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
9 lines
271 B
Bash
Executable File
9 lines
271 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Generate yaml for docker/cli reference docs
|
|
set -eu -o pipefail
|
|
|
|
mkdir -p docs/yaml/gen
|
|
|
|
GO111MODULE=off go build -o build/yaml-docs-generator github.com/docker/cli/docs/yaml
|
|
build/yaml-docs-generator --root "$(pwd)" --target "$(pwd)/docs/yaml/gen"
|