#Autodoc for the CLI

1 messages · Page 1 of 1 (latest)

versed kestrel
#

We can control the file paths and links to them btw.

wooden eagle
#

The CLI reference is just a single .md file in docusaurus. So maybe we just concatenate all these generated .md files into one and use that becomes the CLI reference page? We will then only need to add frontmatter and (maybe) adjust the heading levels.

#

We might also need to add an "experimental" warning for some commands, based on a flag in the CLI source

versed kestrel
#

We can customize all of that, but not without extra work. Can we just make it multiple files?

#

I think it's too much for just one file. It would at least need an index.

wooden eagle
#

If we leave it as multiple files, then we'd have to produce navigation, either in the Docusaurus sidebar or in the generated index page. Does the generator provide any navigation already? Like an index page with links to each command page?

versed kestrel
#

No, but it's easier to create a new file with that than it is to combine all in one doc. Is there anything (component, etc) from docussaurus that helps with this index/list?

wooden eagle
#

Yes, there is an option to autogenerate the sidebar nav: https://docusaurus.io/docs/sidebar/autogenerated However I've not used this before so not 100% sure how much control we have, we might end up with a logn sidebar nav with a link for each command page. Will need to try it out and see. If that doesn't work out, another option would be to have the sidebar nav point to a static page with inline links to each of the generated pages, similar to what we are doing for the autogenerated Node SDK reference https://github.com/dagger/dagger/blob/main/docs/sidebars.js#L113

versed kestrel
#

Yeah, that's what I meant. Put the index in the current xxx-cli.mdx file, and create the others with the same prefix: xxx-cli-dagger-call.mdx. This way we don't need to change the sidebar and and I don't have to worry about unique ids for these auto-generated files.

#

I'll try the autogenerated one first though.