buildHtml was incorrectly named; it should have actually been called
writeHtml. This commit also actually implements buildHtml, which is like
buildHtmlMulti but operating on a single file.
During the initial full generation we are not handing exceptions from
Shake (which can happen due to parser errors from user code). This
change handles it.
Useful in user code when wanting to read a single source file, as
opposed to a pattern of them. The other difference to buildHtmlMulti is
that readSource merely parses the source, but does not write HTML of it.
Example:
```haskell
blurb <- Rib.readSource MMark.parse [relfile|fragments/index.md|] >>= \case
Left e -> fail $ toString e
Right v -> pure v
```
This will allow us to do Shake-y things in our readers. For example,
parsing our Dhall files may require `need`'ing its dependent .dhall
files, doing which ensures that when those files change rib will
re-generate our site accordingly.
Code example:
```haskell
parseIO :: FromDhall a => Path b File -> Action (Either Text a)
parseIO (toFilePath -> f) = do
inputDir <- ribInputDir
let dhallDeps =
[ [relfile|Entry.dhall|],
[relfile|Metric.dhall|]
]
need $ fmap (toFilePath . (inputDir </>)) dhallDeps
s <- toText <$> readFile' f
e <-
liftIO $ withCurrentDirectory (toFilePath inputDir) $
input auto s
pure $ Right e
```
* Add fsatrace to nix
* Use cacheActionWith to prevent rebuilds
* Log whenever a HTML file is written
* Change the type signature of `SourceReader` accordingly
* WIP, try to move away from type class
Use a Map of patterns to parser type, so as to select the parser
explicitly without using type applications (which unifies it for all
files)
* Use dependent-sum
* Rename to IsMarkup
* Use Data.Some for polymorphic lists
* Refactor out withSomeMarkupDoc
* Move MarkupDoc to Markup module
* Rename
* ChangeLog and import cleanup
* Update README for this PR