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

Cobra documentation overhaul #1254

Closed
jpmcb opened this issue Oct 14, 2020 · 13 comments
Closed

Cobra documentation overhaul #1254

jpmcb opened this issue Oct 14, 2020 · 13 comments
Assignees
Milestone

Comments

@jpmcb
Copy link
Collaborator

jpmcb commented Oct 14, 2020

I've noticed that README.md has become a bit of a dumping ground for documenting any and all of cobra's APIs. For example: #1135

Instead, I would like to see a better strategy around documenting the public APIs that Cobra provides. My suggestion would be to have a folder of *.md files with more organization.

Any suggestions from the community?

@eparis
Copy link
Collaborator

eparis commented Oct 14, 2020

I agree, it's a dumping ground (and probably about 99% my fault.) Don't most projects do this with better godocs? I'd love to see the readme almost entirely gone with godoc style documentation and examples.

@umarcor
Copy link
Contributor

umarcor commented Oct 14, 2020

#985:

It is also unfortunate that AFAIK godoc does not support any kind of templating. As a result, it is not easy (even possible?) to integrate godoc's knowledge into a custom hugo site.

#1244:

Furthermore, using gohugo for building a documentation site from markdown sources was discussed in #985.

#1245:

In this PR, a GitHub Actions workflow is added for building a web site with Hugo and deploying it to GitHub Pages (branch gh-pages).

Proposed README: https://github.com/umarcor/cobra/blob/ci-site/README.md

@lukasmalkmus
Copy link
Contributor

Recently had to write some documentation for a private project. I ended up using MkDocs + GitHub Pages. It is super straight forward and I think one of the best options for OSS projects. As much as I love Hugo, MkDocs is just so awesome for documentation, also the deployment is super painless with GitHub Actions.

We should also clean up the README and disable the Wikis tab (as well as unused tabs and sections like Projects, Packages and Environments).

GoDoc is awesome but lacks more advanced features IMHO. We can barley utilize it for proper application code examples, etc. Still good to document the library (which it does).

@umarcor
Copy link
Contributor

umarcor commented Oct 16, 2020

@lukasmalkmus, in fact, Hugo, MkDocs, Jekyll, Sphinx, asciidoc, etc. are all the same from a usage and deployment point of view. All of them can be executed with GitHub Actions (or any other CI service) and painlessly pushed to GitHub Pages. See https://dbhi.github.io/mdpaper (work in progress). I believe that the main issue is finding a template that fits, regardless of the static generator.

OTOH, cobra was created for hugo. That's why it feels natural to use it instead of other alternatives. Contributors to cobra are expected to know golang, so they can better edit and extend the templates. Other alternatives require Python or Ruby.

We should also clean up the README and disable the Wikis tab (as well as unused tabs and sections like Projects, Packages and Environments).

Agree. Wikis are Projects changed from the settings. Packages and environments are disabled from the root.

GoDoc is awesome but lacks more advanced features IMHO. We can barley utilize it for proper application code examples, etc. Still good to document the library (which it does).

Agree. At the same time, I believe there should be many references from the documentation site to the godoc pages.

A shortcut for making this easier is the kind of customisations that might be desirable in the static site generator.

@lukasmalkmus
Copy link
Contributor

Good points. Personally I think MkDocs + Material is a very good choice and feature rich, even for "code-centric" documentation. GoReleaser uses it: https://goreleaser.com We could introduce a small template that links code blocks nicely to GoDoc using a proper button.

But I just noticed you have an open PR, so this might be a good first step 👍

@umarcor
Copy link
Contributor

umarcor commented Oct 16, 2020

Personally, I am not convinced about Material themes. However, I don't have a better proposal; hence, that's a perfectly valid solution.

My main point regarding layout is that Cobra would greatly benefit from a two-column + sidebar layout on regular desktop screens. That's because most of the docs are commented code examples. Unfortunately, neither MkDocs nor asciidoctor allow it:

The DocuAPI template is precisely meant for that: https://umarcor.github.io/cobra/. However, as you see, some tweaking is required, because code blocks are not collapsible, and some of the examples are really long. Moreover, although gohugo supports complex hierarchies and taxonomies, DocuAPI places all the content in a single page. Apart from that DocuAPI is not a regular theme, as it requires JS and go dependencies.

This is to say that my PR is for discussing moving all the markdown sources to an specific subdir, reworking the README, adding shields, using CI for building the site, etc. I don't think DocuAPI is the best solution, and I don't have any strong feeling for using hugo. If it needs to be MkDocs + Material, let it be 😄 . Yet, note that @spf13 created https://cobra.dev/ already (even though sources are not available yet AFAIAA).

@spf13
Copy link
Owner

spf13 commented Oct 16, 2020 via email

@github-actions
Copy link

This issue is being marked as stale due to a long period of inactivity

@jharshman jharshman added this to the Next milestone Dec 18, 2020
@jharshman
Copy link
Collaborator

Team to investigate github page static site hosting.

@spf13
Copy link
Owner

spf13 commented Dec 18, 2020 via email

@umarcor
Copy link
Contributor

umarcor commented Dec 19, 2020

Team to investigate github page static site hosting.

Demo available: #1245. Just need to select a theme that maintainers like.

@github-actions
Copy link

This issue is being marked as stale due to a long period of inactivity

@jharshman
Copy link
Collaborator

Closing this as stale with the resolution that the https://cobra.dev website has been made available by @spf13

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

No branches or pull requests

7 participants