Skip to content

Conversation

@elizabethhealy
Copy link
Member

@elizabethhealy elizabethhealy commented Dec 18, 2024

Mainly for docs.opentdf.io

@elizabethhealy elizabethhealy changed the title feat(docsadding examples to policy commands feat(docs): Adding examples to policy commands Dec 18, 2024
@elizabethhealy elizabethhealy changed the title feat(docs): Adding examples to policy commands feat(core): Adding examples docs, mainly policy commands Dec 18, 2024
@elizabethhealy elizabethhealy marked this pull request as ready for review December 18, 2024 16:00
@elizabethhealy elizabethhealy requested a review from a team as a code owner December 18, 2024 16:00
@jakedoublev
Copy link
Contributor

If you run one of the commands with -h in a smaller terminal window, how does the markdown render output appear? Could you please attach screenshots with different terminal sizes for reference in the PR?

@jrschumacher
Copy link
Member

@elizabethhealy I think Jake brings up some good points. Could we add this output to another header which we can exclude from the CLI output? I'm open to suggestions that would allow this to be uniform. We use this function to style the docs which would allow you to strip any sections that should be omitted from the CLI docs.

I believe when I added example I didn't give an example of the output: https://github.com/opentdf/otdfctl/blob/main/docs/man/auth/client-credentials.md#examples

Finally, I think we need to cement the CLI that we are modeling our docs after, but when I've been doing it I tend to use man git, man ssh, and man openssl.

@elizabethhealy
Copy link
Member Author

elizabethhealy commented Dec 19, 2024

@elizabethhealy I think Jake brings up some good points. Could we add this output to another header which we can exclude from the CLI output? I'm open to suggestions that would allow this to be uniform. We use this function to style the docs which would allow you to strip any sections that should be omitted from the CLI docs.

I believe when I added example I didn't give an example of the output: https://github.com/opentdf/otdfctl/blob/main/docs/man/auth/client-credentials.md#examples

Finally, I think we need to cement the CLI that we are modeling our docs after, but when I've been doing it I tend to use man git, man ssh, and man openssl.

@jrschumacher i like this idea, is there a way to pick which headers are displayed in the help output? ideally i think id like both the input and output in whats displayed on the docs website but only the input on the help command

@jrschumacher
Copy link
Member

@elizabethhealy yep in the styledoc function you should be able to iterate. We will need to add https://github.com/yuin/goldmark to parse the markdown and strip out the headers we don't want. Whether you strip before styling is up to you, but we do include https://github.com/charmbracelet/glamour for styling the markdown which also uses goldmark.

If you could just add a README to the man directory so we can keep track of the special headers or header tags.

Lastly in opentdf/docs there is a custom react component used to render the markdown into HTML. Inn that you can iterate and add or remove new elements.

@jakedoublev
Copy link
Contributor

This is great! Looks like there are still example outputs for KAS grants and SCS creation, but this should be good to go after those are removed. 🎉

@elizabethhealy
Copy link
Member Author

@jakedoublev thanks good catch! should be ready now.
i played around with goldmark a bit but just removed the output for the short term, figured i can come back to it on engineering day since its just a nice to have

@elizabethhealy elizabethhealy merged commit 04c1743 into main Jan 7, 2025
3 checks passed
@elizabethhealy elizabethhealy deleted the add-examples-to-policy-commands branch January 7, 2025 16:33
jakedoublev pushed a commit that referenced this pull request Feb 25, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.18.0](v0.17.1...v0.18.0)
(2025-02-25)


### Features

* Assertion verification
([#452](#452))
([5a8fe0d](5a8fe0d))
* **core:** Adding examples docs, mainly policy commands
([#461](#461))
([04c1743](04c1743))
* **core:** bump SDK and consume new platform connection validation
([#493](#493))
([1106b54](1106b54))
* **core:** Shows SDK version and spec info
([#474](#474))
([5a685c4](5a685c4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
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.

5 participants