diff options
| -rw-r--r-- | provider/posts/beuteltier-2.lhs | 2 | ||||
| -rw-r--r-- | provider/posts/beuteltier-3.md | 2 | ||||
| -rw-r--r-- | provider/posts/hakyll.md | 8 | ||||
| -rw-r--r-- | provider/posts/pwutil.md | 6 | ||||
| -rw-r--r-- | provider/posts/tex-support.md | 6 |
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 | |||
| 68 | Quite often we find ourselves in the position that we want to alter some small parts of a | 68 | Quite often we find ourselves in the position that we want to alter some small parts of a |
| 69 | complicated structure. We would therefore like to write the following: | 69 | complicated structure. We would therefore like to write the following: |
| 70 | 70 | ||
| 71 | ~~~ {.haskell .numberLines} | 71 | ~~~ {.haskell} |
| 72 | updateFoo :: Foo -> Monad Foo | 72 | updateFoo :: Foo -> Monad Foo |
| 73 | updateFoo x = alter x $ do | 73 | updateFoo 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 | |||
| 8 | replaced the `Hashable` instances for `Object` and `MetaData` with a single, better | 8 | replaced the `Hashable` instances for `Object` and `MetaData` with a single, better |
| 9 | optimized function: | 9 | optimized function: |
| 10 | 10 | ||
| 11 | ~~~ {.haskell .numberLines} | 11 | ~~~ {.haskell} |
| 12 | objHash :: Applicative f => ObjectGen f -> f Int | 12 | objHash :: 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' |
| 14 | objHash o = fmap hash $ (,) <$> (Set.toList . (^. mTags) <$> o ^. oMeta) <*> (Map.keys <$> o ^. oContent) | 14 | objHash 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) |
| 35 | structure and used it to add my desired pseudo-tag. | 35 | structure and used it to add my desired pseudo-tag. |
| 36 | 36 | ||
| 37 | ~~~ {.haskell .numberLines} | 37 | ~~~ {.haskell} |
| 38 | main = hakyllWith config $ do | 38 | main = 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 | |||
| 61 | the corresponding template to only print "…". | 61 | the corresponding template to only print "…". |
| 62 | Trimming the list of posts is straightforward. | 62 | Trimming the list of posts is straightforward. |
| 63 | 63 | ||
| 64 | ~~~ {.haskell .numberLines} | 64 | ~~~ {.haskell} |
| 65 | renderTag :: String -- ^ Tag name | 65 | renderTag :: 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 | |||
| 101 | This was easily rectified by realising, that even templates need (of course) a | 101 | This was easily rectified by realising, that even templates need (of course) a |
| 102 | declaration of how to compile them: | 102 | declaration of how to compile them: |
| 103 | 103 | ||
| 104 | ~~~ {.haskell .numberLines} | 104 | ~~~ {.haskell} |
| 105 | main = hakyllWith config $ do | 105 | main = hakyllWith config $ do |
| 106 | match "templates/*" $ compile templateCompiler | 106 | match "templates/*" $ compile templateCompiler |
| 107 | … | 107 | … |
| @@ -123,7 +123,7 @@ twice. | |||
| 123 | 123 | ||
| 124 | So I did: | 124 | So I did: |
| 125 | 125 | ||
| 126 | ~~~ {.haskell .numberLines} | 126 | ~~~ {.haskell} |
| 127 | main = hakyllWith config $ do | 127 | main = 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 | |||
| 53 | is a [nix](https://nixos.org/nix) expression allowing easy installation using the nix package manager. | 53 | is a [nix](https://nixos.org/nix) expression allowing easy installation using the nix package manager. |
| 54 | A `~/.nixpkgs/config.nix` allowing one to do so might look thus: | 54 | A `~/.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} |
| 80 | module PWUtil.Types ( | 80 | module PWUtil.Types ( |
| 81 | PW(..), | 81 | PW(..), |
| 82 | BackStore(..), | 82 | BackStore(..), |
| @@ -109,7 +109,7 @@ type Generator = [String] -> PW Value | |||
| 109 | 109 | ||
| 110 | is, in a [xmonad](http://xmonad.org) kind of way, the configuration file—the shipped default is reproduced below as a template for custom configs. | 110 | is, 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} |
| 113 | import PWUtil | 113 | import PWUtil |
| 114 | 114 | ||
| 115 | import System.FilePath ((</>)) | 115 | import 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 | ||
| 30 | Theorem environments are written using [pandoc](http://pandoc.org)s support for block environments: | 30 | Theorem 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 | ||
| 35 | Formulae are rendered with $\text{\LaTeX}$ and included as [SVG](https://en.wikipedia.org/wiki/SVG). | 35 | Formulae 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 | |||
| 56 | The actual compilation happens in a new module I named `Math.hs`. We´ll start there. | 56 | The actual compilation happens in a new module I named `Math.hs`. We´ll start there. |
| 57 | For your reading pleasure I added some comments to the reproduction below. | 57 | For your reading pleasure I added some comments to the reproduction below. |
| 58 | 58 | ||
| 59 | ~~~ {.haskell .numberLines} | 59 | ~~~ {.haskell} |
| 60 | module Math | 60 | module Math |
| 61 | ( compileMath | 61 | ( compileMath |
| 62 | ) where | 62 | ) where |
| @@ -138,7 +138,7 @@ extractAlignment = fromMaybe "0pt" . extract . (=~ "depth=([^\\s]+)") -- One of | |||
| 138 | 138 | ||
| 139 | The more trick part proved to be integration into the framework as provided by [Hakyll](http://jaspervdj.be/hakyll/). | 139 | The 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 | ||
| 144 | import qualified Crypto.Hash.SHA256 as SHA256 (hash) | 144 | import qualified Crypto.Hash.SHA256 as SHA256 (hash) |
