Skip to content

Commit

Permalink
Add pagetoc to mdbook (#134)
Browse files Browse the repository at this point in the history
* Add toc to pages.

Useful for browsing the "Built ins" which have many functions.
  • Loading branch information
wmedrano authored Jan 14, 2024
1 parent 4b6fc95 commit 2e14129
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v4
Expand All @@ -18,8 +18,11 @@ jobs:
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
pagetoc_tag=$(curl 'https://api.github.com/repos/slowsage/mdbook-pagetoc/releases/latest' | jq -r '.tag_name')
pagetoc_url="https://github.com/slowsage/mdbook-pagetoc/releases/download/${pagetoc_tag}/mdbook-pagetoc-${pagetoc_tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
curl -sSL $pagetoc_url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Deploy GitHub Pages
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
**/*.rs.bk
/scratch
docs/book
docs/theme
.vscode/
/result
5 changes: 5 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ language = "en"
multilingual = false
src = "src"
title = "Steel"

[preprocessor.pagetoc]
[output.html]
additional-css = ["theme/pagetoc.css"]
additional-js = ["theme/pagetoc.js"]

0 comments on commit 2e14129

Please sign in to comment.