Skip to content

Commit cd762b3

Browse files
committed
fix: mdbook deploy by removing deprecated fields and fixing config
- Remove deprecated 'multilingual' field from book.toml - Remove deprecated 'copy-fonts' field from book.toml - Fix git-repository-icon: fa-github -> fab-github - Fix workflow to use ./book (not ./book/html) - Disable mdbook-linkcheck (incompatible with mdbook 0.5.x) - Add ensure_mermaid_assets() to mdbook.sh to generate JS files before build
1 parent 9fddbed commit cd762b3

3 files changed

Lines changed: 30 additions & 31 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Upload artifact
3838
uses: actions/upload-pages-artifact@v3
3939
with:
40-
path: ./book/html
40+
path: ./book
4141

4242
deploy:
4343
environment:

book.toml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[book]
22
authors = ["Ammar Bandukwala"]
33
language = "en"
4-
multilingual = false
54
src = "docs"
65
title = "httpjail"
76
description = "HTTP(S) Request Jailing: Control what your processes can request"
@@ -20,12 +19,11 @@ command = "mdbook-mermaid"
2019
default-theme = "rust"
2120
preferred-dark-theme = "navy"
2221
git-repository-url = "https://github.com/coder/httpjail"
23-
git-repository-icon = "fa-github"
22+
git-repository-icon = "fab-github"
2423
edit-url-template = "https://github.com/coder/httpjail/edit/main/{path}"
2524
site-url = "https://coder.github.io/httpjail/"
2625
cname = ""
2726
mathjax-support = false
28-
copy-fonts = true
2927
additional-css = ["docs/custom.css"]
3028
additional-js = ["mermaid.min.js", "mermaid-init.js"]
3129
no-section-label = false
@@ -49,12 +47,9 @@ heading-split-level = 3
4947

5048
[output.html.redirect]
5149

52-
[output.linkcheck]
53-
# Optional: Only check internal links (faster builds)
54-
follow-web-links = false
55-
# Optional: Allow links outside book root
56-
traverse-parent-directories = false
57-
# Optional: Exclude patterns (regex)
58-
exclude = [ "^https://crates\\.io", "^https://docs\\.rs" ]
59-
# Optional: HTTP request configuration
60-
warning-policy = "warn"
50+
# Disabled: mdbook-linkcheck 0.7.7 is incompatible with mdbook 0.5.x
51+
# [output.linkcheck]
52+
# follow-web-links = false
53+
# traverse-parent-directories = false
54+
# exclude = [ "^https://crates\\.io", "^https://docs\\.rs" ]
55+
# warning-policy = "warn"

scripts/mdbook.sh

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,35 +65,39 @@ ensure_mdbook_mermaid() {
6565
exit 1
6666
fi
6767

68-
# Initialize mermaid support in the book
69-
cd "${PROJECT_ROOT}"
70-
mdbook-mermaid install .
7168
}
7269

73-
# Install mdbook-linkcheck if not present
74-
ensure_mdbook_linkcheck() {
75-
if command_exists mdbook-linkcheck; then
76-
log_info "mdbook-linkcheck is already installed ($(mdbook-linkcheck --version 2>&1 | head -1 || echo 'unknown version'))"
77-
return 0
78-
fi
79-
80-
log_warn "mdbook-linkcheck not found, installing..."
81-
82-
if command_exists cargo; then
83-
cargo install mdbook-linkcheck --locked
84-
else
85-
log_error "cargo not found. Please install Rust toolchain first: https://rustup.rs/"
86-
exit 1
70+
# Ensure mermaid assets (JS files) are present
71+
ensure_mermaid_assets() {
72+
cd "${PROJECT_ROOT}"
73+
if [ ! -f "mermaid.min.js" ] || [ ! -f "mermaid-init.js" ]; then
74+
log_info "Installing mermaid assets..."
75+
mdbook-mermaid install .
8776
fi
8877
}
8978

79+
# Disabled: mdbook-linkcheck 0.7.7 is incompatible with mdbook 0.5.x
80+
# ensure_mdbook_linkcheck() {
81+
# if command_exists mdbook-linkcheck; then
82+
# log_info "mdbook-linkcheck is already installed"
83+
# return 0
84+
# fi
85+
# log_warn "mdbook-linkcheck not found, installing..."
86+
# if command_exists cargo; then
87+
# cargo install mdbook-linkcheck --locked
88+
# else
89+
# log_error "cargo not found"
90+
# exit 1
91+
# fi
92+
# }
93+
9094
# Main installation check
9195
main() {
9296
log_info "Checking mdbook prerequisites..."
9397

9498
ensure_mdbook
9599
ensure_mdbook_mermaid
96-
ensure_mdbook_linkcheck
100+
ensure_mermaid_assets
97101

98102
log_info "All prerequisites satisfied"
99103

0 commit comments

Comments
 (0)