summaryrefslogtreecommitdiff
path: root/provider
diff options
context:
space:
mode:
Diffstat (limited to 'provider')
-rw-r--r--provider/posts/beuteltier-2.lhs2
-rw-r--r--provider/posts/beuteltier-3.md2
-rw-r--r--provider/posts/hakyll.md8
-rw-r--r--provider/posts/pwutil.md6
-rw-r--r--provider/posts/tex-support.md6
5 files changed, 12 insertions, 12 deletions
diff --git a/provider/posts/beuteltier-2.lhs b/provider/posts/beuteltier-2.lhs
index d5e0294..137b8de 100644
--- a/provider/posts/beuteltier-2.lhs
+++ b/provider/posts/beuteltier-2.lhs
@@ -68,7 +68,7 @@ mostly of the canonical invocations of
68Quite often we find ourselves in the position that we want to alter some small parts of a 68Quite often we find ourselves in the position that we want to alter some small parts of a
69complicated structure. We would therefore like to write the following: 69complicated structure. We would therefore like to write the following:
70 70
71~~~ {.haskell .numberLines} 71~~~ {.haskell}
72updateFoo :: Foo -> Monad Foo 72updateFoo :: Foo -> Monad Foo
73updateFoo x = alter x $ do 73updateFoo x = alter x $ do
74 bar <~ (constructNewBar :: Monad Bar) 74 bar <~ (constructNewBar :: Monad Bar)
diff --git a/provider/posts/beuteltier-3.md b/provider/posts/beuteltier-3.md
index 79e105a..9b699c1 100644
--- a/provider/posts/beuteltier-3.md
+++ b/provider/posts/beuteltier-3.md
@@ -8,7 +8,7 @@ I commited a change to `beuteltier/Beuteltier/Types/Util.hs` ("[…] Hashable up
8replaced the `Hashable` instances for `Object` and `MetaData` with a single, better 8replaced the `Hashable` instances for `Object` and `MetaData` with a single, better
9optimized function: 9optimized function:
10 10
11~~~ {.haskell .numberLines} 11~~~ {.haskell}
12objHash :: Applicative f => ObjectGen f -> f Int 12objHash :: Applicative f => ObjectGen f -> f Int
13-- ^ Two 'ObjectGen's hashes are a first indication of whether they are 'Equivalent' 13-- ^ Two 'ObjectGen's hashes are a first indication of whether they are 'Equivalent'
14objHash o = fmap hash $ (,) <$> (Set.toList . (^. mTags) <$> o ^. oMeta) <*> (Map.keys <$> o ^. oContent) 14objHash o = fmap hash $ (,) <$> (Set.toList . (^. mTags) <$> o ^. oMeta) <*> (Map.keys <$> o ^. oContent)
diff --git a/provider/posts/hakyll.md b/provider/posts/hakyll.md
index 8e8b1fc..910edcb 100644
--- a/provider/posts/hakyll.md
+++ b/provider/posts/hakyll.md
@@ -34,7 +34,7 @@ function to add new tags to an already existing
34[Tags](http://hackage.haskell.org/package/hakyll-4.7.2.2/docs/Hakyll-Web-Tags.html#t:Tags) 34[Tags](http://hackage.haskell.org/package/hakyll-4.7.2.2/docs/Hakyll-Web-Tags.html#t:Tags)
35structure and used it to add my desired pseudo-tag. 35structure and used it to add my desired pseudo-tag.
36 36
37~~~ {.haskell .numberLines} 37~~~ {.haskell}
38main = hakyllWith config $ do 38main = hakyllWith config $ do
39 39
40 tags <- buildTags "posts/*" tagTranslation' >>= addTag "All Posts" "posts/*" 40 tags <- buildTags "posts/*" tagTranslation' >>= addTag "All Posts" "posts/*"
@@ -61,7 +61,7 @@ A trick I used to implement the desired behaviour of replacing old posts with
61the corresponding template to only print "…". 61the corresponding template to only print "…".
62Trimming the list of posts is straightforward. 62Trimming the list of posts is straightforward.
63 63
64~~~ {.haskell .numberLines} 64~~~ {.haskell}
65renderTag :: String -- ^ Tag name 65renderTag :: String -- ^ Tag name
66 -> Tags 66 -> Tags
67 -> Compiler (Item String) 67 -> Compiler (Item String)
@@ -101,7 +101,7 @@ I was stumped for a while when my templates wouldn´t
101This was easily rectified by realising, that even templates need (of course) a 101This was easily rectified by realising, that even templates need (of course) a
102declaration of how to compile them: 102declaration of how to compile them:
103 103
104~~~ {.haskell .numberLines} 104~~~ {.haskell}
105main = hakyllWith config $ do 105main = hakyllWith config $ do
106 match "templates/*" $ compile templateCompiler 106 match "templates/*" $ compile templateCompiler
107 107
@@ -123,7 +123,7 @@ twice.
123 123
124So I did: 124So I did:
125 125
126~~~ {.haskell .numberLines} 126~~~ {.haskell}
127main = hakyllWith config $ do 127main = hakyllWith config $ do
128 tags <- buildTags "posts/*" tagTranslation' … 128 tags <- buildTags "posts/*" tagTranslation' …
129 let 129 let
diff --git a/provider/posts/pwutil.md b/provider/posts/pwutil.md
index a4b3757..63a660d 100644
--- a/provider/posts/pwutil.md
+++ b/provider/posts/pwutil.md
@@ -53,7 +53,7 @@ pwutil
53is a [nix](https://nixos.org/nix) expression allowing easy installation using the nix package manager. 53is a [nix](https://nixos.org/nix) expression allowing easy installation using the nix package manager.
54A `~/.nixpkgs/config.nix` allowing one to do so might look thus: 54A `~/.nixpkgs/config.nix` allowing one to do so might look thus:
55 55
56~~~ {.numberLines} 56~~~
57{ 57{
58 packageOverrides = pkgs: { 58 packageOverrides = pkgs: {
59 pwutil = pkgs.callPackage /path/to/pwutil.nix {}; 59 pwutil = pkgs.callPackage /path/to/pwutil.nix {};
@@ -76,7 +76,7 @@ Introducing `PW` (much as [xmonad](https://xmonad.org) did with `X`) is an easy
76`BackStore` is our (new and improved) way of encapsulating store access in a totally customisable way—`plain`, which is essential `readFile` and `writeFile` as provided by `ByteString`, is provided for convenience in `Util.hs`. 76`BackStore` is our (new and improved) way of encapsulating store access in a totally customisable way—`plain`, which is essential `readFile` and `writeFile` as provided by `ByteString`, is provided for convenience in `Util.hs`.
77`PWConfig` most importantly contains a definition of generators (called by passing `--gen-…` to `pwadd`). 77`PWConfig` most importantly contains a definition of generators (called by passing `--gen-…` to `pwadd`).
78 78
79~~~ {#Types.hs .haskell .numberLines} 79~~~ {#Types.hs .haskell}
80module PWUtil.Types ( 80module PWUtil.Types (
81 PW(..), 81 PW(..),
82 BackStore(..), 82 BackStore(..),
@@ -109,7 +109,7 @@ type Generator = [String] -> PW Value
109 109
110is, in a [xmonad](http://xmonad.org) kind of way, the configuration file—the shipped default is reproduced below as a template for custom configs. 110is, in a [xmonad](http://xmonad.org) kind of way, the configuration file—the shipped default is reproduced below as a template for custom configs.
111 111
112~~~ {#pwutil.hs .haskell .numberLines} 112~~~ {#pwutil.hs .haskell}
113import PWUtil 113import PWUtil
114 114
115import System.FilePath ((</>)) 115import System.FilePath ((</>))
diff --git a/provider/posts/tex-support.md b/provider/posts/tex-support.md
index 0beade1..7f43eb6 100644
--- a/provider/posts/tex-support.md
+++ b/provider/posts/tex-support.md
@@ -29,7 +29,7 @@ $\text{tan}(\phi) = \frac{\text{sin}(\phi)}{\text{cos}(\phi)}$
29 29
30Theorem environments are written using [pandoc](http://pandoc.org)s support for block environments: 30Theorem environments are written using [pandoc](http://pandoc.org)s support for block environments:
31 31
32~~~ {.markdown .numberLines} 32~~~ {.markdown}
33<div class="theorem"> 33<div class="theorem">
34 34
35Formulae are rendered with $\text{\LaTeX}$ and included as [SVG](https://en.wikipedia.org/wiki/SVG). 35Formulae are rendered with $\text{\LaTeX}$ and included as [SVG](https://en.wikipedia.org/wiki/SVG).
@@ -56,7 +56,7 @@ $\text{\LaTeX}$ support is, however, lacking as I opted not to patch pandoc ([ma
56The actual compilation happens in a new module I named `Math.hs`. We´ll start there. 56The actual compilation happens in a new module I named `Math.hs`. We´ll start there.
57For your reading pleasure I added some comments to the reproduction below. 57For your reading pleasure I added some comments to the reproduction below.
58 58
59~~~ {.haskell .numberLines} 59~~~ {.haskell}
60module Math 60module Math
61 ( compileMath 61 ( compileMath
62 ) where 62 ) where
@@ -138,7 +138,7 @@ extractAlignment = fromMaybe "0pt" . extract . (=~ "depth=([^\\s]+)") -- One of
138 138
139The more trick part proved to be integration into the framework as provided by [Hakyll](http://jaspervdj.be/hakyll/). 139The more trick part proved to be integration into the framework as provided by [Hakyll](http://jaspervdj.be/hakyll/).
140 140
141~~~ {.haskell .numberLines} 141~~~ {.haskell}
142 142
143 143
144import qualified Crypto.Hash.SHA256 as SHA256 (hash) 144import qualified Crypto.Hash.SHA256 as SHA256 (hash)