-
Notifications
You must be signed in to change notification settings - Fork 663
CLI - Add feature to print markdown docs #2276
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
175090a
[bfops/cli-docs]: use clap-markdown to print CLI docs in markdown format
bfops 011f41e
[bfops/cli-docs]: add CI job
bfops 2489844
[bfops/cli-docs]: CI fix?
bfops 8b85ee2
[bfops/cli-docs]: tweak CI
bfops 0e6e347
[bfops/cli-docs]: add sed commands from README
bfops 624c5cd
[bfops/cli-docs]: update CI
bfops c837a02
[bfops/cli-docs]: Merge remote-tracking branch 'origin/master' into b…
bfops 34087fa
[bfops/cli-docs]: [temp] change the CLI helptext to check that CI fails
bfops 6d8a787
[bfops/cli-docs]: revert
bfops 61b6e99
[bfops/cli-docs]: remove unnecessary dotnet setup
bfops a1cd79f
[bfops/cli-docs]: empty
bfops 968fa01
[bfops/cli-docs]: tweak
bfops 4848880
[bfops/cli-docs]: ci always git status
bfops bc8f726
[bfops/cli-docs]: fix CI?
bfops 1a446ac
[bfops/cli-docs]: REVERT THIS COMMIT - test that CI fails
bfops adb70ed
[bfops/cli-docs]: revert
bfops 149bec1
[bfops/cli-docs]: [bfops/cli-docs]: REVERT THIS COMMIT - test that CI…
bfops 01e06b6
[bfops/cli-docs]: revert
bfops File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| on: | ||
| pull_request: | ||
| workflow_dispatch: | ||
| inputs: | ||
| pr_number: | ||
| description: 'Pull Request Number' | ||
| required: false | ||
| default: '' | ||
|
|
||
| name: PR-only CI | ||
|
|
||
| jobs: | ||
| cli_docs: | ||
| name: Check CLI docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Find Git ref | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| shell: bash | ||
| run: | | ||
| PR_NUMBER="${{ github.event.inputs.pr_number || null }}" | ||
| if test -n "${PR_NUMBER}"; then | ||
| GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" | ||
| else | ||
| GIT_REF="${{ github.ref }}" | ||
| fi | ||
| echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ env.GIT_REF }} | ||
| - uses: dsherret/rust-toolchain-file@v1 | ||
|
||
| - name: Checkout docs | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: clockworklabs/spacetime-docs | ||
| ref: master | ||
| path: spacetime-docs | ||
| - name: Check for docs change | ||
| run: | | ||
| cargo run --features markdown-docs -p spacetimedb-cli > spacetime-docs/docs/cli-reference.md | ||
| cd spacetime-docs | ||
| # This is needed because our website doesn't render markdown quite properly. | ||
| # See the README in spacetime-docs for more details. | ||
| sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md | ||
| sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 <b>\2</b>!' docs/cli-reference.md | ||
| git status | ||
| if git diff --exit-code HEAD; then | ||
| echo "No docs changes detected" | ||
| else | ||
| echo "It looks like the CLI docs have changed:" | ||
| exit 1 | ||
| fi | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.