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

feat: single page #1035

Merged
merged 26 commits into from Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8baa694
feat: single page
hugomrdias Jul 30, 2020
a0cf5d3
feat: spec state badges (#1036)
olizilla Jul 31, 2020
c6cb842
fix: fix link render hook for single layout
hugomrdias Jul 31, 2020
c4ff230
chore: update deps
hugomrdias Jul 31, 2020
2be47d7
fix: remove link shortcode
hugomrdias Jul 31, 2020
1f4dd65
fix: remove old shortcodes
hugomrdias Jul 31, 2020
aba0d34
Merge branch 'feat/single-page' of github.com:filecoin-project/specs …
hugomrdias Jul 31, 2020
666c175
Merge remote-tracking branch 'origin/beta' into feat/single-page
olizilla Aug 3, 2020
33d6a2a
Merge remote-tracking branch 'origin/beta' into feat/single-page
olizilla Aug 3, 2020
97b134c
chore: rationalise js init
olizilla Aug 4, 2020
b148960
chore: tweak headings
olizilla Aug 4, 2020
130470a
fix: numbering per heading element
olizilla Aug 5, 2020
2430058
fix: katex css and fonts
olizilla Aug 5, 2020
006584f
fix: dashboard links for single page
olizilla Aug 6, 2020
d8e61a5
Merge remote-tracking branch 'origin/beta' into feat/single-page
olizilla Aug 6, 2020
83966bc
fix: bitswap is a subheader
olizilla Aug 6, 2020
7b62e2f
fix: multiple layout improvements
olizilla Aug 6, 2020
9743257
feat: bring back old ToC behaviour
olizilla Aug 7, 2020
9e1fe94
chore: bring back appendix. fix glossary headings
olizilla Aug 10, 2020
cbc66f7
fix: toc rendering and content fixes
olizilla Aug 11, 2020
e48a4bf
chore: toc header and intro content header fixes
olizilla Aug 12, 2020
551e8e1
chore: fix header on small screens
olizilla Aug 12, 2020
627bb72
chore: fix status badge link
olizilla Aug 12, 2020
8c8d204
fix: id generation and linking
olizilla Aug 13, 2020
9cc3c79
chore: fix headings in interpreter doc
olizilla Aug 13, 2020
0c6c684
chore: fix headers in storage market
olizilla Aug 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 47 additions & 6 deletions assets/_custom.scss
Expand Up @@ -2,11 +2,12 @@

// Addons

// @import "plugins/numbered";
@import "plugins/numbered";
@import "plugins/scrollbars";
@import "table-sort";
@import "colors";
@import "dashboard";
@import "plugins/toc";

// SVG Diagrams
.diagrams-container {
Expand Down Expand Up @@ -91,13 +92,35 @@
#book-search-input:focus {
background: rgba(255,255,255,.2);
}

// Tweaks
html {
scroll-behavior: auto;
touch-action: auto;
}

summary {
outline: none;
}
blockquote {
overflow: auto;
}
.book-menu nav {
width: 16rem;
padding: 1rem;
background: #090909;
position: fixed;
top: 0;
bottom: 0;
overflow-x: initial;
overflow-y: hidden;
}

.book-menu nav .toc {
overflow-x: hidden;
overflow-y: auto;
height: 90%;
}

.markdown>h1:first-of-type {
margin-top: 0;
Expand Down Expand Up @@ -132,18 +155,18 @@ blockquote {
padding: 0;
height: 90vh;
}
.book-menu > nav::-webkit-scrollbar,
.book-menu > nav .toc::-webkit-scrollbar,
.book-toc > div nav::-webkit-scrollbar{
width: 8px;
}

.book-menu > nav::-webkit-scrollbar-thumb,
.book-menu > nav .toc::-webkit-scrollbar-thumb,
.book-toc > div nav::-webkit-scrollbar-thumb{
background: transparent;
}

.book-menu > nav:hover::-webkit-scrollbar-thumb,
.book-toc > div nav:hover::-webkit-scrollbar-thumb{
.book-menu > nav:hover .toc::-webkit-scrollbar-thumb,
.book-toc > div nav:hover .toc::-webkit-scrollbar-thumb{
background: rgba(255,255,255,.1);
}

Expand Down Expand Up @@ -380,4 +403,22 @@ i[class^="gg-"] {
box-shadow: 4px -6px 0,8px -12px 0;
border-radius: 4px;
background: currentColor
}
}

.state-badge {
font-size: 10px;
font-weight: 500;
}
.state-badge-link {
text-decoration: none !important;
color: white !important;
&:hover {
text-decoration: none;
}
}
.state-badge-key, .state-badge-value {
padding: 2px 5px;
}
.state-badge-key {
background-color: #555;
}
19 changes: 19 additions & 0 deletions assets/main.js
@@ -0,0 +1,19 @@
import toc from './toc/index.js'

const run = function() {
toc.init({
tocSelector: '.toc',
contentSelector: '.markdown',
headingSelector: 'h1, h2, h3, h4, h5, h6',
hasInnerContainers: false,
orderedList: true,
smoothScroll: false,
collapseDepth: 2,
headingLabelCallback: (label) => {
return label.replace('#', '')
},
headingsOffset: 50,
});
}

run()
2 changes: 1 addition & 1 deletion assets/plugins/_numbered.scss
Expand Up @@ -19,7 +19,7 @@ $endLevel: 6;
}
}

.book-toc nav ul {
.book-menu nav ol {
li {
counter-increment: item;

Expand Down
32 changes: 32 additions & 0 deletions assets/plugins/_toc.scss
@@ -0,0 +1,32 @@
.toc{overflow-y:auto}.toc>.toc-list{overflow:hidden;position:relative}.toc>.toc-list li{list-style:none}.toc-list{margin:0;padding-left:10px}a.toc-link{color:currentColor;height:100%}.is-collapsible{max-height:1000px;overflow:hidden;transition:all 300ms ease-in-out}.is-collapsed{max-height:0}.is-position-fixed{position:fixed !important;top:0}.is-active-link{font-weight:700}.toc-link::before{background-color:#EEE;content:' ';display:inline-block;height:inherit;left:0;margin-top:-1px;position:absolute;width:2px}.is-active-link::before{background-color:#54BC4B}


.toc-list li {
padding: 0 0;
line-height: 2;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
a.toc-link {
height: 100%;
}
a.is-active-link {
color: white;
line-height: 20px;
}
}

.toc .toc-list .is-active-link::before {
background-color: #0090ff
}

.toc .toc-link::before {
background-color: rgb(34, 36, 38);
content: ' ';
display: inline-block;
height: inherit;
left: 0;
margin-top: -1px;
position: absolute;
width: 2px
}