display flag type and default value in a dedicated columns#19
display flag type and default value in a dedicated columns#19thaJeztah merged 2 commits intodocker:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #19 +/- ##
==========================================
+ Coverage 64.37% 64.84% +0.47%
==========================================
Files 4 4
Lines 508 532 +24
==========================================
+ Hits 327 345 +18
- Misses 127 129 +2
- Partials 54 58 +4
Continue to review full report at Codecov.
|
|
@thaJeztah I revert the |
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Not really against this, but thinking if it always shows useful information. In quite some cases it may not be;
docker --help | grep 'config files'
--config string Location of client config files (default "/Users/sebastiaan/.docker") |
|
As discussed yeah we can't dynamically handle that for static generation if defaults are handled daemon side but we could be smart and provide insights about its behavior in the default column. Maybe using an annotation. We could also move defaults not linked to the flag type in this annotation to avoid putting it in the description. This way it would be properly handled both for markdown generation and yaml one that could then be used on docs.docker.com. I can think of an annotation and see how it could be handled with buildx for example. Do you want that in a follow-up or here? We also discussed about badges like: We could add it to markdown generation using http://shield.io/: |
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
|
@thaJeztah I have added an annotation to be able to override the default value. Let me know if it sgty. |
|
@crazy-max @thaJeztah Why did we decide to skip the cli-docs-tool/clidocstool_md.go Lines 243 to 258 in f588677 This seems related to docker/cli#4259 (comment) Since pretty much all of the optional flags are |
|
Thanks for looking @gmargaritis - I suspect this was by accident, and the intent was to not show a default for a boolean flag that uses The reason for that was to make it more similar to the However, if the flag is a boolean, but uses |

flag type is mixed with flag name and can be hard to read in our documentation. This PR adds a dedicated column for it.
also overrides types that can be confusing for some users docker/buildx#717:
stringArray:liststringSlice:list/stringswonder if we could also add a dedicated legend to explain some types like docker/buildx#922 (comment)
example: https://github.com/crazy-max/buildx/blob/mkdocs/docs/reference/buildx_build.md
let me know what you think @thaJeztah
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com