Created
August 14, 2013 17:32
-
-
Save co-dan/6233372 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match "gallery/*.lhs" $ version "gallery" $ do | |
route $ setExtension "html" | |
compile $ do | |
getResourceBody >>= saveSnapshot "rawcontent" | |
withMathJax | |
>>= loadAndApplyTemplate "templates/exampleHi.html" | |
( mconcat | |
[ field "code" readSource | |
, setImgURL | |
, setHtmlURL | |
, markdownFieldsCtx ["description"] | |
, defaultContext | |
] | |
) | |
>>= mainCompiler defaultContext | |
-- export raw .lhs of examples for download | |
match "gallery/*.lhs" $ version "raw" $ do | |
route idRoute | |
compile getResourceBody | |
readSource :: Item String -> Compiler String | |
readSource item = itemBody <$> loadSnapshot metadata "rawcontent" | |
where | |
metadata = itemIdentifier item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment