-
Notifications
You must be signed in to change notification settings - Fork 773
feature: add gen-doc command to auto gen dfget cli docs #312
Conversation
After PR pouchcontainer/pouchrobot#100 is merged, we could make @pouchrobot to support auto generate cli documentation. |
8945ede
to
9dba3c6
Compare
Codecov Report
@@ Coverage Diff @@
## master #312 +/- ##
==========================================
- Coverage 58.19% 58.17% -0.02%
==========================================
Files 31 32 +1
Lines 1794 1810 +16
==========================================
+ Hits 1044 1053 +9
- Misses 709 716 +7
Partials 41 41
Continue to review full report at Codecov.
|
Please rebase the master branch after dragonflyoss/dragonfly#305 merged. |
9dba3c6
to
3a4fe7f
Compare
PTAL @starnop |
title: "dfget" | ||
weight: 5 | ||
--- | ||
## dfget |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what's the difference between this file and the auto-generated file?
``` | ||
|
||
## Files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe we need the documentation about the configuration file. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can split that from the dfget.md.
rootCmd.AddCommand(genDocCommand.cmd) | ||
} | ||
|
||
func (g *GenDocCommand) runGenDoc(args []string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please implement the related part of dfdaemon
by he way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will do that in a separate PR.
7d8fbfb
to
f551ff0
Compare
f551ff0
to
17f6116
Compare
Signed-off-by: Allen Sun <[email protected]>
17f6116
to
da7d326
Compare
feature: add gen-doc command to auto gen dfget cli docs
feature: add gen-doc command to auto gen dfget cli docs
Signed-off-by: Allen Sun [email protected]
Ⅰ. Describe what this PR did
How to generate user-friendly document is very important work we have to do in Dragonfly project. While I think the best way to make it is to follow the rule CODE IS DOCUMENT(代码即文档). Under such kind of policy, when every update occurs to the CLI-related code, the project has abilities to auto generate the corresponding document. Then the developers can spend less time to construct the document, instead they could have more time to polish the CLI related code when programming which is also reasonable.
We have already supported using
spf13/cobra
to implement COMMAND LINE framework in dragonflyoss/dragonfly#257. With this work, we can use https://github.com/spf13/cobra/blob/master/doc/md_docs.md to add another command to generate all the CLI document.After adding the command which is used to generate CLI document, we can make @pouchrobot to automatically generate doc every day when it has update to the cli part. This is quite similar to PouchContainer.
Ⅱ. Does this pull request fix one issue?
fix dragonflyoss/dragonfly#306
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
no need
Ⅳ. Describe how to verify it
none
Ⅴ. Special notes for reviews
none