Compare commits
4 Commits
e4689268f2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 43492094bc | |||
| 0bed1d6976 | |||
| 63010da18d | |||
| a0affeb5c4 |
@@ -1,65 +1,78 @@
|
||||
:root {
|
||||
--color-text: black;
|
||||
--color-tag1: gray;
|
||||
--color-tag2: darkolivegreen;
|
||||
--color-bg: white;
|
||||
--color-notice: #fb4f4f;
|
||||
--color-link: #0645ad;
|
||||
--color-link-visited: #551a8b;
|
||||
--layout-max-width: 1350px;
|
||||
--mobile-max-width: 876px;
|
||||
--content-max-width: 800px;
|
||||
--toc-width: 33%;
|
||||
--toc-width-no-sidenotes: 18rem;
|
||||
}
|
||||
|
||||
html {
|
||||
scrollbar-gutter: stable;
|
||||
scroll-behavior: smooth;
|
||||
font-size: 110%;
|
||||
scroll-behavior: smooth;
|
||||
scrollbar-gutter: stable;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
||||
font-family:
|
||||
"Lato",
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
"PingFang SC",
|
||||
"Microsoft YaHei",
|
||||
sans-serif;
|
||||
font-optical-sizing: auto;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 1rem;
|
||||
line-height: 140%;
|
||||
line-height: 1.4;
|
||||
color: var(--color-text);
|
||||
background-color: var(--color-bg);
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
body a {
|
||||
a {
|
||||
color: var(--color-link);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
body a:visited {
|
||||
a:visited {
|
||||
color: var(--color-link-visited);
|
||||
}
|
||||
|
||||
body a[href^="#"]:visited {
|
||||
a[href^="#"]:visited {
|
||||
color: var(--color-link);
|
||||
}
|
||||
|
||||
body a:hover {
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
details {
|
||||
padding-left: 1em;
|
||||
border: 2px solid var(--color-text);
|
||||
}
|
||||
|
||||
summary:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*mathML*/
|
||||
.htmlmathparagraph, mtext,math {
|
||||
/* Math */
|
||||
.htmlmathparagraph,
|
||||
math,
|
||||
mtext {
|
||||
font-family: Lete Sans Math;
|
||||
}
|
||||
.math-container,
|
||||
#math-container {
|
||||
|
||||
#math-container,
|
||||
.math-container {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
padding: .5em;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.equation {
|
||||
@@ -67,7 +80,7 @@ summary:hover {
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
column-gap: 1em;
|
||||
margin: .5em 0;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
.equation .math-container {
|
||||
@@ -75,10 +88,11 @@ summary:hover {
|
||||
}
|
||||
|
||||
.equation-number {
|
||||
white-space: nowrap;
|
||||
font-style: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Text */
|
||||
.text-space .langtag {
|
||||
color: var(--color-tag1);
|
||||
}
|
||||
@@ -87,85 +101,69 @@ summary:hover {
|
||||
font-variant-caps: small-caps;
|
||||
}
|
||||
|
||||
.uri,
|
||||
a.url {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
html body div.text-space main ul.post-list {
|
||||
list-style-type: none;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
/* top bar */
|
||||
header {
|
||||
font-weight: 400;
|
||||
font-family: "IosevkaC", sans-serif;
|
||||
font-size: 2rem;
|
||||
text-decoration: none;
|
||||
line-height: 120%;
|
||||
}
|
||||
|
||||
.uri {
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.post-list {
|
||||
list-style: none;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
header {
|
||||
margin-top: 1rem;
|
||||
font-size: 2rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
footer {
|
||||
color: var(--color-text);
|
||||
font-size: 0.8rem;
|
||||
margin-top: 2em;
|
||||
text-align: right;
|
||||
padding-right: 1em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.pagetitle {
|
||||
font-size: 2rem;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
text-align: left;
|
||||
line-height: 100%;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 1.2rem;
|
||||
margin-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.draft-notice {
|
||||
color: var(--color-notice);
|
||||
margin: 1em auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
margin-top: 1em;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top: 1em;
|
||||
font-size: 1.44rem;
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-top: 1em;
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
font-style: normal
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 1em;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
font-style: normal
|
||||
}
|
||||
|
||||
article .header {
|
||||
font-size: 1rem;
|
||||
font-style: normal;
|
||||
color: var(--color-tag1);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
||||
.info,.info a {
|
||||
color: var(--color-tag2);
|
||||
font-size: 1rem;
|
||||
font-style: normal;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.info a:visited {
|
||||
color: var(--color-tag2);
|
||||
}
|
||||
|
||||
section.body {
|
||||
@@ -177,18 +175,17 @@ section.body {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/* table. copied from https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/table */
|
||||
/* Tables */
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border: 2px solid rgb(140 140 140);
|
||||
font-size: 0.8rem;
|
||||
letter-spacing: 1px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
caption {
|
||||
caption-side: bottom;
|
||||
padding: 10px;
|
||||
font-weight: bold;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
thead,
|
||||
@@ -215,161 +212,149 @@ tfoot th {
|
||||
}
|
||||
|
||||
tfoot td {
|
||||
font-weight: bold;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
/* Media */
|
||||
figure {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
padding: 5px;
|
||||
margin: auto;
|
||||
max-width: 80%;
|
||||
margin: auto;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.centerimg img {
|
||||
margin: 0 auto 0 auto;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
div.highlight,
|
||||
.highlight,
|
||||
pre code {
|
||||
display: block;
|
||||
margin: auto;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: "IosevkaC", monospace;
|
||||
margin: 0 auto;
|
||||
display: inline-block;
|
||||
padding: 0px 2px;
|
||||
margin: 0 auto;
|
||||
padding: 0 2px;
|
||||
border-radius: 2px;
|
||||
font-family: "IosevkaC", monospace;
|
||||
font-variant-ligatures: none;
|
||||
font-kerning: none;
|
||||
text-rendering: optimizeSpeed;
|
||||
}
|
||||
|
||||
|
||||
.draft-notice {
|
||||
color: var(--color-notice);
|
||||
margin: 1em auto;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
|
||||
.subtitle {
|
||||
text-align: left;
|
||||
font-size: 1.2rem;
|
||||
margin-top: 0
|
||||
}
|
||||
.gallery {
|
||||
margin-top: 2em;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.gallery img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* phones -- no sidebar no sidenotes*/
|
||||
@media (max-width: 768px) {
|
||||
body {
|
||||
/* width: 90%; */
|
||||
margin: auto;
|
||||
padding: 0 5%;
|
||||
text-align: left;
|
||||
max-width: 876px;
|
||||
}
|
||||
mjx-container[display="true"]
|
||||
/*, .katex-display */ {
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
/* .katex-display>.katex>.katex-html>.tag {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
padding-left: 10pt;
|
||||
} */
|
||||
}
|
||||
|
||||
/* Layout */
|
||||
.toc {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* sidebar. no sidenotes */
|
||||
@media (max-width: 768px) {
|
||||
body {
|
||||
max-width: var(--mobile-max-width);
|
||||
margin: auto;
|
||||
padding: 0 5%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
mjx-container[display="true"] {
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 769px) {
|
||||
body {
|
||||
max-width: 1350px;
|
||||
display: -webkit-flex;
|
||||
-webkit-flex-flow: row wrap;
|
||||
display: -ms-flexbox;
|
||||
-ms-flex-flow: row wrap;
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
width: 95%;
|
||||
padding-right: 5%;
|
||||
max-width: var(--layout-max-width);
|
||||
margin: auto;
|
||||
padding-right: 5%;
|
||||
}
|
||||
|
||||
.toc {
|
||||
display: block;
|
||||
width: var(--toc-width);
|
||||
margin-top: 5rem;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
width: 33%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
div#contents ul,
|
||||
div#contents-big ul {
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
#contents ul,
|
||||
#contents-big ul {
|
||||
list-style: none;
|
||||
margin: 0.5em 0;
|
||||
padding-left: 1em;
|
||||
line-height: 1.2;
|
||||
list-style-type: none;
|
||||
margin-left: 0
|
||||
}
|
||||
|
||||
div#contents-big li+li {
|
||||
margin-top: 0.5em
|
||||
#contents-big li + li {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
||||
div#contents-big .toc-section-number {
|
||||
#contents-big .toc-section-number {
|
||||
margin-right: 0.2em;
|
||||
}
|
||||
|
||||
div#contents-big {
|
||||
font-size: 80%;
|
||||
padding-top: 0;
|
||||
padding-left: 1rem;
|
||||
text-align: left;
|
||||
max-width: 60%;
|
||||
clear: both;
|
||||
margin-right: 4em;
|
||||
#contents-big {
|
||||
position: sticky;
|
||||
top: 5rem;
|
||||
left: 100%
|
||||
left: 100%;
|
||||
clear: both;
|
||||
max-width: 60%;
|
||||
margin-right: 4em;
|
||||
padding-left: 1rem;
|
||||
font-size: 80%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div#contents-big .mini-header {
|
||||
font-weight: bold;
|
||||
#contents-big .mini-header {
|
||||
margin: 0;
|
||||
font-variant: small-caps;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.text-space {
|
||||
display: inline-block;
|
||||
width: 66%;
|
||||
max-width: 800px;
|
||||
max-width: var(--content-max-width);
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
/* sidebar+sidenotes */
|
||||
|
||||
@media (min-width: 769px) and (max-width: 1199px) {
|
||||
.toc {
|
||||
flex: 0 0 var(--toc-width-no-sidenotes);
|
||||
width: var(--toc-width-no-sidenotes);
|
||||
}
|
||||
|
||||
#contents-big {
|
||||
max-width: none;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
|
||||
.text-space {
|
||||
flex: 1 1 0;
|
||||
width: auto;
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
body {
|
||||
width: 75%;
|
||||
@@ -378,7 +363,6 @@ code {
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
.no-print,
|
||||
.no-print * {
|
||||
display: none !important;
|
||||
|
||||
@@ -31,7 +31,7 @@ body {
|
||||
position: relative;
|
||||
text-align: left;
|
||||
}
|
||||
@media (max-width: 1200px) {
|
||||
@media (max-width: 1199px) {
|
||||
.sidenote,
|
||||
.marginnote,
|
||||
.marginnote-left {
|
||||
@@ -142,7 +142,7 @@ label.margin-toggle:not(.sidenote-number) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
@media (max-width: 1199px) {
|
||||
label.margin-toggle:not(.sidenote-number) {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
@@ -20,3 +20,4 @@
|
||||
\newcommand{\del}{\setminus}
|
||||
\newcommand{\con}{/}
|
||||
\newcommand{\minor}{\times}
|
||||
\newcommand{\FF}{\mathbb{F}}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
</div>
|
||||
<div class="text-space">
|
||||
<header class="no-print">
|
||||
<a href="/">/</a>
|
||||
$title$
|
||||
</header>
|
||||
<main role="main">
|
||||
|
||||
@@ -13,6 +13,7 @@ where
|
||||
|
||||
import Control.Monad (guard)
|
||||
import Control.Monad.State
|
||||
import qualified Control.Monad.State.Strict as Strict
|
||||
import Data.Char (isSpace)
|
||||
import Data.Either
|
||||
import Data.Functor
|
||||
@@ -105,7 +106,8 @@ incrementalBlock =
|
||||
"Proposition",
|
||||
"Corollary",
|
||||
"Observation",
|
||||
"Figure"
|
||||
"Figure",
|
||||
"Table"
|
||||
]
|
||||
|
||||
otherBlock :: [Text]
|
||||
@@ -221,7 +223,41 @@ autoref _ y = y
|
||||
autorefFilter :: Pandoc -> Pandoc
|
||||
autorefFilter x = walk (autoref links) x
|
||||
where
|
||||
links = query theoremIndex x
|
||||
links = query theoremIndex x ++ sectionIndex x
|
||||
|
||||
sectionIndex :: Pandoc -> [(Text, (Text, Text))]
|
||||
sectionIndex doc = snd $ Strict.execState (walkM collectSectionIndex doc) ([], [])
|
||||
|
||||
collectSectionIndex :: Block -> Strict.State ([Int], [(Text, (Text, Text))]) Block
|
||||
collectSectionIndex header@(Header level attr@(ident, _, _) _)
|
||||
| isNumberedSectionHeader attr = do
|
||||
(curNums, refs) <- Strict.get
|
||||
let nextNums = nextSectionNumbers level curNums
|
||||
refs'
|
||||
| isSectionIdentifier ident = (ident, ("Section", renderSectionNumber nextNums)) : refs
|
||||
| otherwise = refs
|
||||
Strict.put (nextNums, refs')
|
||||
pure header
|
||||
collectSectionIndex block = pure block
|
||||
|
||||
isNumberedSectionHeader :: Attr -> Bool
|
||||
isNumberedSectionHeader (_, classes, _) = "unnumbered" `notElem` classes
|
||||
|
||||
isSectionIdentifier :: Text -> Bool
|
||||
isSectionIdentifier = T.isPrefixOf "sec:"
|
||||
|
||||
nextSectionNumbers :: Int -> [Int] -> [Int]
|
||||
nextSectionNumbers level nums =
|
||||
reverse $ bumpLast $ reverse prefix
|
||||
where
|
||||
prefix = take level (nums ++ repeat 0)
|
||||
|
||||
bumpLast :: [Int] -> [Int]
|
||||
bumpLast [] = [1]
|
||||
bumpLast (x : xs) = (x + 1) : xs
|
||||
|
||||
renderSectionNumber :: [Int] -> Text
|
||||
renderSectionNumber = T.intercalate "." . map (pack . show)
|
||||
|
||||
equationFilter :: Pandoc -> Pandoc
|
||||
equationFilter doc = walk (equationAutoref links) processed
|
||||
|
||||
Reference in New Issue
Block a user