Skip to content

Improve "docsgen" program's usability as a "template" #144

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

Merged
merged 3 commits into from
Aug 18, 2021
Merged

Improve "docsgen" program's usability as a "template" #144

merged 3 commits into from
Aug 18, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 16, 2021

I identified some project-specific aspects of the template "docsgen" program for generating the website Cobra CLI reference content. These are resolved, mitigated, or documented by this pull request.

See the individual commits for details:
https://github.com/arduino/tooling-project-assets/pull/144/commits

@per1234 per1234 added topic: documentation Related to documentation for the project type: enhancement Proposed improvement topic: code Related to content of the project itself labels Aug 16, 2021
@per1234 per1234 requested a review from umbynos August 16, 2021 01:09
The function that creates the Cobra CLI command root is declared by each project, and so might have any name. As it was
the most advanced in general, I used Arduino Lint as the source for the Cobra-based project website template assets.
However, I noticed that Arduino CLI and Arduino Firmware Uploader both use the function name `cli.NewCommand()`, so I
think this is more likely to be the name used by tooling projects this template is applied to.
The function that creates the Cobra CLI command root is declared by each project, and so might have any name. The
"docsgen" program that generates the command line reference content for the website calls this function, so it will be
necessary for the appropriate function to be added to the program when it is added to a project.

Previously, there was no documentation of this project-specific component of the "template", which could result in
confusion when it was applied to a project that happens to have a different function name from the `cli.NewCommand()`
used by the "template" docsgen code.
The template "docsgen" program for generating the website Cobra CLI reference content relies on the project's Cobra CLI
package being named `cli`. But this is not guaranteed to be so, and in fact the Cobra documentation uses `cmd` instead.

Confusion caused by applying the program to projects that use different package names will be avoided by specifying an
explicit package name in the import statement.
@per1234 per1234 merged commit 8283fff into arduino:main Aug 18, 2021
@per1234 per1234 deleted the templatier-docsgen branch August 18, 2021 08:53
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: documentation Related to documentation for the project type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants