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

fix: Prevent Manually Added Content in CLI Docs to be Overwritten #9125

Conversation

aboobakersiddiqr63
Copy link
Contributor

Notes for Reviewers

This PR fixes #9104

Signed commits

  • [ ✓] Yes, I signed my commits.

Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
@github-actions github-actions bot added the component/mesheryctl CLI for Meshery label Oct 16, 2023
@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (2949e28) 10.11% compared to head (979747d) 10.18%.
Report is 67 commits behind head on master.

❗ Current head 979747d differs from pull request most recent head b623613. Consider uploading reports for the commit b623613 to get more accurate results

Files Patch % Lines
mesheryctl/doc/doc.go 59.37% 10 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9125      +/-   ##
==========================================
+ Coverage   10.11%   10.18%   +0.07%     
==========================================
  Files         136      136              
  Lines       21193    21201       +8     
==========================================
+ Hits         2143     2160      +17     
+ Misses      18729    18717      -12     
- Partials      321      324       +3     
Flag Coverage Δ
unittests 10.18% <59.37%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
@github-actions github-actions bot added the area/docs Documentation update needed label Oct 17, 2023
@l5io
Copy link
Collaborator

l5io commented Oct 17, 2023

Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Oct 17, 2023

@saurabh100ni
Copy link
Contributor

Thanks for raising the PR, let's Discuss this in the Meshery Development Call today,
Please add this as an agenda in the Doc : Doc

Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Oct 18, 2023

Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Oct 18, 2023

Copy link
Member

@alphaX86 alphaX86 left a comment

Choose a reason for hiding this comment

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

Great effort. Curious though. So to invoke this user would be applying them on the markdown page or in go program?

@aboobakersiddiqr63
Copy link
Contributor Author

Great effort. Curious though. So to invoke this user would be applying them on the markdown page or in go program?

Thanks @alphaX86. The user just needs to add the comment on the md file

Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Oct 21, 2023

Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Oct 21, 2023

Comment on lines 204 to 207
## Preserving Manually Added Documentation with Cobra CLI

We use Cobra CLI and GitHub Actions to automate the generation of command documentation. To protect any manually added content and ensure it remains intact after regeneration, follow this format: {% raw %}{% include folder-name/file-name %}{% endraw %}. This format should reference an external file where your manual changes are stored. Any content added using this format will not be altered during the documentation generation process. When making new changes or additions, be sure to place them at the end of the documentation to keep it organized and consistent.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## Preserving Manually Added Documentation with Cobra CLI
We use Cobra CLI and GitHub Actions to automate the generation of command documentation. To protect any manually added content and ensure it remains intact after regeneration, follow this format: {% raw %}{% include folder-name/file-name %}{% endraw %}. This format should reference an external file where your manual changes are stored. Any content added using this format will not be altered during the documentation generation process. When making new changes or additions, be sure to place them at the end of the documentation to keep it organized and consistent.
## Preserving Manually Added Documentation
`mesheryctl` uses Cobra CLI and GitHub Actions to automate the generation of command documentation. On occasion, additional documentation beyond that included in the `mesheryctl` Golang files is ideal to capture and include in the CLI reference pages. Contributors are encouraged to add more usage examples, screenshots, video explainers and so forth to any of the CLI reference pages. To protect any manually added content and ensure it remains intact after regeneration, create a separate Jekyll `include` file. Follow file naming scheme outlined below:

{% raw %}{% include mesheryctl/ %}{% endraw %}


This format should reference an external file where your manual changes are stored. Any content added using this method will not be altered during the documentation generation process, but instead will be included post-auto doc generation. When making new changes or additions, understand that these additional details are positioned at the end their given CLI reference page, so bear this in mind as you organize and present your additional command details.

@@ -206,9 +215,10 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer) error {
}
})
}
buf.WriteString("Go back to [command reference index](/reference/mesheryctl/) ")
buf.WriteString("Go back to [command reference index](/reference/mesheryctl/), if you want to add content manually to the CLI documentation, please refer to the [instruction](/project/contributing/contributing-cli#preserving-manually-added-documentation-with-cobra-cli) for guidance.")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
buf.WriteString("Go back to [command reference index](/reference/mesheryctl/), if you want to add content manually to the CLI documentation, please refer to the [instruction](/project/contributing/contributing-cli#preserving-manually-added-documentation-with-cobra-cli) for guidance.")
buf.WriteString("Go back to [command reference index](/reference/mesheryctl/), if you want to add content manually to the CLI documentation, please refer to the [instruction](/project/contributing/contributing-cli#preserving-manually-added-documentation) for guidance.")

leecalcote
leecalcote previously approved these changes Oct 24, 2023
Copy link
Member

@leecalcote leecalcote left a comment

Choose a reason for hiding this comment

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

Looking good. 👍

I think this new include method is a bit cleaner. Nice work.

@saurabh100ni
Copy link
Contributor

Let's discuss this on the Meshery dev call tomorrow at 7:30 pm IST / 9:00 am CT,
Please add this as your agenda item in Docs: https://docs.google.com/document/d/1Dg4Uz9rGTuGHmYZwIt47z1j5x3LmnpxD1M1SgypAkQ0/edit

@leecalcote
Copy link
Member

leecalcote commented Oct 26, 2023

@aboobakersiddiqr63 will you send word when you have added an include file example to the Contributing portion of this PR?

Signed-off-by: Aboobaker Siddiq R <aboobakersiddiq63@gmail.com>
@aboobakersiddiqr63
Copy link
Contributor Author

@alphaX86

@aboobakersiddiqr63 will you send word when you have added an include file example to the Contributing portion of this PR?

@leecalcote added an example of how to add manual content to the cli docs and updated other changes you have mentioned

I could not find an example actually. Could you share any markdown file utilizing this ability?

@alphaX86 I have added the example to contributing-cli.md file on how to proceed
image

@alphaX86
Copy link
Member

@aboobakersiddiqr63 noted. I'll try this and get back to you then 👍

@leecalcote
Copy link
Member

Gents, do we have an example for the docs?

Good to merge after this, yes?

@abhijeetgauravm
Copy link
Contributor

Hey @aboobakersiddiqr63 Let's discuss this on Meshery Development Meeting tomorrow at 8:30 PM IST / 9 AM Central time. Please add this as an agenda item in the meeting minutes.

@MUzairS15
Copy link
Contributor

@alphaX86 Can you finish this off. // @aboobakersiddiqr63

@alphaX86
Copy link
Member

@alphaX86 Can you finish this off. // @aboobakersiddiqr63

I'll wrap this up @MUzairS15

@l5io
Copy link
Collaborator

l5io commented Nov 19, 2023

@leecalcote
Copy link
Member

@alphaX86 Can you finish this off. // @aboobakersiddiqr63

I'll wrap this up @MUzairS15

@alphaX86 good to go?

@alphaX86
Copy link
Member

@alphaX86 Can you finish this off. // @aboobakersiddiqr63

I'll wrap this up @MUzairS15

@alphaX86 good to go?

I'm testing the changes @leecalcote. Once they are good, we're good to merge this by EOD.

@l5io
Copy link
Collaborator

l5io commented Nov 22, 2023

@alphaX86 alphaX86 force-pushed the aboobakersiddiqr63/docs-manualcont-changes branch from 58bcf3b to c398859 Compare November 22, 2023 16:20
Signed-off-by: Aadhitya A <aadhitya864@gmail.com>
@alphaX86 alphaX86 force-pushed the aboobakersiddiqr63/docs-manualcont-changes branch from c398859 to 3c38c86 Compare November 22, 2023 16:22
alphaX86
alphaX86 previously approved these changes Nov 22, 2023
Copy link
Member

@alphaX86 alphaX86 left a comment

Choose a reason for hiding this comment

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

Tested the changes 🟢. Made changes in doc page as well. LGTM 👍

@alphaX86
Copy link
Member

Hold... one bug found in docs. Fixing it quick...

@l5io
Copy link
Collaborator

l5io commented Nov 22, 2023

@alphaX86 alphaX86 force-pushed the aboobakersiddiqr63/docs-manualcont-changes branch from 32a9aa9 to 13a9e0a Compare November 22, 2023 17:01
@l5io
Copy link
Collaborator

l5io commented Nov 22, 2023

@alphaX86 alphaX86 force-pushed the aboobakersiddiqr63/docs-manualcont-changes branch from 13a9e0a to 2e37e32 Compare November 22, 2023 17:08
@l5io
Copy link
Collaborator

l5io commented Nov 22, 2023

Signed-off-by: Aadhitya A <aadhitya864@gmail.com>
@alphaX86 alphaX86 force-pushed the aboobakersiddiqr63/docs-manualcont-changes branch from 2e37e32 to b623613 Compare November 22, 2023 17:14
@l5io
Copy link
Collaborator

l5io commented Nov 22, 2023

@alphaX86
Copy link
Member

Fixed. We're good now // @leecalcote

@leecalcote
Copy link
Member

Roger, Roger. Thank you, @alphaX86

@leecalcote leecalcote merged commit 4eea7ae into meshery:master Nov 22, 2023
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Documentation update needed component/mesheryctl CLI for Meshery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mesheryctl] Rework existing mesheryctl command ref docs script
7 participants