1
1
mirror of https://github.com/srid/rib.git synced 2024-11-29 10:12:56 +03:00
Commit Graph

85 Commits

Author SHA1 Message Date
Sridhar Ratnakumar
4d9ffe2c34 Handle parsing errors in Pandoc metadata 2019-11-26 21:58:43 -05:00
Sridhar Ratnakumar
a1909b0d54 Remove unused code from Pandoc module 2019-11-26 21:36:16 -05:00
Sridhar Ratnakumar
9857f240dd Remove MarkupError type familly
not needed
2019-11-26 21:26:58 -05:00
Sridhar Ratnakumar
22c9642bd9 Cleanup and refactor 2019-11-26 17:41:01 -05:00
Sridhar Ratnakumar
65f6c6d67e Add support for automatic metadata parsing 2019-11-26 17:05:06 -05:00
Sridhar Ratnakumar
0cd7a5949b Keep document type in Rib.Document 2019-11-26 16:18:30 -05:00
Sridhar Ratnakumar
94dcc31991 Detach Document type from Markup type class
Separation of concerns! Makes it simpler reason about what's happening.
2019-11-26 16:13:04 -05:00
Sridhar Ratnakumar
ef83dac0f1 Revert "Remove renderDoc from type class"
This reverts commit 7f9a25e0d6.
2019-11-26 15:25:41 -05:00
Sridhar Ratnakumar
5fe7ea3c6b Cosmetic fixes 2019-11-26 15:25:36 -05:00
Sridhar Ratnakumar
eb6898f711 Remove getDocumentUrl and unexpose Markup 2019-11-26 15:13:56 -05:00
Sridhar Ratnakumar
ac07ae7ffe Have Shake report errors with filename 2019-11-26 15:03:56 -05:00
Sridhar Ratnakumar
f8014e92f0 Remove error from mkDoc (Pandoc) 2019-11-26 14:50:29 -05:00
Sridhar Ratnakumar
7f9a25e0d6 Remove renderDoc from type class 2019-11-26 14:25:45 -05:00
Sridhar Ratnakumar
3d24954226 Add _document_html; renderDoc returns Either 2019-11-26 14:21:37 -05:00
Sridhar Ratnakumar
a11ca939dd Use more denotative type variable 2019-11-26 13:51:35 -05:00
Sridhar Ratnakumar
ff60b350e0 Add ipynb 2019-11-25 22:19:32 -05:00
Sridhar Ratnakumar
6c6439c87c Stop using MonadThrow 2019-11-25 22:14:04 -05:00
Sridhar Ratnakumar
45d29d544e Fix Pandoc.getFirstImg 2019-11-24 15:43:14 -05:00
Sridhar Ratnakumar
2359570f3d Expose manual render function 2019-11-24 15:36:59 -05:00
Sridhar Ratnakumar
6da1ba0eb0 Fix invalid metadata truncating HTML
writeFile will truncate the file before beginning to write, but if the
Lucid monad errors out the file will remain truncated. Use strict
function application to fix this.
2019-11-24 14:30:16 -05:00
Sridhar Ratnakumar
55eab03356 Gracefully handle errors, without dying.
Fixes #40
2019-11-24 13:48:21 -05:00
Sridhar Ratnakumar
086217a93f Make input/ output directories not polymorphic
Until this PR is merged: https://github.com/commercialhaskell/path/pull/140
2019-11-24 11:36:38 -05:00
Sridhar Ratnakumar
842ed096d3 Use newer versions of path/path-io 2019-11-24 11:33:32 -05:00
Sridhar Ratnakumar
a6cdb8e917 Advance nixpkgs, and refactor default.nix 2019-11-23 22:19:46 -05:00
Sridhar Ratnakumar
1bdc3f4475 Use relude in more places 2019-11-23 22:06:07 -05:00
Sridhar Ratnakumar
e84fb9b640 Use relude
Closes #47
2019-11-23 21:44:25 -05:00
Sridhar Ratnakumar
895c77e905
Re-format source tree using ormolu (#49) 2019-11-23 13:50:00 -05:00
Sridhar Ratnakumar
2beee392a1
Use type-safe paths (#48) 2019-11-23 13:25:02 -05:00
Sridhar Ratnakumar
76b9f89a23 Enable all mmark extensions 2019-11-22 18:39:57 -05:00
Sridhar Ratnakumar
9d02ed1458 Add MMark.getFirstImg 2019-11-22 18:15:50 -05:00
Sridhar Ratnakumar
8331fd18bf
Polymorphic markup parsing (using Pandoc and MMark) (#46)
* Add `Markup doc` type class to switch between Pandoc and MMark
* Vastly simplify metadata handling using aeson Value's
* Add typed error handling to parsing functions
* Drop json cache (won't work with mmark) and Rib.Simple
2019-11-22 14:41:38 -05:00
Sridhar Ratnakumar
20636ec9a4 Remove .html magic from URLs
fixes #42
2019-11-19 15:20:04 -05:00
Sridhar Ratnakumar
729092d86c Export a few things related to pandoc 2019-11-05 19:24:32 -05:00
David Wagner
fe21a6faa5 Make the input and output directories configurable 2019-10-24 22:08:30 +02:00
Sridhar Ratnakumar
e6a6742798 Add LaTeX to Rib.Simple 2019-08-26 11:36:17 -04:00
Sridhar Ratnakumar
dfdd11ed06
Hackage tweaks (#37) 2019-08-12 10:05:47 -04:00
Sridhar Ratnakumar
df137255a7 Complete haddock docs 2019-08-05 08:49:12 -04:00
Sridhar Ratnakumar
07c341a664 Make serve and watch the default command
So that user apps can directly run their `main` to get this dev
functionality (in ghcid). without having to pass custom arguments.
2019-08-03 09:45:34 -04:00
Sridhar Ratnakumar
5768b545c6 Finish invoice generator example 2019-08-03 09:24:37 -04:00
Sridhar Ratnakumar
6ef1f2a59a Add Pandoc.getFirstImg 2019-07-28 11:03:21 -04:00
Sridhar Ratnakumar
d455c00e4c Allow external metadata files for Pandoc docs
This is needed when using non-Markdown formats
2019-07-25 17:29:04 -04:00
Sridhar Ratnakumar
05d8dcaead Disable directory listings 2019-07-25 09:11:04 -04:00
Sridhar Ratnakumar
571782b8a6 Add orgmode to example 2019-07-23 17:49:13 -04:00
Sridhar Ratnakumar
328476b45b Add support for non-Markdown formats
Demonstrate this by using reST in examples/hello-world, at the expense
of relinquishing yaml metadata (which is markdown-only), which is
however retained in examples/doc.
2019-07-23 16:46:04 -04:00
Sridhar Ratnakumar
2a1bd274d3
Add WIP invoice generator example (#26)
* Initial version

* cabal: remove rib-example

* Flesh out addresses and simple table

* company and author cards

* wip

* Fix getMeta instance for [Text]

* Refactor Pandoc.parse*

* wip note
2019-07-23 07:48:29 -04:00
Sridhar Ratnakumar
71ad28f6a0 writeHtml: use BS instead of Text
as the text is already encoded by Lucid.
2019-07-21 14:50:14 -04:00
Sridhar Ratnakumar
d1cccb8433 Use Lucide.renderText
Because it calls decodeUtf8
2019-07-21 14:45:35 -04:00
Sridhar Ratnakumar
1dfd18fbaf Actually fix utf8 encoding 2019-07-21 14:36:33 -04:00
Sridhar Ratnakumar
acac41ee15 Move the two examples to ./examples
More examples will be added.
2019-07-19 17:40:00 -04:00
Sridhar Ratnakumar
bf65d8918e doc: Include example's Main.hs dynamically 2019-07-19 16:42:18 -04:00