-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The book uses custom checkboxes in the quickstart chapter. When we moved the book to this repo (see #729), we dropped the theme. mdbook documentation suggest (see https://rust-lang.github.io/mdBook/format/theme/index.html) copying and patching the default theme. Since here it's such a small change, I added a small script that post-process the HTML instead.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,29 @@ | ||
#!/usr/bin/env sh | ||
|
||
# This file replaces `<strong>user-checkable</strong>` with actual | ||
# checkboxes and adds CSS to the generated HTML. | ||
|
||
for file in $(find . -name '*.html'); do | ||
sed -i 's|<strong>user-checkable</strong>|<input type="checkbox" class="user-checkable"/>|g' "$file" | ||
done | ||
|
||
for css in $(find . -name 'general.css'); do | ||
cat >> "$css" <<-EOF | ||
input.user-checkable { | ||
transform: scale(1.5); | ||
margin-right: 8px; | ||
margin-left: 8px; | ||
} | ||
ul:has(> li > .user-checkable) { | ||
list-style-type: none; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
li:has(> .user-checkable) { | ||
list-style-type: none; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
EOF | ||
done |