algolia / cli

๐Ÿ” Algoliaโ€™s official CLI devtool
https://www.algolia.com/doc/tools/cli
MIT License
101 stars 26 forks source link

feat(automation): new world doc pr creation #130

Closed loicsay closed 9 months ago

loicsay commented 9 months ago

DEX-1021

This PR create a command to generate a new-world-docs PR that'll update the .mdx files for the CLI documentation.

How to test?

go run ./cmd/docs --app_data-path docs/app_data/cli/commands --target new

It will output the files in at docs/app_data/cli/commands

Refinement

Summary of our discussion with @clemfromspace:

loicsay commented 9 months ago

@dylantientcheu @clemfromspace I'm not sure about how we should handle the runInCommand property for each example ๐Ÿค” Do you have any idea? Should we hardcode a list of commands that allow this feature in the CLI codebase?

dylantientcheu commented 9 months ago

For now we can edit the submitted PR each time, i'd prefer not to bloat the cli code.

clemfromspace commented 9 months ago

I think we should run the example directly, so we will have to edit the example to make them match what indices / things we have in the doc. That way, no editing is necessary and it's more coherent maybe. WDYT?

clemfromspace commented 9 months ago

As for the which commands as available, maybe we can tag them in order to exclude / include them from the webCLI? Won't be a big effort IMHO, as we already leverage the tagging for the telemetry & others.

loicsay commented 9 months ago

@clemfromspace I agree, let's remove all Examples formatting for now and do it in new-world-doc ๐Ÿ‘ Same for the WebCLI I think? You're suggesting doing outside of this repo if I understand correctly?

clemfromspace commented 9 months ago

@loicsay I saw that you actually removed the example splitting, this was not what I meant ๐Ÿ˜“ Sorry about the confusion, I wanted to say that we should directly run the examples in the webCLI (for the available commands), but that we should edit those examples, directly in the CLI, to match the indices names & co that are present in the docs. This should be done in a second step, along with adding a availableInWebCLI annotation on the commands.

loicsay commented 9 months ago

cc @kai687 Summary of our discussion with @clemfromspace: