Skip to content

Yaml Generation#30514

Merged
tiborvass merged 1 commit intomoby:masterfrom
FrenchBen:yaml
Mar 15, 2017
Merged

Yaml Generation#30514
tiborvass merged 1 commit intomoby:masterfrom
FrenchBen:yaml

Conversation

@FrenchBen
Copy link
Contributor

@FrenchBen FrenchBen commented Jan 27, 2017

- What I did
I added support for YAML output for the engine CLI

- How I did it
Extended on the Cobra docs output but for Yaml - Some of the changes have been pushed back to upstream: spf13/cobra#380

- How to verify it
make yamlfiles will output Yaml files within the yaml/yaml1 directory

- Description for the changelog
Added support for YAML file generation of Docker Engine CLI commands

- A picture of a cute animal (not mandatory but encouraged)

Bear it all

@FrenchBen FrenchBen changed the title Yaml Yaml Generation Jan 27, 2017
@aaronlehmann
Copy link

make manpages will output Yaml files within the yaml/ directory

man pages are troff formatted, so it's a little strange that make manpages would output YAML. Is this a precursor format that later gets converted to man pages?

@FrenchBen
Copy link
Contributor Author

@aaronlehmann bleh.. it looks like I missed some the changes to the repo structure.
You're correct, this generates more than just manpages as I piggy backed on the function used in manpage.

The yaml output is used to build the docs.docker.com pages, but will never be stored within docker/docker - The idea is that our docs reflect 100% the cli code logic without having developers update the yaml files separately.

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jan 28, 2017
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jan 28, 2017
@justincormack
Copy link
Contributor

This should be built in CI, otherwise no idea when it breaks.

@FrenchBen
Copy link
Contributor Author

@justincormack that's the idea - the CI piece still needs to be added.

@LK4D4
Copy link
Contributor

LK4D4 commented Jan 30, 2017

design is ok for me

@thaJeztah
Copy link
Member

thaJeztah commented Jan 31, 2017

Can we make sure that the files in man/src are brought in sync with the docs/reference/commandline documentation? I think there may be information present in the docs/ files that is not present in the man pages (and vice-versa).

Also, what's the approach to link from the reference docs to other parts of the documentation? For example, https://github.com/docker/docker/blob/master/docs/reference/commandline/run.md refers to various other parts of the docs, but the https://github.com/docker/docker/blob/master/man/docker-run.1.md man page (which is not in man/src) does not have those links (as man pages usually link to other man-pages, but not to online docs).

Our man pages have historically been a lot less complete than the online docs, so we should look carefully when moving to using those as documentation, as they are far from complete.

Do man-pages support tables? (see https://github.com/docker/docker/blob/master/docs/reference/commandline/run.md#restart-policies---restart)

@tiborvass
Copy link
Contributor

Ping @FrenchBen let us know if you need help with this.

@FrenchBen
Copy link
Contributor Author

After conversation with @tiborvass and @thaJeztah the following will happen:

  1. docs/reference/commandline will be the new source of truth for the extended descriptions
  2. The above MD will need to partially remove the current CLI output within the markdown
  3. docs/reference/commandline will need to be update to have all canonical commands and their aliases

@tiborvass
Copy link
Contributor

@FrenchBen there are some compile errors due to unvendored dependency.

@thaJeztah
Copy link
Member

We need to check license compatibility as well (https://github.com/jteeuwen/go-bindata);

This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
license. Its contents can be found at:
http://creativecommons.org/publicdomain/zero/1.0

@justincormack
Copy link
Contributor

justincormack commented Feb 7, 2017 via email

@thaJeztah
Copy link
Member

Thanks for checking @justincormack

yaml/Dockerfile Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont need this line.

@mdlinville
Copy link
Contributor

mdlinville commented Feb 9, 2017

Right now, the yaml/Dockerfile doesn't work. It needs to install mercurial and also there is some problem with where the generate.sh gets put vs the WORKDIR. I tried a few permutations but I couldn't figure it out.

Also, #30804 is now in master. It standardizes the format of the CLI references so that they will be easier for this PR to consume:

The long description should be grabbed from between ## Description to ## Examples. If there is no ## Description then there is no long description.

The examples should be grabbed from between ## Examples to the next H2-level heading, or to the end of the file, whichever comes first. If there is no ## Examples there are no examples.

Both of these should be grabbed as a string of Markdown.

@vieux
Copy link
Contributor

vieux commented Feb 14, 2017

ping @FrenchBen can you take a look at @mstanleyjones's comments ?

@thaJeztah
Copy link
Member

@FrenchBen told me during lunch that he was working on this 😄

@mdlinville
Copy link
Contributor

Latest output LGTM. Note that we need to be somewhat rigorous about the formatting of the CLI reference files. If there is a Description or Examples section, it needs to be a H2 section. And if there are any complicated tables with block level elements they need to be HTML tables. There may be more "gotchas" in future.

@tiborvass
Copy link
Contributor

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Just a minor issue with the makefile target name

Makefile Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like yaml-docs-gen would be great (much closer to the name of the bundle)

Signed-off-by: French Ben <[email protected]>
Signed-off-by: Tibor Vass <[email protected]>
@duglin
Copy link
Contributor

duglin commented Mar 15, 2017

@tiborvass seems like the power issue was a flake, seems to have vanished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.