Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions new-docs/pyret-docs.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,21 @@
(define (append-gen-docs . desc)
"")

(define (section-number-css here-html)
(define p (page-section-prefix here-html))
(if (not p)
""
(let ([pd (string-append p ".")])
(string-append
".container { counter-reset: h2c 0; }\n"
".container h1::before { content: \"" p " \"; }\n"
".container h2 { counter-increment: h2c; counter-reset: h3c 0; }\n"
".container h2::before { content: \"" pd "\" counter(h2c) \" \"; }\n"
".container h3 { counter-increment: h3c; counter-reset: h4c 0; }\n"
".container h3::before { content: \"" pd "\" counter(h2c) \".\" counter(h3c) \" \"; }\n"
".container h4 { counter-increment: h4c; }\n"
".container h4::before { content: \"" pd "\" counter(h2c) \".\" counter(h3c) \".\" counter(h4c) \" \"; }\n"))))

(define (add-paras info)
; (printf "### add-paras ~s\n" info)
; (printf "### first info = ~s\n" (car info))
Expand Down
256 changes: 233 additions & 23 deletions new-docs/styles.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* CSS used by the Pollenized Pyret docs */

li.indent2 {
text-indent: 2em;
}
Expand All @@ -17,18 +15,15 @@ ul.toclist {
}

.pyretexpr {
/* color: cornflowerblue; */
}

.uncolored-code {
color: unset;
}

.pyret-display {
/* border-top: 0.055em solid black; */
border-top: 1px solid #99b;
font-style: monospace;
/* background-color: #f2f2f2; */
background-color: hsl(216, 78%, 95%);
}

Expand All @@ -37,9 +32,6 @@ ul.toclist {
}

.function {
/* font-family: monospace; */
/* background-color: #6bccdf; */
/* background-color: #ffeeee; */
}

.good-ex {
Expand All @@ -51,7 +43,6 @@ ul.toclist {
}

.margin-note {
/* background-color: #fbfb88; */
background-color: hsl(60, 29%, 94%);
float: right;
width: 25%;
Expand Down Expand Up @@ -150,7 +141,6 @@ ul.glossary {
list-style-type: none;
}


.repl-example {
margin-left: 1.5em;
background-color: hsl(0,0%,95%);
Expand Down Expand Up @@ -195,15 +185,176 @@ ul.glossary {
display: inline-block;
}

:root {
--primary-50: #317CCF;
--bg-grey: #f8f8f8;
}

.page-body {
display: flex;
}

.sidebar {
display: flex;
width: 300px;
flex-shrink: 0;
padding: 24px;
flex-direction: column;
align-items: flex-start;
position: sticky;
top: 90px;
height: calc(100vh - 90px);
overflow-y: auto;
border-right: 1px solid #ddd;
box-sizing: border-box;
background-color: var(--bg-grey);
}

.sidebar-nav {
width: 100%;
}

.sidebar-list {
list-style: none;
padding: 0;
margin: 0;
width: 100%;
}

.sidebar-item.has-children > .sidebar-list {
display: none;
}

.sidebar-item.has-children.open > .sidebar-list {
display: block;
}

.sidebar-item {
width: 100%;
}

.sidebar-item-row {
display: flex;
align-items: center;
min-height: 40px;
padding: 8px 16px;
border-left: 2px solid #E8E8E8;
box-sizing: border-box;
width: 100%;
gap: 10px;
cursor: pointer;
}

.sidebar-nav > .sidebar-list > .sidebar-item > .sidebar-item-row {
border-left: none;
}

.sidebar-item-row.active {
border-left-color: var(--primary-50);
}

.sidebar-item-row:hover .sidebar-link {
color: #888;
}

.sidebar-section-heading .sidebar-link {
font-weight: 500;
}

.sidebar-list .sidebar-list > .sidebar-item > .sidebar-item-row .sidebar-link {
font-weight: 400;
font-size: 16px;
}

.sidebar-list .sidebar-list .sidebar-list > .sidebar-item > .sidebar-item-row .sidebar-link {
font-size: 14px;
font-family: Roboto, sans-serif;
color: #000;
}

.sidebar-list .sidebar-list {
width: auto;
margin-right: 16px;
}

.sidebar-nav > .sidebar-list > .sidebar-item > .sidebar-list {
margin-left: 16px;
}

.sidebar-list .sidebar-list > .sidebar-item > .sidebar-item-row {
padding-left: 12px;
}

.sidebar-list .sidebar-list .sidebar-list > .sidebar-item > .sidebar-item-row {
padding-left: 24px;
}

.sidebar-link {
flex: 1;
text-decoration: none;
color: #040506;
font-family: Roboto, sans-serif;
font-size: 16px;
font-weight: 400;
line-height: 150%;
user-select: none;
}

.sidebar-item-row.active .sidebar-link {
color: var(--primary-50);
}

.sidebar-item-row .sidebar-link.clicking,
.sidebar-item-row:hover .sidebar-link.clicking {
color: var(--primary-50);
}

.sidebar-item-row:has(.sidebar-link.clicking) {
border-left-color: var(--primary-50);
}

.sidebar-chevron {
background: none;
border: none;
padding: 0 4px;
cursor: pointer;
display: flex;
align-items: center;
color: #666;
flex-shrink: 0;
}

.sidebar-chevron-icon {
font-size: 24px;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
line-height: 1;
user-select: none;
display: inline-block;
transform: rotate(90deg);
transition: transform 0.15s ease;
}

.sidebar-item.has-children.open > .sidebar-item-row .sidebar-chevron .sidebar-chevron-icon {
transform: rotate(-90deg);
}

.sidebar-list .sidebar-list > .sidebar-item > .sidebar-item-row .sidebar-chevron .sidebar-chevron-icon {
font-size: 15px;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 15;
}

.sidebar-item-row.active .sidebar-chevron {
color: var(--primary-50);
}

.container {
width: 100%;
min-width: 0;
padding: 24px 0 0 24px;
box-sizing: border-box;
}

@media (min-width: 800px) {
.container {
max-width: 72ch;
margin: 0 auto;
}
h1,h2,h3,h4,h5,h6 {
margin-left: -1em;
}
Expand Down Expand Up @@ -246,7 +397,7 @@ h3 {
font-size: 20px;
}

h4 {
h4 {
margin-top: 1em;
font-size: 20px;
}
Expand All @@ -263,16 +414,75 @@ h4 {
display: none;
}

.topbar {
position: sticky;
top: 0;
z-index: 100;
background-color: #fff;
border-bottom: 1px solid #ddd;
height: 90px;
padding: 24px 60px 24px 0;
display: flex;
align-items: center;
}

.topbar-logo {
margin-left: 24px;
height: 42px;
width: auto;
}

.searchform {
display: flex;
padding: 12px;
justify-content: center;
align-items: center;
gap: 10px;
width: 526px;
border-radius: 4px;
border: 1px solid #D8D8D8;
background: #FFF;
margin-left: 70px;
}

.search-icon {
font-size: 24px;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
flex-shrink: 0;
color: #666;
line-height: 1;
user-select: none;
}

.searchbox {
width: 16em;
margin-top: 1em;
margin-left: 1em;
padding: 0px;
background-color: #eee;
border: 1px solid #ddd;
vertical-align: middle;
flex: 1;
height: 24px;
border: none;
outline: none;
background: transparent;
font-size: 14px;
color: #333;
padding: 0;
}

.searchbox::placeholder {
text-align: center;
color: #999;
}

.topbar-links {
display: flex;
align-items: center;
gap: 16px;
margin-left: auto;
}

.topbar-link {
text-decoration: none;
color: #040506;
white-space: nowrap;
font-family: Roboto, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 150%;
}
Loading