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

docs: Use preformatted strings in fmt help #7263

Merged

Conversation

charlieegan3
Copy link
Contributor

@charlieegan3 charlieegan3 commented Jan 14, 2025

Without this, the -- are rendered in HTML as making the commands with flags incorrect in the docs.
before
Screenshot 2025-01-14 at 11 07 33

after
Screenshot 2025-01-14 at 11 07 02

Without this, the `--` are rendered in HTML as `–` making the commands
with flags incorrect in the docs.

Signed-off-by: Charlie Egan <[email protected]>
Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/67864204fedbddeef41fc454
😎 Deploy Preview https://deploy-preview-7263--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@anderseknert
Copy link
Member

Good to fix the html rendering! But what does this look like on the command line?

@charlieegan3
Copy link
Contributor Author

I thought it looked alright, but to be fair there is not precedent for this already in other commands... I am unsure how best to do it otherwise.

Screenshot 2025-01-14 at 14 53 05

Perhaps there are some more options we can press on https://github.com/spf13/cobra/blob/01ffff4eca5a08384ef2b85f39ec0dac192a5f7b/doc/md_docs.go#L68 that would be preferred.

@anderseknert
Copy link
Member

Yeah, it's not terrible, but not ideal. I remember writing the "generator" for this back in the day, and that we do some customizations in there already. https://github.com/open-policy-agent/opa/blob/main/build/generate-cli-docs/generate.go

Not sure if it'd be easy to identify these locations and change only for HTML rendering. Not worth spending too much time on though, so if that's needed, I think this is fine to keep as is.

@charlieegan3 charlieegan3 merged commit 6de4565 into open-policy-agent:main Jan 14, 2025
28 checks passed
@charlieegan3 charlieegan3 deleted the opa-fmt-pre-string branch January 14, 2025 16:23
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

Successfully merging this pull request may close these issues.

3 participants