Personal Blog

This is the source code for my personal blog.

Setup

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

Publish

./deploy

Warning: This will build using the local version including uncommitted files.

TODO

The most prominent features currently supported are server side math rendering to support arbitrary latex packages, references with hyperlinks and citations.

Guide to Self

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)
```

Footnotes

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")]