Skip to content

Commit

Permalink
Fix documentation mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
dunnl committed Mar 22, 2020
1 parent 568fa59 commit b109e54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
26 changes: 11 additions & 15 deletions lib/PLClub/HakyllExtra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,18 @@ import Control.Monad (liftM)
import Data.Ord (comparing)
import Data.List (sortBy)

--- Suppose
-- C is a compiler that returns a LIST (x) of LISTS (y)
-- I want a context D that will execute against the first list (x)
-- It will a take a key ("group") and a context E to run on an inner lists y.
-- Then it is a totally different Context b. When executed in runs C to get [[a]].
-- Against each list [a] it runs E.
-- Meanwhile E is running against a "Compiler [a]". E should be use a listFieldWith
-- because it is executing NOT against a STORED set (the 3rd argument to listField).
-- No, it must generated the set.
-- And it will run C to get [[a]]. For each

-- | Create a `listField` whose inner `Context` is another
-- `listField.`
-- The result `nestedListField ko ki ctx items` is a list
-- with key `ko`. The values of that list are the outer elements of
-- type `[Item a]`. Those elements are seen in a context in which
-- there is a single inner context with key `ki` and whose values are
-- the individual `Item a` values rendered in the original context.
nestedListField :: String -- outer key
-> String -- inner key
-> Context a
-> Compiler [[Item a]]
-> Context b
-> String -- inner key
-> Context a
-> Compiler [[Item a]]
-> Context b
nestedListField ko ki ctx items =
listField ko innerctx ((Item "" <$>) <$> items)
where
Expand Down
6 changes: 3 additions & 3 deletions lib/PLClub/Publications.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ makePapersHtml = withSystemTempDirectory "plclub_bib" $ \f -> do
callProcess "make" ["-C", f]
readFile (f </> "plclub.html")

-- Assemble "plclub.html" as a String
-- Assemble "plclub_bib.html" as a String
-- This part purely runs the Makefile and returns "plclub.html"
-- No Hakyll stuff happening yet
makeBibHtml :: IO String
Expand All @@ -62,12 +62,12 @@ makeMergedBib = withSystemTempDirectory "plclub_bib" $ \f -> do
parsePapers :: String -> [String]
parsePapers src =
case runPure $ readHtml defaultHakyllReaderOptions (pack src) of
Left err -> error "Shit"
Left err -> error "Error parsing papers HTML"
Right pan -> do
let pans = justRows pan
flip map pans $ \p -> do
case runPure $ (writeHtml5String defaultHakyllWriterOptions) p of
Left err -> error "Writing shit"
Left err -> error "Error writing papers HTML"
Right txt -> unpack txt


Expand Down

0 comments on commit b109e54

Please sign in to comment.