packages feed

shakebook 0.2.0.1 → 0.2.0.2

raw patch · 4 files changed

+13/−8 lines, 4 files

Files

shakebook.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 1a53af50ae1f33a62c5aa274a9c61088f181e72ed6fff81637c4ebb9e9f0e45e+-- hash: 49b98e657e822e6db488c7a2cb74ddc8689861654dde1f9874317021db76b617  name:           shakebook-version:        0.2.0.1+version:        0.2.0.2 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
@@ -156,9 +156,9 @@                    -> (Value -> Value) -- ^ Additional modifiers for the value.                    -> FilePath -- ^ The out filepath                    -> m Value-genBuildPageAction template getData withData out = do+genBuildPageAction template getData withData out = view sbConfigL >>= \SbConfig{..} -> do   logInfo $ displayShow $ "Generating page with fullpath " <> out-  pageT <- liftAction $ compileTemplate' template+  pageT <- liftAction $ compileTemplate' (sbSrcDir </> template)   dataT <- withData . typicalUrlEnricher <$> getData out   logDebug $ displayShow dataT   writeFile' out . T.unpack $ substitute pageT dataT
src/Shakebook/Defaults.hs view
@@ -106,7 +106,7 @@          \xs -> \out -> runShakebookA r $ do              ys <- mapM readMarkdownFile' toc              zs <- mapM readMarkdownFile' xs-             void $ genBuildPageAction (sbSrcDir </> tmpl)+             void $ genBuildPageAction tmpl                       (readMarkdownFile' . m)                       (withData                      . withJSON (genTocNavbarData (e <$> ys))@@ -135,7 +135,7 @@                     -> m () defaultPagerPattern fp tmpl f g h w = ask >>= \r -> view sbConfigL >>= \SbConfig{..} -> liftRules $   comonadStoreRuleGen (sbOutDir </> fp) (f . drop 1 . fromJust . stripPrefix sbOutDir) (g . drop 1 . fromJust . stripPrefix sbOutDir) (runShakebookA r . (w <=< h))-  (\a -> void <$> runShakebookA r . genBuildPageAction (sbSrcDir </> tmpl) (const $ return a) id)+  (\a -> void <$> runShakebookA r . genBuildPageAction tmpl (const $ return a) id)  defaultPostIndexPatterns :: MonadShakebookRules r m                          => [FilePattern]@@ -219,7 +219,7 @@       let i = (-<.> ".md") . drop 1 . fromJust . stripPrefix sbOutDir $ out       let k = fromJust $ elemIndex i (fst <$> sortedPosts)       let z = fromJust $ seek k <$> zipper (snd <$> sortedPosts)-      void $ runShakebookA r $ genBuildPageAction (sbSrcDir </> tmpl)+      void $ runShakebookA r $ genBuildPageAction tmpl                                 (const $ extract <$> extData z)                                 id out @@ -287,6 +287,10 @@   phony "clean" $ do       putInfo $ "Cleaning files in " ++ sbOutDir       removeFilesAfter sbOutDir ["//*"]++defaultSinglePagePhony :: MonadShakebookRules r m => String -> FilePath -> m ()+defaultSinglePagePhony x y = view sbConfigL >>= \SbConfig {..} -> liftRules $ +  phony x $ need [sbOutDir </> y]  {-|   Default "shake statics" phony rule. automatically runs need on "\<out\>\/thing\/\*" for every
test/Spec.hs view
@@ -77,6 +77,7 @@   defaultStaticsPatterns   ["css//*", "images//*", "js//*", "webfonts//*"]   defaultStaticsPhony +  defaultSinglePagePhony    "index" "index.html"   defaultPostsPhony         ["posts/*.md"]   defaultPostIndexPhony     ["posts/*.md"] @@ -101,6 +102,6 @@    lf <- newLogFunc (setLogMinLevel LevelInfo logOptions')    let f = ShakebookEnv (fst lf) sbc    shake shakeOptions $ want ["clean"] >> runShakebook f rules-   shake shakeOptions $ want ["docs", "month-index", "posts-index", "tag-index", "posts"]  >> runShakebook f rules+   shake shakeOptions $ want ["index", "docs", "month-index", "posts-index", "tag-index", "posts"]  >> runShakebook f rules    defaultMain $ tests xs    snd lf