Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate docs for the CLI #40

Merged
merged 6 commits into from
Aug 6, 2018
Merged

Generate docs for the CLI #40

merged 6 commits into from
Aug 6, 2018

Conversation

zzak
Copy link
Contributor

@zzak zzak commented Aug 2, 2018

Zachary Scott added 3 commits August 2, 2018 16:26
This POC provides a new command (`usage`) that is hidden from users,
but would allow us to CD docs as part of our workflow.
@zzak zzak requested a review from marcomorain August 2, 2018 07:37
@codecov-io
Copy link

codecov-io commented Aug 3, 2018

Codecov Report

Merging #40 into master will decrease coverage by 0.21%.
The diff coverage is 37.03%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
- Coverage   39.39%   39.17%   -0.22%     
==========================================
  Files          12       13       +1     
  Lines         853      878      +25     
==========================================
+ Hits          336      344       +8     
- Misses        493      510      +17     
  Partials       24       24
Impacted Files Coverage Δ
cmd/root.go 74.5% <100%> (ø) ⬆️
cmd/usage.go 32% <32%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 733dbae...0cfb929. Read the comment docs.

@zzak
Copy link
Contributor Author

zzak commented Aug 3, 2018

Pending review, this has been deployed here:
https://circleci-public.github.io/circleci-cli/

@zzak zzak requested a review from dcarley August 3, 2018 12:25
Copy link
Contributor

@marcomorain marcomorain left a comment

Choose a reason for hiding this comment

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

Is there a missing commit to the .toml file listing dependencies?

cmd/usage.go Outdated
return true
}

func usage(cmd *cobra.Command, args []string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I’d rather we did the call to Pandoc from outside go. I’d like to generate the .md content from go, and the exit.

Then in config.yml call out to pandoc to generate HTML.


# move index and update links
mv circleci.html index.html
sed -i -- 's#<a href="circleci.html">#<a href="index.html">#g' *.html
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you do this moving and replacement from somewhere else, so that you his script is just concerned with pushing to gh-pages.

Having these two lines in the middle of this script is surprising to the reader.

cmd/root.go Outdated
@@ -13,6 +13,8 @@ import (

var defaultEndpoint = "https://circleci.com/graphql-unstable"

var rootCmd *cobra.Command
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you make a global here?

We now generate the markdown comment from `usage` command,
and call pandoc from a script to handle generating HTML.
@zzak
Copy link
Contributor Author

zzak commented Aug 5, 2018

The changes to Gopkg.lock were reflected when spf13/cobra/doc package was imported:
https://github.com/CircleCI-Public/circleci-cli/pull/40/files#diff-bd247e83efc3c45ae9e8c47233249f18R277

I will have to check which version of dep was used to makr this PR on my desktop, but it should be a newer version since I just installed it. That might explain the changes to inputs-digest to input-imports:
https://github.com/CircleCI-Public/circleci-cli/pull/40/files#diff-bd247e83efc3c45ae9e8c47233249f18L326

@zzak
Copy link
Contributor Author

zzak commented Aug 5, 2018

After further review, it looks like the change to Gopkg.lock reflects the latest changes to go dep, including those added in this PR:
golang/dep#1912

Which seems to have been released about 10 days ago:
https://github.com/golang/dep/releases/tag/v0.5.0

@zzak zzak merged commit ed68ed1 into master Aug 6, 2018
@zzak zzak deleted the usage branch August 6, 2018 11:30

# pandoc markdown to html into out dir
for f in docs/*.md; do
pandoc "$f" -s -o "out/$(basename ${f%.md}.html)";
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants