-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: add build script to render katex and add favicon #121
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes introduce a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant build.sh
participant mdBook
User->>build.sh: Execute build script
build.sh->>build.sh: Set error handling
build.sh->>build.sh: Download mdBook and plugins
build.sh->>build.sh: Modify permissions
build.sh->>build.sh: Update PATH
build.sh->>build.sh: Set MDBOOK_PLUGIN_DIR
build.sh->>mdBook: Execute mdbook build
mdBook-->>build.sh: Build documentation
build.sh-->>User: Build complete
Poem
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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: 3
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files ignored due to path filters (1)
doc/theme/favicon.png
is excluded by!**/*.png
Files selected for processing (1)
- doc/build.sh (1 hunks)
Additional context used
Shellcheck
doc/build.sh
[warning] 15-15: Declare and assign separately to avoid masking return values.
(SC2155)
[warning] 15-15: Quote this to prevent word splitting.
(SC2046)
[info] 15-15: Double quote to prevent globbing and word splitting.
(SC2086)
[warning] 17-17: Declare and assign separately to avoid masking return values.
(SC2155)
[warning] 17-17: Quote this to prevent word splitting.
(SC2046)
|
||
export PATH=$(pwd):$PATH | ||
|
||
export MDBOOK_PLUGIN_DIR=$(pwd) |
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.
Quote variable expansion to prevent word splitting and globbing
In the export
command on line 17, the variable expansion $(pwd)
is not quoted. This can lead to word splitting or globbing issues if the directory path contains spaces or special characters.
Apply the following diff to fix this:
-export MDBOOK_PLUGIN_DIR=$(pwd)
+MDBOOK_PLUGIN_DIR="$(pwd)"
+export MDBOOK_PLUGIN_DIR
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export MDBOOK_PLUGIN_DIR=$(pwd) | |
MDBOOK_PLUGIN_DIR="$(pwd)" | |
export MDBOOK_PLUGIN_DIR |
Tools
Shellcheck
[warning] 17-17: Declare and assign separately to avoid masking return values.
(SC2155)
[warning] 17-17: Quote this to prevent word splitting.
(SC2046)
|
||
chmod +x mdbook mdbook-katex mdbook-mermaid | ||
|
||
export PATH=$(pwd):$PATH |
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.
Quote variable expansions to prevent word splitting and globbing
In the export
command on line 15, the variable expansions $(pwd)
and $PATH
are not quoted. This can lead to word splitting or globbing issues if any directories contain spaces or special characters.
Apply the following diff to fix this:
-export PATH=$(pwd):$PATH
+PATH="$(pwd):$PATH"
+export PATH
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export PATH=$(pwd):$PATH | |
PATH="$(pwd):$PATH" | |
export PATH |
Tools
Shellcheck
[warning] 15-15: Declare and assign separately to avoid masking return values.
(SC2155)
[warning] 15-15: Quote this to prevent word splitting.
(SC2046)
[info] 15-15: Double quote to prevent globbing and word splitting.
(SC2086)
curl -fSL -o mdbook.tar.gz https://github.com/rust-lang/mdBook/releases/download/v0.4.33/mdbook-v0.4.33-x86_64-unknown-linux-musl.tar.gz | ||
tar -xzf mdbook.tar.gz | ||
|
||
curl -fSL -o mdbook-katex.tar.gz https://github.com/lzanini/mdbook-katex/releases/download/v0.8.0/mdbook-katex-v0.8.0-x86_64-unknown-linux-musl.tar.gz | ||
tar -xzf mdbook-katex.tar.gz | ||
|
||
curl -fSL -o mdbook-mermaid.tar.gz https://github.com/badboy/mdbook-mermaid/releases/download/v0.14.0/mdbook-mermaid-v0.14.0-x86_64-unknown-linux-musl.tar.gz | ||
tar -xzf mdbook-mermaid.tar.gz |
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.
Consider removing downloaded archive files after extraction
After extracting the tar.gz files, the archives remain in the directory. Removing them can keep the workspace clean and prevent unnecessary clutter.
Update the script to remove the archives after extraction:
tar -xzf mdbook.tar.gz
+rm mdbook.tar.gz
tar -xzf mdbook-katex.tar.gz
+rm mdbook-katex.tar.gz
tar -xzf mdbook-mermaid.tar.gz
+rm mdbook-mermaid.tar.gz
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
curl -fSL -o mdbook.tar.gz https://github.com/rust-lang/mdBook/releases/download/v0.4.33/mdbook-v0.4.33-x86_64-unknown-linux-musl.tar.gz | |
tar -xzf mdbook.tar.gz | |
curl -fSL -o mdbook-katex.tar.gz https://github.com/lzanini/mdbook-katex/releases/download/v0.8.0/mdbook-katex-v0.8.0-x86_64-unknown-linux-musl.tar.gz | |
tar -xzf mdbook-katex.tar.gz | |
curl -fSL -o mdbook-mermaid.tar.gz https://github.com/badboy/mdbook-mermaid/releases/download/v0.14.0/mdbook-mermaid-v0.14.0-x86_64-unknown-linux-musl.tar.gz | |
tar -xzf mdbook-mermaid.tar.gz | |
curl -fSL -o mdbook.tar.gz https://github.com/rust-lang/mdBook/releases/download/v0.4.33/mdbook-v0.4.33-x86_64-unknown-linux-musl.tar.gz | |
tar -xzf mdbook.tar.gz | |
rm mdbook.tar.gz | |
curl -fSL -o mdbook-katex.tar.gz https://github.com/lzanini/mdbook-katex/releases/download/v0.8.0/mdbook-katex-v0.8.0-x86_64-unknown-linux-musl.tar.gz | |
tar -xzf mdbook-katex.tar.gz | |
rm mdbook-katex.tar.gz | |
curl -fSL -o mdbook-mermaid.tar.gz https://github.com/badboy/mdbook-mermaid/releases/download/v0.14.0/mdbook-mermaid-v0.14.0-x86_64-unknown-linux-musl.tar.gz | |
tar -xzf mdbook-mermaid.tar.gz | |
rm mdbook-mermaid.tar.gz |
Summary by CodeRabbit