This is the source code for my personal blog.
Requirements:
cabal install pandoc-2.1.3
cabal install pandoc-crossref-0.3.1.0
cabal install pandoc-sidenote-0.19.0.0
To do a full rebuild and start watching the files:
PATH=/Users/tmpethick/Library/Haskell/bin:$PATH
stack build && stack exec site rebuild && stack exec site watch
To enable livereload install the LiveReload browser plugin and run:
npm install
node livereload.js
./deploy
Warning: This will build using the local version including uncommitted files.
The most prominent features currently supported are server side math rendering to support arbitrary latex packages, references with hyperlinks and citations.
- Render math to image to support arbitrary latex packages (using
latex-formulae
).- Specify packages in
preamble
using[String]
instead ofString
for readability.
- Specify packages in
- Bibliography support with a
.bib
file for each post (using Hakyll'sreadPandocBiblio
) - Reference section, figure and equations with links (using
pandoc-crossref
). - Let top post heading be
h2
(using Haskell Tag transformation to avoid messing uppandoc-crossref
s numbering). - Number sections (using
pandoc-crossref
). - Style h5 similar to Latex paragraph in a pdf.
- Strips
.html
from urls. - Render html5 sections.
- Equations in figures (Using
pandoc-crossref
subfigure hack). - Definition style.
- Ignore
README.md
. - Render Edward Tufte style.
- Sidenotes.
- Margin figures.
- Wide figures.
- Wide tables.
- Google analytics.
- Github compatible.
- Improve markdown:
- Ignore indentation (like latex).
- Comments in markdown (like latex).
- Hyperlinks for citations 1.
- PDF output using latex.
- See https://ickc.github.io/pandoc-amsthm/ for going from our thm/lm/proof markdown syntax to latex.
- Make subfigure output semantic (use
figure
andfigcaption
). - Feed.
- Tags.
- Live reload (see jaspervdj/hakyll#140)
- Fix styling for sidenotes
- Remove left sidebar
- Theorem pandoc compatibility: possibly use pandocs new content-blocks
::: theorem
vsch/flexmark-java#327 - Reference Theorems with crossref.
Reference using:
# My section {#sec:my}
[@sec:my]
Cite using:
[@citeid]
Equations inside figure (hackishly using subfigures):
<div id="fig:eq1">
$$The equation$$
This is the description.
</div>
Definition style:
<div class="definition">
<header>
#### Title
Some explanatory:
</header>
<div class="definition-body">
Here's the definition.
</div>
</div>
Create code with line numbers (uses pandoc-sidenote
):
```{.haskell .numberLines}
merge [] ys = ys
merge xs [] = xs
merge xs@(x:xt) ys@(y:yt) | x <= y = x : merge xt ys
| otherwise = y : merge xs yt
split (x:y:zs) = let (xs,ys) = split zs in (x:xs,y:ys)
split [x] = ([x],[])
split [] = ([],[])
mergeSort [] = []
mergeSort [x] = [x]
mergeSort xs = let (as,bs) = split xs
in merge (mergeSort as) (mergeSort bs)
```
The footnote syntax can be found here:
https://rephrase.net/box/word/footnotes/syntax/
1)
Possible using -F pandoc-citeproc --metadata link-citations=true
. We might have to do it in haskell by setting WriterOptions
↩:
, writerCiteMethod = Citeproc
, writerVariables = [("link-citations", "true")]