Skip to content

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

Merged
loicsay merged 4 commits into
mainfrom
feat/new-world-doc-automation
Oct 10, 2023
Merged

feat(automation): new world doc pr creation#130
loicsay merged 4 commits into
mainfrom
feat/new-world-doc-automation

Conversation

@loicsay
Copy link
Copy Markdown
Contributor

@loicsay loicsay commented Sep 29, 2023

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:

  • We'll add annotation (runInWebCli) to commands with web CLI enabled in new-world-docs
  • Because there's differences between CLI examples and the ones run with the web CLI, we'll standardize all examples with the new-world-docs/webCLI (in a future PR)
  • Examples with output or pipe symbols will automatically be non-runnable

@loicsay loicsay self-assigned this Sep 29, 2023
@loicsay loicsay force-pushed the feat/new-world-doc-automation branch 2 times, most recently from a579ad7 to 334c4cd Compare October 3, 2023 09:33
@loicsay loicsay force-pushed the feat/new-world-doc-automation branch from 334c4cd to cebc471 Compare October 3, 2023 09:33
@loicsay loicsay marked this pull request as ready for review October 3, 2023 09:33
@loicsay
Copy link
Copy Markdown
Contributor Author

loicsay commented Oct 3, 2023

@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
Copy link
Copy Markdown
Collaborator

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

@clemfromspace
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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 loicsay force-pushed the feat/new-world-doc-automation branch from f791072 to e08747b Compare October 4, 2023 08:52
@loicsay
Copy link
Copy Markdown
Contributor Author

loicsay commented Oct 4, 2023

@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?

@loicsay loicsay force-pushed the feat/new-world-doc-automation branch from 455af37 to ce32ef8 Compare October 4, 2023 09:47
Copy link
Copy Markdown
Contributor

@clemfromspace clemfromspace left a comment

Choose a reason for hiding this comment

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

Good job, the template way was definitely the way to go 👍

I think we need to work more of the example presentation (splitting, etc.)
I also added some comments regarding the duplicated code / now shared code between the two docs generation methods.

Comment thread internal/docs/yaml.go Outdated
Comment thread internal/docs/mdx.go Outdated
Comment thread internal/docs/mdx.tpl Outdated
Comment thread internal/docs/mdx.go Outdated
Comment thread internal/docs/mdx.go Outdated
@clemfromspace
Copy link
Copy Markdown
Contributor

clemfromspace commented Oct 6, 2023

@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
Copy link
Copy Markdown
Contributor Author

loicsay commented Oct 9, 2023

cc @kai687
Summary of our discussion with @clemfromspace:

  • We'll add annotation (runInWebCli) to commands with web CLI enabled in new-world-docs
  • Because there's differences between CLI examples and the ones run with the web CLI, we'll standardize all examples with the new-world-docs/webCLI (in a future PR)
  • Examples with output or pipe symbols will automatically be non-runnable

Comment thread pkg/cmd/indices/list/list.go
Copy link
Copy Markdown
Contributor

@clemfromspace clemfromspace left a comment

Choose a reason for hiding this comment

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

Love it, LGTM 🚀

@loicsay loicsay merged commit 59d8a7b into main Oct 10, 2023
@loicsay loicsay deleted the feat/new-world-doc-automation branch October 10, 2023 12:44
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.

3 participants