-
Notifications
You must be signed in to change notification settings - Fork 639
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
docs: fixed and improved "View Source" on docusaurus code blocks #6396
Conversation
WalkthroughThe changes introduce a Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant CodeBlockWrapper
participant CodeBlock
User->>CodeBlockWrapper: Render with props
CodeBlockWrapper->>CodeBlockWrapper: Check for source prop
alt Source prop exists
CodeBlockWrapper->>User: Display "View Source" link
end
CodeBlockWrapper->>CodeBlock: Render CodeBlock
CodeBlock->>User: Display code block
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (3)
docs/tutorials/01-fee/03-scaffold-chain.md (1)
34-34
: Consider using a less frequent alternative to "feel free to" to enhance the professionalism of the documentation.docs/tutorials/01-fee/05-scaffold-react.md (2)
Line range hint
155-155
: Consider using a less frequent alternative to "feel free to" to enhance the professionalism of the documentation.
[!TIP]
Codebase VerificationThe verification process revealed that the
ignite
andnpm
commands are not available, and thets-client
directory does not exist in the repository. This indicates that the commands and instructions provided in the documentation may not be executable as described.
- The
ignite
command is not found in the repository.- The
npm
command is not found in the repository.- The
ts-client
directory does not exist in the repository.Please ensure that the necessary tools (
ignite
andnpm
) are installed and available in the environment, and that thets-client
directory is correctly set up before running the provided commands.Analysis chain
Line range hint
86-113
: Ensure the updated commands and source links are correct.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the validity of the source links and the correctness of the commands. # Test: Check the source links. curl -I https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/commit/51b8e3304f5c8c2e2e477dac9985237be676254b curl -I https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/commit/6b31da02d1ca4fba70d58a3b3e56d9f1e3f06833 curl -I https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/commit/dffcf719fd8c223be06d3327e6bc24ec7cf0cec3 curl -I https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/commit/1c90ffddbab1655038dc296874f427b036afb749Length of output: 19814
Script:
#!/bin/bash # Description: Verify the correctness of the commands mentioned in the documentation. # Test: Check if the ignite command is available and its version. ignite --version # Test: Check if the npm command is available and its version. npm --version # Test: Check if the ignite scaffold react command is valid. ignite scaffold react --help # Test: Check if the ignite generate hooks --clear-cache command is valid. ignite generate hooks --clear-cache --help # Test: Check if the npm install command with the specified packages is valid. cd ts-client && npm install @cosmjs/launchpad@0.27.1 @cosmjs/proto-signing@0.31.1 @cosmjs/stargate@0.31.1 @keplr-wallet/types@0.11.14 --dry-runLength of output: 510
Script:
#!/bin/bash # Description: Verify the availability of the ignite and npm commands and the existence of the ts-client directory. # Test: Search for the ignite command in the repository. fd ignite # Test: Search for the npm command in the repository. fd npm # Test: Search for the ts-client directory in the repository. fd --type d ts-clientLength of output: 193
Review Details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (3)
- docs/src/theme/CodeBlock/index.js (1 hunks)
- docs/tutorials/01-fee/03-scaffold-chain.md (1 hunks)
- docs/tutorials/01-fee/05-scaffold-react.md (3 hunks)
Additional Context Used
LanguageTool (8)
docs/tutorials/01-fee/03-scaffold-chain.md (2)
Near line 25: Possible missing comma found.
Context: ...hain serve --reset-once ``` Once it is running quit by pressingq
. This blockchain c...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA
Near line 34: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: .../v7@v7.3.0 && go mod tidy Feel free to test that the chain still runs with `ig...
Rule ID: FEEL_FREE_TO_STYLE_MEdocs/tutorials/01-fee/05-scaffold-react.md (6)
Near line 89: Use a comma after an introductory phrase.
Context: ...b"> ignite scaffold react For this will create a React app within the `rea...
Rule ID: COMMA_INTRODUCTORY_WORDS_PHRASES
Near line 120: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...e is a bug in the generated app that we need to fix. While this is fixed in the next ve...
Rule ID: REP_NEED_TO_VB
Near line 120: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...d in the next version of Ignite CLI, we need to fix it manually for now since we are us...
Rule ID: REP_NEED_TO_VB
Near line 120: Did you mean “or”? ‘Of’ refers to parts of a whole, while ‘or’ refers to alternatives.
Context: ...27.1`) of Ignite CLI. (The next version of ignite comes with the Fee Middleware wi...
Rule ID: CONFUSION_OF_OR
Near line 122: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... the string=**
in certain places. We need to remove this using replace. You can use ...
Rule ID: REP_NEED_TO_VB
Near line 155: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...ected](./images/ignite-unmodified.png) Feel free to play around with the app. You can send ...
Rule ID: FEEL_FREE_TO_STYLE_ME
Markdownlint (4)
docs/tutorials/01-fee/03-scaffold-chain.md (1)
10: null
Multiple top-level headings in the same documentdocs/tutorials/01-fee/05-scaffold-react.md (3)
109: Expected: 0 or 2; Actual: 1
Trailing spaces
114: Expected: 0 or 2; Actual: 1
Trailing spaces
10: null
Multiple top-level headings in the same document
Path-based Instructions (2)
docs/tutorials/01-fee/03-scaffold-chain.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"docs/tutorials/01-fee/05-scaffold-react.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
Additional comments not posted (2)
docs/src/theme/CodeBlock/index.js (1)
4-16
: Ensure security by addingrel="noopener noreferrer"
to the anchor tag.- <a href={source} target="_blank">View Source</a> + <a href={source} target="_blank" rel="noopener noreferrer">View Source</a>Likely invalid or redundant comment.
docs/tutorials/01-fee/03-scaffold-chain.md (1)
27-31
: Ensure the updated versions of dependencies are correct and the source links are valid.Verification successful
The source links provided in the code snippet are valid and accessible. Now, let's verify the correctness of the
cosmos-sdk
version mentioned in the code snippet.
The latest release version of
cosmos-sdk
isv0.50.6
, but the tutorial usesv0.47.5
. This discrepancy might be intentional for compatibility reasons or to match the state of the project at a specific point in time. Let's verify ifv0.47.5
is a valid version and if it is appropriate for the tutorial context.
The version
v0.47.5
ofcosmos-sdk
is a valid release. The source links provided in the code snippet are also valid and accessible.
- The source links in the
CodeBlock
components are correct.- The
cosmos-sdk
versionv0.47.5
is a valid release and appropriate for the tutorial context.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the validity of the source links and the correctness of the dependency versions. # Test: Check the source links. curl -I https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/tree/88e2fa73c833523cba2122d4b2a41eb8e3b8d86e curl -I https://github.com/srdtrk/cosmoverse2023-ibc-fee-demo/tree/2e2c2a3b8e13fd5e23c3b59894438494af6fc32aLength of output: 9303
Script:
#!/bin/bash # Description: Verify the correctness of the `cosmos-sdk` version mentioned in the code snippet. # Test: Check the latest release version of `cosmos-sdk`. curl -s https://api.github.com/repos/cosmos/cosmos-sdk/releases/latest | jq -r .tag_nameLength of output: 98
Script:
#!/bin/bash # Description: Verify if `v0.47.5` is a valid version of `cosmos-sdk`. # Test: Check the list of all releases of `cosmos-sdk` and see if `v0.47.5` is included. curl -s https://api.github.com/repos/cosmos/cosmos-sdk/releases | jq -r '.[].tag_name' | grep '^v0.47.5$'Length of output: 115
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trusting you know what this does 🫡
Description
closes: #6372
Would be nice to switch to typescript at some point.
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.Summary by CodeRabbit
New Features
Documentation