mirror of
http://101.35.51.105:3000/congyu/Hakysidian.git
synced 2026-04-28 05:50:49 +08:00
Compare commits
13 Commits
614de591ba
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f0d36015b | |||
| 3a3fd97055 | |||
| aa05d73c9c | |||
| 3652459503 | |||
| fc4cac00d5 | |||
| 55719f3444 | |||
| d4629ec8e7 | |||
| e419366615 | |||
| 6c59abb9cc | |||
| 6a3b4c5f88 | |||
| 720a19e24d | |||
| 1789c75f18 | |||
| 3d2c5a8852 |
+22
-8
@@ -11,22 +11,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.theorem-header .index:before {
|
.theorem-header .index:before {
|
||||||
content: ' ';
|
content: " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
.theorem-header .name:before {
|
.theorem-header .name:before {
|
||||||
content: ' (';
|
content: " (";
|
||||||
}
|
}
|
||||||
|
|
||||||
.theorem-header .name:after {
|
.theorem-header .name:after {
|
||||||
content: ')';
|
content: ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
.theorem-header:after {
|
.theorem-header:after {
|
||||||
content: '.\2002\2002';
|
content: ".\2002\2002";
|
||||||
}
|
}
|
||||||
|
|
||||||
.theorem-header+p {
|
.theorem-header + p {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,17 +36,31 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.Proof {
|
.Proof {
|
||||||
|
background: none;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Proof:after {
|
.Proof:after {
|
||||||
content: '∎';
|
content: "∎";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Proof span.theorem-header span.name {
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Proof span.theorem-header span.name:before {
|
||||||
|
content: " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
.Proof span.theorem-header span.name:after {
|
||||||
|
content: " ";
|
||||||
|
}
|
||||||
|
|
||||||
table.postindex {
|
table.postindex {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -65,7 +79,7 @@ table.postindex td.right {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.header-section-number:after {
|
.header-section-number:after {
|
||||||
content: '.';
|
content: ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
.csl-entry {
|
.csl-entry {
|
||||||
@@ -84,6 +98,6 @@ table.postindex td.right {
|
|||||||
.csl-right-inline {
|
.csl-right-inline {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
}
|
}
|
||||||
.csl-right-inline a{
|
.csl-right-inline a {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
+66
-133
@@ -3,10 +3,7 @@
|
|||||||
--color-tag1: gray;
|
--color-tag1: gray;
|
||||||
--color-tag2: darkolivegreen;
|
--color-tag2: darkolivegreen;
|
||||||
--color-bg: white;
|
--color-bg: white;
|
||||||
--color-link: #337ab7;
|
--color-link: #0000ee;
|
||||||
--color-linkhbg: #e6f0ff;
|
|
||||||
--color-linkh: #002266;
|
|
||||||
--color-bq: olivedrab;
|
|
||||||
--color-notice: #fb4f4f;
|
--color-notice: #fb4f4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,11 +16,18 @@
|
|||||||
|
|
||||||
html {
|
html {
|
||||||
scrollbar-gutter: stable;
|
scrollbar-gutter: stable;
|
||||||
|
scroll-behavior: smooth;
|
||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
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-optical-sizing: auto;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -32,30 +36,28 @@ body {
|
|||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
background-color: var(--color-bg);
|
background-color: var(--color-bg);
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
}
|
text-autospace: no-autospace; /*using pangu.hs*/
|
||||||
body.lang-zh {
|
|
||||||
text-align: left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body a {
|
body a {
|
||||||
color: var(--color-link);
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-space a:hover {
|
body a:hover {
|
||||||
background-color: var(--color-linkhbg);
|
text-decoration: underline;
|
||||||
color: var(--color-linkh);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
}
|
||||||
details {
|
details {
|
||||||
background-color: var(--color-linkhbg);
|
padding-left: 1em;
|
||||||
|
border: 2px solid var(--color-text);
|
||||||
}
|
}
|
||||||
summary:hover {
|
summary:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*mathML*/
|
/*mathML*/
|
||||||
.htmlmathparagraph, mtext,math {
|
.htmlmathparagraph,
|
||||||
|
mtext,
|
||||||
|
math {
|
||||||
font-family: Lete Sans Math;
|
font-family: Lete Sans Math;
|
||||||
}
|
}
|
||||||
.math-container,
|
.math-container,
|
||||||
@@ -63,7 +65,7 @@ summary:hover {
|
|||||||
display: block;
|
display: block;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
padding: .5em;
|
padding: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.math-container.math-container-tagged {
|
.math-container.math-container-tagged {
|
||||||
@@ -72,7 +74,7 @@ summary:hover {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
column-gap: 1rem;
|
column-gap: 1rem;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
padding: .5em 0;
|
padding: 0.5em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.math-container.math-container-tagged .math-tag-spacer {
|
.math-container.math-container-tagged .math-tag-spacer {
|
||||||
@@ -83,7 +85,7 @@ summary:hover {
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
padding: .5em 0;
|
padding: 0.5em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.math-container.math-container-tagged .math-tag {
|
.math-container.math-container-tagged .math-tag {
|
||||||
@@ -104,66 +106,32 @@ summary:hover {
|
|||||||
font-variant-caps: small-caps;
|
font-variant-caps: small-caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
|
||||||
hyphens: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.url {
|
a.url {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html body div.text-space main ul.post-list {
|
||||||
|
list-style-type: none;
|
||||||
|
padding-left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* top bar */
|
||||||
header {
|
header {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-family: "IosevkaC", sans-serif;
|
font-family: "IosevkaC", sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* top bar*/
|
|
||||||
.navbar {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navright a {
|
|
||||||
margin: 0 0 0 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Links inside the navbar */
|
|
||||||
.navbar a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: var(--color-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar a:visited {
|
|
||||||
color: var(--color-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
nav {
|
|
||||||
text-align: right;
|
|
||||||
border-bottom: solid 1px var(--color-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
nav a {
|
nav a {
|
||||||
font-size: 1.2rem;
|
|
||||||
/*margin-left: 0.5em;*/
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uri {
|
.uri {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
/* Legacy support */
|
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
/* Modern property */
|
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
/* Break long words if necessary */
|
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
/* Allow wrapping */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
@@ -172,15 +140,6 @@ footer {
|
|||||||
padding-right: 1em;
|
padding-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6 {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pagetitle {
|
.pagetitle {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@@ -194,22 +153,20 @@ h1 {
|
|||||||
font-size: 1.44rem;
|
font-size: 1.44rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
text-align: left;
|
|
||||||
line-height: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-style: normal
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-style: normal
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
article .header {
|
article .header {
|
||||||
@@ -219,14 +176,7 @@ article .header {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info,
|
||||||
.info {
|
|
||||||
color: var(--color-tag2);
|
|
||||||
font-size: 1rem;
|
|
||||||
font-style: normal;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info a {
|
.info a {
|
||||||
color: var(--color-tag2);
|
color: var(--color-tag2);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
@@ -247,47 +197,45 @@ section.body {
|
|||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote {
|
/* table. copied from https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/table */
|
||||||
margin: 1rem 0;
|
table {
|
||||||
padding: 0 0 0 1.5em;
|
border-collapse: collapse;
|
||||||
border-left: 3px solid var(--color-bq);
|
border: 2px solid rgb(140 140 140);
|
||||||
|
font-size: 0.8rem;
|
||||||
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote p {
|
caption {
|
||||||
margin: 0;
|
caption-side: bottom;
|
||||||
|
padding: 10px;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
ol {
|
thead,
|
||||||
padding-left: 2em;
|
tfoot {
|
||||||
}
|
background-color: rgb(228 240 245);
|
||||||
ul {
|
|
||||||
list-style-type: square;
|
|
||||||
padding-left: 2em;
|
|
||||||
}
|
|
||||||
.notes-list {
|
|
||||||
list-style: none;
|
|
||||||
padding-left: 0;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
.notes-list li {
|
|
||||||
position: relative;
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
|
||||||
.notes-list li::before {
|
|
||||||
content: "-";
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
li {
|
|
||||||
margin-bottom: 0.15em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table,
|
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
border: 1px solid darkolivegreen;
|
border: 1px solid rgb(160 160 160);
|
||||||
border-collapse: collapse;
|
padding: 8px 10px;
|
||||||
text-align: left;
|
}
|
||||||
|
|
||||||
|
td:last-of-type {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody > tr:nth-of-type(even) {
|
||||||
|
background-color: rgb(237 238 242);
|
||||||
|
}
|
||||||
|
|
||||||
|
tfoot th {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
tfoot td {
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
figure {
|
figure {
|
||||||
@@ -298,23 +246,11 @@ figure {
|
|||||||
max-width: 80%;
|
max-width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
figcaption {
|
|
||||||
/* font: italic smaller sans-serif; */
|
|
||||||
padding: 3px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
display: none
|
|
||||||
}
|
|
||||||
|
|
||||||
.centerimg img {
|
.centerimg img {
|
||||||
margin: 0 auto 0 auto;
|
margin: 0 auto 0 auto;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
div.highlight,
|
div.highlight,
|
||||||
pre code {
|
pre code {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@@ -334,18 +270,16 @@ code {
|
|||||||
text-rendering: optimizeSpeed;
|
text-rendering: optimizeSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.draft-notice {
|
.draft-notice {
|
||||||
color: var(--color-notice);
|
color: var(--color-notice);
|
||||||
margin: 1em auto;
|
margin: 1em auto;
|
||||||
text-align: center
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.subtitle {
|
.subtitle {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
margin-top: 0
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
.gallery {
|
.gallery {
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
@@ -415,7 +349,7 @@ code {
|
|||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
list-style-type: decimal;
|
list-style-type: decimal;
|
||||||
margin-left: 0
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#contents ul.notes-list,
|
div#contents ul.notes-list,
|
||||||
@@ -428,8 +362,8 @@ code {
|
|||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#contents-big li+li {
|
div#contents-big li + li {
|
||||||
margin-top: 0.5em
|
margin-top: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#contents-big {
|
div#contents-big {
|
||||||
@@ -442,7 +376,7 @@ code {
|
|||||||
margin-right: 4em;
|
margin-right: 4em;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 5rem;
|
top: 5rem;
|
||||||
left: 100%
|
left: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#contents-big .mini-header {
|
div#contents-big .mini-header {
|
||||||
@@ -466,7 +400,6 @@ code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
|
|
||||||
.no-print,
|
.no-print,
|
||||||
.no-print * {
|
.no-print * {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/* fonts */
|
/* fonts */
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
name: hakyll-blog
|
cabal-version: 2.4
|
||||||
|
name: hakysidian
|
||||||
version: 0.1.0.0
|
version: 0.1.0.0
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
cabal-version: >= 1.10
|
|
||||||
|
|
||||||
|
data-files:
|
||||||
|
bib_style.csl
|
||||||
|
favicon.ico
|
||||||
|
css/*.css
|
||||||
|
fonts/*.otf
|
||||||
|
fonts/*.ttf
|
||||||
|
fonts/*.woff2
|
||||||
|
templates/*.html
|
||||||
|
|
||||||
executable site
|
executable hakysidian
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
main-is: site.hs
|
main-is: site.hs
|
||||||
other-modules: ChaoDoc, SideNoteHTML, Pangu
|
other-modules: ChaoDoc, SideNoteHTML, Pangu, Paths_hakysidian
|
||||||
|
autogen-modules: Paths_hakysidian
|
||||||
build-depends: base >= 4.18
|
build-depends: base >= 4.18
|
||||||
, hakyll >= 4.15
|
, hakyll >= 4.15
|
||||||
, mtl >= 2.2.2
|
, mtl >= 2.2.2
|
||||||
@@ -20,7 +29,13 @@ executable site
|
|||||||
-- , process
|
-- , process
|
||||||
-- , regex-compat
|
-- , regex-compat
|
||||||
, array
|
, array
|
||||||
|
, directory
|
||||||
, filepath
|
, filepath
|
||||||
|
, process
|
||||||
|
, time
|
||||||
|
, unix
|
||||||
|
, wai-app-static
|
||||||
|
, warp
|
||||||
-- , ghc-syntax-highlighter
|
-- , ghc-syntax-highlighter
|
||||||
-- , blaze-html >= 0.9
|
-- , blaze-html >= 0.9
|
||||||
, megaparsec
|
, megaparsec
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
COMMANDS := build watch rebuild clean
|
COMMANDS := build watch rebuild clean
|
||||||
|
BIN := hakysidian
|
||||||
.PHONY: $(COMMANDS), publish
|
.PHONY: $(COMMANDS), publish
|
||||||
|
|
||||||
# Set the default goal, so running 'make' without arguments will run 'make build'.
|
# Set the default goal, so running 'make' without arguments will run 'make build'.
|
||||||
@@ -7,18 +8,18 @@ COMMANDS := build watch rebuild clean
|
|||||||
|
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
$(COMMANDS): site
|
$(COMMANDS): $(BIN)
|
||||||
@echo "Running command: ./site $@"
|
@echo "Running command: ./$(BIN) $@"
|
||||||
-@./site $@
|
-@./$(BIN) $@
|
||||||
|
|
||||||
|
|
||||||
# --- Rules ---
|
# --- Rules ---
|
||||||
# using relative symlinks should be fine since everything only works at ./
|
# using relative symlinks should be fine since everything only works at ./
|
||||||
|
|
||||||
|
|
||||||
site: src/site.hs src/ChaoDoc.hs
|
$(BIN): src/site.hs src/ChaoDoc.hs
|
||||||
cabal build
|
cabal build exe:hakysidian
|
||||||
ln -sf "$(shell cabal list-bin exe:site)" site
|
ln -sf "$(shell cabal list-bin exe:hakysidian)" $(BIN)
|
||||||
|
|
||||||
# move from katex to mathjax
|
# move from katex to mathjax
|
||||||
# katex_cli:
|
# katex_cli:
|
||||||
|
|||||||
@@ -1,6 +1,130 @@
|
|||||||
things don't work:
|
|
||||||
|
|
||||||
1. equation labels & paragraph labels
|
# Drawbacks
|
||||||
2. pandoc does not support mathtools: <https://github.com/jgm/texmath/issues/249>
|
|
||||||
3. cross document refs
|
- currently all shared files (css, templates, csl files...) are stored in `~/.cabal/store/`. there will be a copy for every compile
|
||||||
4.
|
- web preview needs a port. if you don't set port manually, you cannot preview two projects at the same time.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--------
|
||||||
|
|
||||||
|
|
||||||
|
# hakysidian
|
||||||
|
|
||||||
|
`hakysidian` is a static site generator for note projects.
|
||||||
|
|
||||||
|
It is built on Hakyll, but packaged as a reusable CLI so you can run the same site generator across multiple note repositories without copying shared assets around. The executable bundles its shared `css/`, `fonts/`, `templates/`, `favicon.ico`, and `bib_style.csl` files with Cabal, then reads project-specific content from the current working directory.
|
||||||
|
|
||||||
|
## What It Expects
|
||||||
|
|
||||||
|
Run `hakysidian` inside a project directory with this layout:
|
||||||
|
|
||||||
|
```text
|
||||||
|
your-project/
|
||||||
|
├── notes/
|
||||||
|
│ ├── first-note.md
|
||||||
|
│ └── another-note.md
|
||||||
|
├── reference.bib
|
||||||
|
├── math-macros.md
|
||||||
|
└── images/ # optional
|
||||||
|
```
|
||||||
|
|
||||||
|
Required inputs:
|
||||||
|
|
||||||
|
- `notes/`: markdown notes to compile.
|
||||||
|
- `reference.bib`: bibliography used by Pandoc citeproc.
|
||||||
|
- `math-macros.md`: math macro definitions prepended before note parsing.
|
||||||
|
|
||||||
|
Optional inputs:
|
||||||
|
|
||||||
|
- `images/`: copied into the generated site as-is.
|
||||||
|
|
||||||
|
Shared assets are not required in each project. They come from the installed `hakysidian` package.
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
By default, `hakysidian` writes:
|
||||||
|
|
||||||
|
- `_site/`: generated site output.
|
||||||
|
- `_cache/`: Hakyll cache and temporary files.
|
||||||
|
|
||||||
|
Note pages use clean URLs. For example:
|
||||||
|
|
||||||
|
```text
|
||||||
|
notes/graph.md -> _site/notes/graph/index.html
|
||||||
|
```
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
From this repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cabal build exe:hakysidian
|
||||||
|
cabal install exe:hakysidian
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
The default CLI mirrors the common Hakyll workflow:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hakysidian build
|
||||||
|
hakysidian clean
|
||||||
|
hakysidian rebuild
|
||||||
|
hakysidian watch
|
||||||
|
```
|
||||||
|
|
||||||
|
`watch` also supports:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hakysidian watch --host 127.0.0.1 --port 8000
|
||||||
|
hakysidian watch --no-server
|
||||||
|
```
|
||||||
|
|
||||||
|
The dashboard is now an explicit TUI mode:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hakysidian -tui
|
||||||
|
hakysidian -tui --host 127.0.0.1 --port 8000
|
||||||
|
hakysidian -tui --no-server
|
||||||
|
```
|
||||||
|
|
||||||
|
What each command does:
|
||||||
|
|
||||||
|
- `build`: incremental site build.
|
||||||
|
- `clean`: removes generated output and cache.
|
||||||
|
- `rebuild`: clears output/cache and builds from scratch.
|
||||||
|
- `watch`: runs Hakyll's normal watch workflow, prints build logs directly to the terminal, and rebuilds automatically on change.
|
||||||
|
- `-tui`: starts the interactive dashboard with explicit controls for watching and cleaning.
|
||||||
|
|
||||||
|
## Watch And TUI
|
||||||
|
|
||||||
|
Both `watch` and `-tui` work against the same project inputs:
|
||||||
|
|
||||||
|
- `notes/**`
|
||||||
|
- `reference.bib`
|
||||||
|
- `math-macros.md`
|
||||||
|
- `images/**`
|
||||||
|
|
||||||
|
Normal `watch` behaves like a standard Hakyll watch command: it stays in the terminal, rebuilds when inputs change, and can start a preview server unless `--no-server` is passed.
|
||||||
|
|
||||||
|
`-tui` uses an alternate-screen dashboard that:
|
||||||
|
|
||||||
|
- uses the terminal’s current size to keep the dashboard within the visible screen,
|
||||||
|
- keeps recent build output in a bounded activity pane,
|
||||||
|
- can start a local preview server unless `--no-server` is passed,
|
||||||
|
- supports `w` to start watching, `s` to stop watching, `c` to clean, and `q` to quit.
|
||||||
|
|
||||||
|
The TUI requires an interactive terminal.
|
||||||
|
|
||||||
|
## Notes Format
|
||||||
|
|
||||||
|
This generator is opinionated toward the current note pipeline in this repository:
|
||||||
|
|
||||||
|
- Markdown is parsed with Pandoc and custom theorem/callout handling.
|
||||||
|
- math is rendered with MathML. looks good in firefox
|
||||||
|
- sidenotes are supported
|
||||||
|
- spacing between CJK chars and ascii is automatically handled by a filter.
|
||||||
|
- Citations are processed through `reference.bib` and the bundled `bib_style.csl`.
|
||||||
|
- `math-macros.md` is injected before parsing so note content and theorem titles can use the same macros.
|
||||||
|
- Notes are rendered with the bundled templates and stylesheet set.
|
||||||
|
|||||||
+20
-33
@@ -124,9 +124,9 @@ preprocessTheorems (Div attr xs)
|
|||||||
attr' = addAttr attr "type" theoremType
|
attr' = addAttr attr "type" theoremType
|
||||||
preprocessTheorems x = return x
|
preprocessTheorems x = return x
|
||||||
|
|
||||||
theoremFilter :: Pandoc -> Pandoc
|
theoremFilter :: Text -> Pandoc -> Pandoc
|
||||||
theoremFilter doc =
|
theoremFilter mathMacros doc =
|
||||||
walk makeTheorem $
|
walk (makeTheorem mathMacros) $
|
||||||
autorefFilter $
|
autorefFilter $
|
||||||
evalState (walkM preprocessTheorems normalizedDoc) 1
|
evalState (walkM preprocessTheorems normalizedDoc) 1
|
||||||
where
|
where
|
||||||
@@ -171,24 +171,13 @@ autorefFilter x = walk (autoref links) x
|
|||||||
where
|
where
|
||||||
links = query theoremIndex x
|
links = query theoremIndex x
|
||||||
|
|
||||||
-- processCitations works on AST. If you want to use citations in theorem name,
|
|
||||||
-- then you need to convert citations there to AST as well and then use processCitations\
|
|
||||||
-- Thus one need to apply the theorem filter first.
|
|
||||||
-- autoref still does not work.
|
|
||||||
mathMacros :: Text
|
|
||||||
mathMacros = unsafePerformIO (pack <$> readFile "math-macros.md")
|
|
||||||
{-# NOINLINE mathMacros #-}
|
|
||||||
|
|
||||||
prependMacros :: Text -> Text -> Text
|
prependMacros :: Text -> Text -> Text
|
||||||
prependMacros macros body = macros <> "\n\n" <> body
|
prependMacros macros body = macros <> "\n\n" <> body
|
||||||
|
|
||||||
prependMathMacros :: Text -> Text
|
thmNamePandoc :: Text -> Text -> Pandoc
|
||||||
prependMathMacros = prependMacros mathMacros
|
thmNamePandoc mathMacros x =
|
||||||
|
|
||||||
thmNamePandoc :: Text -> Pandoc
|
|
||||||
thmNamePandoc x =
|
|
||||||
fromRight (Pandoc nullMeta []) . runPure $
|
fromRight (Pandoc nullMeta []) . runPure $
|
||||||
readMarkdown chaoDocRead (prependMathMacros x)
|
readMarkdown chaoDocRead (prependMacros mathMacros x)
|
||||||
|
|
||||||
obsidianTheoremFilter :: Pandoc -> Pandoc
|
obsidianTheoremFilter :: Pandoc -> Pandoc
|
||||||
obsidianTheoremFilter = attachStandaloneLabels . walk rewriteObsidianBlockQuote
|
obsidianTheoremFilter = attachStandaloneLabels . walk rewriteObsidianBlockQuote
|
||||||
@@ -390,8 +379,8 @@ unsnoc (x : xs) = do
|
|||||||
(prefix, lastElem) <- unsnoc xs
|
(prefix, lastElem) <- unsnoc xs
|
||||||
return (x : prefix, lastElem)
|
return (x : prefix, lastElem)
|
||||||
|
|
||||||
makeTheorem :: Block -> Block
|
makeTheorem :: Text -> Block -> Block
|
||||||
makeTheorem (Div attr xs)
|
makeTheorem mathMacros (Div attr xs)
|
||||||
| isNothing t = Div attr xs
|
| isNothing t = Div attr xs
|
||||||
| otherwise = Div (addClass attr "theorem-environment") (Plain [header] : xs)
|
| otherwise = Div (addClass attr "theorem-environment") (Plain [header] : xs)
|
||||||
where
|
where
|
||||||
@@ -408,26 +397,23 @@ makeTheorem (Div attr xs)
|
|||||||
nametext =
|
nametext =
|
||||||
if isNothing name
|
if isNothing name
|
||||||
then Str ""
|
then Str ""
|
||||||
else Span (addClass nullAttr "name") (pandocToInline $ thmNamePandoc $ fromJust name)
|
else Span (addClass nullAttr "name") (pandocToInline $ thmNamePandoc mathMacros $ fromJust name)
|
||||||
makeTheorem x = x
|
makeTheorem _ x = x
|
||||||
|
|
||||||
-- bib from https://github.com/chaoxu/chaoxu.github.io/tree/develop
|
bibFile :: T.Text
|
||||||
cslFile :: String
|
|
||||||
cslFile = "bib_style.csl"
|
|
||||||
|
|
||||||
bibFile :: String
|
|
||||||
bibFile = "reference.bib"
|
bibFile = "reference.bib"
|
||||||
|
|
||||||
chaoDocPandocCompiler :: Compiler (Item Pandoc)
|
chaoDocPandocCompiler :: FilePath -> Compiler (Item Pandoc)
|
||||||
chaoDocPandocCompiler = do
|
chaoDocPandocCompiler cslPath = do
|
||||||
macros <- T.pack <$> loadBody "math-macros.md"
|
macros <- T.pack <$> loadBody "math-macros.md"
|
||||||
|
void (loadBody "reference.bib" :: Compiler String)
|
||||||
body <- getResourceBody
|
body <- getResourceBody
|
||||||
let bodyWithMacros =
|
let bodyWithMacros =
|
||||||
fmap (T.unpack . prependMacros macros . T.pack) body
|
fmap (T.unpack . prependMacros macros . T.pack) body
|
||||||
myReadPandocBiblio chaoDocRead (T.pack cslFile) (T.pack bibFile) myFilter bodyWithMacros
|
myReadPandocBiblio chaoDocRead (T.pack cslPath) bibFile (myFilter macros) bodyWithMacros
|
||||||
|
|
||||||
chaoDocCompiler :: Compiler (Item String)
|
chaoDocCompiler :: FilePath -> Compiler (Item String)
|
||||||
chaoDocCompiler = chaoDocPandocCompiler <&> writePandocWith chaoDocWrite
|
chaoDocCompiler cslPath = chaoDocPandocCompiler cslPath <&> writePandocWith chaoDocWrite
|
||||||
|
|
||||||
addMeta :: T.Text -> MetaValue -> Pandoc -> Pandoc
|
addMeta :: T.Text -> MetaValue -> Pandoc -> Pandoc
|
||||||
addMeta name value (Pandoc meta a) =
|
addMeta name value (Pandoc meta a) =
|
||||||
@@ -465,8 +451,9 @@ myReadPandocBiblio ropt csl biblio pdfilter item = do
|
|||||||
-- let a x = itemSetBody (pandoc' x)
|
-- let a x = itemSetBody (pandoc' x)
|
||||||
return $ fmap (const pandoc') item
|
return $ fmap (const pandoc') item
|
||||||
|
|
||||||
myFilter :: Pandoc -> Pandoc
|
myFilter :: Text -> Pandoc -> Pandoc
|
||||||
myFilter = usingSideNotesHTML chaoDocWrite . theoremFilter . panguFilter . displayMathFilter
|
myFilter mathMacros =
|
||||||
|
usingSideNotesHTML chaoDocWrite . theoremFilter mathMacros . panguFilter . displayMathFilter
|
||||||
|
|
||||||
-- pangu filter
|
-- pangu filter
|
||||||
lastChar :: Inline -> Maybe Char
|
lastChar :: Inline -> Maybe Char
|
||||||
|
|||||||
+850
-168
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="googlebot" content="noindex" />
|
<meta name="googlebot" content="noindex" />
|
||||||
<title>$title$</title>
|
<title>$title$</title>
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<link rel="stylesheet" href="/css/fonts.css" />
|
<link rel="stylesheet" href="/css/fonts.css" />
|
||||||
<link rel="stylesheet" href="/css/default.css" />
|
<link rel="stylesheet" href="/css/default.css" />
|
||||||
<link rel="stylesheet" href="/css/pygentize.css" />
|
<link rel="stylesheet" href="/css/pygentize.css" />
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="googlebot" content="noindex">
|
<meta name="googlebot" content="noindex">
|
||||||
<title></title>
|
<title></title>
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<link rel="stylesheet" href="/css/fonts.css" />
|
<link rel="stylesheet" href="/css/fonts.css" />
|
||||||
<link rel="stylesheet" href="/css/default.css" />
|
<link rel="stylesheet" href="/css/default.css" />
|
||||||
<link rel="stylesheet" href="/css/pygentize.css" />
|
<link rel="stylesheet" href="/css/pygentize.css" />
|
||||||
|
|||||||
Reference in New Issue
Block a user