-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
96 additions
and
10 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
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,4 @@ | ||
[preprocessor.pagetoc] | ||
[output.html] | ||
additional-css = ["theme/pagetoc.css"] | ||
additional-js = ["theme/pagetoc.js"] |
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,12 @@ | ||
#!/bin/sh | ||
|
||
# This script is to be executed by `pnpm doc` after building the docs. | ||
|
||
# Inject another /contracts/ for github.com URLs. | ||
find sol/sapphire-contracts/book -name *.html | xargs sed -i -E "s+(blob/.*/contracts)+\1/contracts+" | ||
|
||
# Remove /src/ from "Inherits" links. | ||
find sol/sapphire-contracts/book -name *.html | xargs sed -i "s+/src/+/+" | ||
|
||
# Inject nicer Pagetoc theme (hides level-4 headings, smaller font, wider toc). | ||
cp theme/* sol/sapphire-contracts/book/theme |
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,58 @@ | ||
@media only screen and (max-width:1439px) { | ||
.sidetoc { | ||
display: none; | ||
} | ||
} | ||
|
||
@media only screen and (min-width:1440px) { | ||
main { | ||
position: relative; | ||
} | ||
.sidetoc { | ||
margin-left: auto; | ||
margin-right: auto; | ||
left: calc(100% + (var(--content-max-width))/4 - 140px); | ||
position: absolute; | ||
} | ||
.pagetoc { | ||
font-size: 12px; | ||
position: fixed; | ||
width: 220px; | ||
height: calc(100vh - var(--menu-bar-height) - 0.67em * 4); | ||
overflow: auto; | ||
} | ||
.pagetoc a { | ||
border-left: 1px solid var(--sidebar-bg); | ||
color: var(--fg) !important; | ||
display: block; | ||
padding-bottom: 5px; | ||
padding-top: 5px; | ||
padding-left: 10px; | ||
text-align: left; | ||
text-decoration: none; | ||
} | ||
.pagetoc a:hover, | ||
.pagetoc a.active { | ||
background: var(--sidebar-bg); | ||
color: var(--sidebar-fg) !important; | ||
} | ||
.pagetoc .active { | ||
background: var(--sidebar-bg); | ||
color: var(--sidebar-fg); | ||
} | ||
.pagetoc .pagetoc-H2 { | ||
padding-left: 20px; | ||
} | ||
.pagetoc .pagetoc-H3 { | ||
padding-left: 40px; | ||
} | ||
.pagetoc .pagetoc-H4 { | ||
display: none; | ||
} | ||
.pagetoc .pagetoc-H5 { | ||
display: none; | ||
} | ||
.pagetoc .pagetoc-H6 { | ||
display: none; | ||
} | ||
} |