Skip to content

Added magefile to generate docs with github workflow#456

Merged
tstirrat15 merged 3 commits intoauthzed:mainfrom
kartikaysaxena:zed-docs
Feb 6, 2025
Merged

Added magefile to generate docs with github workflow#456
tstirrat15 merged 3 commits intoauthzed:mainfrom
kartikaysaxena:zed-docs

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.

@kartikaysaxena
Copy link
Contributor Author

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

@jzelinskie
Copy link
Member

Looks great to me!

Signed-off-by: Kartikay <kartikay_2101ce32@iitp.ac.in>
Signed-off-by: Kartikay <kartikay_2101ce32@iitp.ac.in>
Signed-off-by: Kartikay <kartikay_2101ce32@iitp.ac.in>
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Let's get this in.

@tstirrat15
Copy link
Contributor

Thank you for putting this up!

@tstirrat15 tstirrat15 merged commit d5dcb8c into authzed:main Feb 6, 2025
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2025
@kartikaysaxena kartikaysaxena deleted the zed-docs branch September 2, 2025 12:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make docs for cli

4 participants