-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Write literate (executable) documentation #2611
Comments
Its a good idea, but seems somewhat fragile as it depends on the integrity of the docs, no? I.e. what if the docs miss certain steps? I guess that'll expose flaws in our documentation too. |
Yes, that's true - I think this should only apply to some files, but for those it does apply to having the steps be linearly sequenceable for anyone testing them themselves is probably prudent anyways. |
I'm not sure this is worth doing, unless its a quick fix. This is only a problem because we keep breaking the CLI. Once we launch, the CLI should have some sense of stability, so we can just mandate updating the docs at each breaking change. Instead, Golang provides testable examples. We can manually ensure compatibility between example and docs. (e.g. when the examples change, review will require updating the docs) The above is much easier than trying to figure out a way to parse the code out of the docs imo. |
is the CLI approaching stability whereby we can write this executable doc and not have to completely overhaul it in a few weeks? |
not quite yet... |
Hmm, the idea was more that such an executable doc could be overhauled gradually as changes are made, in the PRs which they are made - and that due to this it would be unnecessary to overhaul docs in large chunks periodically when they get extremely out of date. I don't feel too strongly about this though, just a concept. |
this seems a bit crazy for now honestly. HOWEVER note that I actually did once upon-a-time create a way to do this with bash. https://github.com/rigelrozanski/shelldown However I don't think we should be testing the CLI in bash - we should be testing the cobra command directly. See this issue: #2706 I would be really into some basic code-gen from the markdown comments (could be a similar technique to |
I think we've decided not to do this. |
Let's figure out a way to actually run our documentation (the commands therein) in CI, so we notice when it's wrong. I think that will help a lot with keeping the docs up to date since it will be immediately noticeable (and surrounding text can easily be updated when the commands themselves are updated).
A quick-and-dirty way would be something like:
gaiad
,gaiacli
) and run through the command sequenceThe text was updated successfully, but these errors were encountered: