Merge remote-tracking branch 'cli_yamldocs/master' into HEAD
# install filter-repo (https://github.com/newren/git-filter-repo/blob/main/INSTALL.md)
brew install git-filter-repo
# create a temporary clone of docker/cli
git clone https://github.com/docker/cli.git ~/Projects/cli_yamldocs
cd cli_yamldocs
# remove all code, except for docs/yaml, and rename to docs/yamlgen
git filter-repo --path docs/yaml --path-rename docs/yaml:docs/yamlgen
# exclude the Dockerfile
git filter-repo --path-glob 'docs/yamlgen/Dockerfile' --invert-paths
# go to the target github.com/docker/docgen repository
cd ~/projects/docgen
# add the temporary repository as an upstream and make sure it's up-to-date
git remote add cli_yamldocs ~/projects/cli_yamldocs
git fetch cli_yamldocs
# create a branch to work with
git checkout -b import_history
# do an interactive rebase
git rebase -i -S aaa47f8fbd
# set breakpoint before first import of yamldocs
break
pick 1e7a862 Add YAML-docs generator
pick b3375b7 Move sources and add go mod
pick 7b04bac README
pick 2bf814d Example
pick b5743a3 Container based developer flow
pick e3997d7 Rename
pick cd391b6 Dependabot
pick 08d8459 GitHub workflow
pick 75d4c97 Fix linter and add tests
pick aaff066 Rename package and move `LoadLongDescription` func
pick 05a4448 docs: add md generation
pick e7a1fd1 Refactor markdown generator
pick 10c276e Add `GenTree` func
pick 8efbe43 Cleanup
pick 5ca2026 Fix godev
pick 4ed3e61 Add CodeQL workflow
pick d739cb1 Basic test
pick b75cd36 docs: add external docs links support
pick e24b031 yamldocs: various improvements
pick 80ca920 remove codeql for now
pick 85eca43 yaml: fix tests
pick 9b28897 lint
pick f85801e add code of conduct and contributing notes
pick e1298a2 readme for example
pick 450385b Update README
pick 0435ec1 Call pkg.go.dev when a new tag is pushed (force refresh)
# merge the upstream code
git merge --allow-unrelated-histories --signoff -S cli_yamldocs/master
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- 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>
Currently the documentation uses a special case for this command,
so adding a description to the YAML in order to remove that
special case.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The script was written to only take subcommands at the first and second level
into account, but failed to find the Markdown files for extended descriptions of
subcommands at the third level, such as `docker trust key generate`, and
`docker trust key load`:
WARN: /go/src/github.com/docker/cli/docs/reference/commandline/key_generate.md does not exist, skipping
WARN: /go/src/github.com/docker/cli/docs/reference/commandline/key_load.md does not exist, skipping
WARN: /go/src/github.com/docker/cli/docs/reference/commandline/signer_add.md does not exist, skipping
WARN: /go/src/github.com/docker/cli/docs/reference/commandline/signer_remove.md does not exist, skipping
This patch updates the script to accomodate subcommands that are more deeply
nested. While at it, some minor cleaning and linting issues were also addressed.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>