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

Workflow to add the output for cds-typer --help in typer section #1294

Merged
merged 18 commits into from
Oct 1, 2024

Conversation

daogrady
Copy link
Contributor

@daogrady daogrady commented Oct 1, 2024

The documentation for cds-typer contains the output of calling cds-typer --help. This improves searchability for both search engines and AI. We currently update this part of the docs from time to time, so as of now, the help text could be out of date for some time before being brought up to date.

This PR introduces an action that can be triggered manually and automatically runs every Wednesday morning to automatically grab the latest version of the help text. If there are any updates, it will open a PR with the new content.

@daogrady daogrady marked this pull request as ready for review October 1, 2024 08:44
@renejeglinsky
Copy link
Contributor

This PR made me look for other places where we document the CLI help. There's not a lot but I found that we used specific styling which isn't used here:
image
Source: https://github.com/cap-js/docs/blob/main/tools/cds-cli.md#L94

@chgeo I'm not sure if the green highlighting was how it used to look. Maybe sth has changed?

General question: Should add or remove this styling at all places?

@daogrady
Copy link
Contributor Author

daogrady commented Oct 1, 2024

we used specific styling

Good catch, I wasn't even aware!

A few thoughts on that:

If we find that we'd like to have --help doc for other CLI tools in CAPire as well (esp. for Google, AI), we could also integrate them into this script in the future, which would result in the same colouring-discrepancy.
While the styling that is currently used for the output of cds help is obviously more colourful, code fences with log also come with a certain level of colouring:

Screenshot 2024-10-01 at 12 19 56

As this is also the style currently used in the cds-typer section, I guess we can at least postpone the style adjustments?
If we want to stick with the current styling and also have it streamlined throughout CAPire, then I will gladly look into doing so in a follow-up.

tl;dr: I'd be in favour of dropping the custom style for log fences, but not at all opposed to sticking with the existing style.

@chgeo
Copy link
Member

chgeo commented Oct 1, 2024

If we find that we'd like to have --help doc for other CLI tools in CAPire as well (esp. for Google, AI), we could also integrate them into this script in the future, which would result in the same colouring-discrepancy.

Yes, makes very much sense for me to have other (not necessarily all) commands as well.

As this is also the style currently used in the cds-typer section, I guess we can at least postpone the style adjustments?

Yes, let's handle this separately.

.github/workflows/extract-docs.yml Outdated Show resolved Hide resolved
.github/workflows/extract-docs.yml Outdated Show resolved Hide resolved
.github/workflows/extract-docs.yml Outdated Show resolved Hide resolved
.github/workflows/extract-docs.yml Outdated Show resolved Hide resolved
@chgeo chgeo changed the title Add workflow to automatically the output for cds-typer --help in typer section Workflow to add the output for cds-typer --help in typer section Oct 1, 2024
@chgeo
Copy link
Member

chgeo commented Oct 1, 2024

Let's merge this to see if the workflow worlks.

@chgeo chgeo merged commit ccb8542 into main Oct 1, 2024
4 checks passed
@chgeo chgeo deleted the feat/dynamic-typer-help-output branch October 1, 2024 15:05
@chgeo
Copy link
Member

chgeo commented Oct 1, 2024

@chgeo
Copy link
Member

chgeo commented Oct 1, 2024

Continued in #1301

@chgeo chgeo mentioned this pull request Oct 1, 2024
chgeo added a commit that referenced this pull request Oct 2, 2024
Make #1294 more generic and update more CLI texts.

- Use the `<pre class="log">` approach instead of `log` code fence as it
allows us to style the output more.
- Convert known terminal escape sequences to formats (mainly `<em>`,
`<i>`, `<strong>`).
- Remove the versions numbers from the output as these would produce
diffs for each new version, although the texts have not changed.
- Fix the workflow and produce a PR with a stable title. Parallel PRs
seem unnecessary.
- GH limitation: that PR cannot trigger new workflows. Workaround is to
close and reopen the PR.
  - Example is #1303 

This also gets rid of the [custom renovate config to bump inner-md
versions](https://github.com/cap-js/docs/blob/810cd2beedab1f0d9aa6ae0777c8b79a69f8f067/.github/renovate.json#L58-L117)
and the corresponding PRs.

---------

Co-authored-by: Daniel O'Grady <[email protected]>
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