shakebook 0.2.0.3 → 0.2.0.4
raw patch · 3 files changed
+7/−6 lines, 3 files
Files
- shakebook.cabal +2/−2
- src/Shakebook/Data.hs +3/−3
- src/Shakebook/Defaults.hs +2/−1
shakebook.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 4c6576bf8a6153b589568c59f319bb890e00daa59e0a8c90b724b11822acdf27+-- hash: f07d9fe04c2a84023b693534da2123af9c52934fba5c71935b6a93bb57ea1005 name: shakebook-version: 0.2.0.3+version: 0.2.0.4 synopsis: Shake-based technical documentation generator; HTML & PDF description: Shakebook is a documentation generator aimed at covering all the bases for mathematical, technical and scientific diagrams and typesetting. Shakebook provides combinators for taking markdown files and combining them into documents, but allowing the user to control how. Shakebook provides general combinators for templating single pages, cofree comonads for representing tables of contents, and zipper comonads for representing pagers. category: Web
src/Shakebook/Data.hs view
@@ -125,8 +125,8 @@ typicalSrcPathToUrl :: Text -> Text typicalSrcPathToUrl = ("/" <>) . T.pack . (-<.> "html") . T.unpack -typicalUrlEnricher :: Value -> Value-typicalUrlEnricher v = withUrl (typicalSrcPathToUrl . viewSrcPath $ v) v+enrichTypicalUrl :: Value -> Value+enrichTypicalUrl v = withUrl (typicalSrcPathToUrl . viewSrcPath $ v) v {-| Get a JSON Value of Markdown Data with markdown body as "contents" field@@ -159,7 +159,7 @@ genBuildPageAction template getData withData out = view sbConfigL >>= \SbConfig{..} -> do logInfo $ displayShow $ "Generating page with fullpath " <> out pageT <- liftAction $ compileTemplate' (sbSrcDir </> template)- dataT <- withData . typicalUrlEnricher <$> getData out+ dataT <- withData . enrichTypicalUrl <$> getData out logDebug $ displayShow dataT writeFile' out . T.unpack $ substitute pageT dataT return dataT
src/Shakebook/Defaults.hs view
@@ -52,6 +52,7 @@ defaultEnrichPost = enrichTeaser "<!--more-->" . enrichTagLinks ("/posts/tags/" <>) . enrichPrettyDate defaultPrettyTimeFormat+ . enrichTypicalUrl defaultMarkdownReaderOptions :: ReaderOptions defaultMarkdownReaderOptions = def { readerExtensions = pandocExtensions }@@ -100,7 +101,7 @@ -> (Value -> Value) -- Extra data modifiers. -> m () defaultDocsPatterns toc tmpl withData = ask >>= \r -> view sbConfigL >>= \SbConfig {..} -> do- let e = typicalUrlEnricher+ let e = enrichTypicalUrl m <- typicalFullOutHTMLToMdSrcPath liftRules $ cofreeRuleGen toc ((sbOutDir </>) . (-<.> ".html")) ( \xs -> \out -> runShakebookA r $ do