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

Added magefile to generate docs with github workflow #456

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kartikaysaxena
Copy link
Contributor

Fixes #234

Added github workflow that would invoke mage to generate docs for zed and submit the changes to the docs repo.

@kartikaysaxena kartikaysaxena changed the title Added zed docs with github workflow Added magefile to generate docs with github workflow Jan 17, 2025
)

// Generate markdown files for zed.
func GenerateDocs() error {
Copy link
Member

Choose a reason for hiding this comment

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

Mind naming this gen:docs and adding a gen:all as well?

We use that form in SpiceDB for any generated code: https://github.com/authzed/spicedb/blob/main/magefiles/gen.go#L16

Copy link
Member

Choose a reason for hiding this comment

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

This would also be great to add to SpiceDB as a followup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

func Run() {
zl := cobrazerolog.New(cobrazerolog.WithPreRunLevel(zerolog.DebugLevel))

func InitialiseRootCmd(zl *cobrazerolog.Builder) *cobra.Command {
Copy link
Member

Choose a reason for hiding this comment

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

Add a doc comment on this exported method

@kartikaysaxena kartikaysaxena force-pushed the zed-docs branch 4 times, most recently from 6b469e5 to b995d78 Compare January 17, 2025 21:29
- name: "Generate documentation"
run: |
cd magefiles
if ! mage GenerateDocs; then
Copy link
Member

Choose a reason for hiding this comment

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

Fix command

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@josephschorr
Copy link
Member

@kartikaysaxena Mind opening a PR with the docs on the docs repo so I can see them as well?

@kartikaysaxena
Copy link
Contributor Author

@kartikaysaxena Mind opening a PR with the docs on the docs repo so I can see them as well?

Here it is authzed/docs#296

@kartikaysaxena
Copy link
Contributor Author

Also authzed/spicedb#2208 and authzed/docs#298 for SpiceDB docs

@kartikaysaxena
Copy link
Contributor Author

Another way of doing this is to use commands like spicedb generate-docs and zed generate-docs to generate ingestable docs for other tools to use, not exposing them in docs. What do you think @josephschorr

@jzelinskie
Copy link
Member

I think this is wayyy too many files for our docs.
It'd be great if we could consolidate it into one regular docs page.

Another route to accomplish this could be reusing our existing manpage and pandoc to generate markdown.

Signed-off-by: Kartikay <[email protected]>
@kartikaysaxena
Copy link
Contributor Author

@jzelinskie
Merged into a single doc and looks like this. Does it need more improvement?

Signed-off-by: Kartikay <[email protected]>
@jzelinskie
Copy link
Member

Looks great to me!

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.

Make docs for cli
3 participants