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

Feature/add tags #63

Merged
merged 7 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ assets_version = "2.1.0" # DO NOT EDIT: Managed by `mdbook-catppuccin install`

[output.html]
additional-css = ["./theme/catppuccin.css", "./theme/catppuccin-admonish.css", "./mdbook-admonish.css", "./theme/custom.css"]
additional-js = ["./theme/tagsindex.json"]
template-path = "theme"
copy-images = true
default-theme = "navy"
Expand Down
24 changes: 21 additions & 3 deletions serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ if ! test -e theme/index.hbs; then
echo "Run serve.sh inside root folder."
exit 1
fi
trap "sed -i 's|{{ path_to_root }}|/book/|g' theme/index.hbs" INT
sed -i 's|/book/|{{ path_to_root }}|g' theme/index.hbs
mdbook serve

# Function to perform sed operation in a cross-platform manner
cross_platform_sed() {
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS (BSD sed)
sed -i '' 's|/book/|{{ path_to_root }}|g' theme/index.hbs
else
# Linux and others (GNU sed)
sed -i 's|/book/|{{ path_to_root }}|g' theme/index.hbs
fi
}

# Set up trap for cleanup
trap "cross_platform_sed" INT

# Perform initial sed operation
cross_platform_sed

node theme/tags_generator.js

mdbook serve --watcher native
Loading
Loading