-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a library and add various options #2
Conversation
cdupont
commented
Sep 15, 2015
- added library in cabal file
- added attribute "echo=Above|Below" to get a display of the code
- added tests
This is great, nice to see this getting some attention. Couple of small things:
Otherwise this looks good. I don't know if you noticed there's another PR #1 (which I started in December?!, I need to start finishing off my PRs) that has extra features and was pretty much ready to merge, but depends on a branch of |
@cchalmers: I advised @cdupont that last I heard you weren't planning to finish the I'll try to get through this in the next week, but probably not before Friday. |
@cchalmers: I renamed |
|
||
readEcho :: [(String, String)] -> Maybe Echo | ||
readEcho attrs = case lookup "echo" attrs of | ||
Just e -> Just (read e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be readMaybe e
. Or maybe a custom parser to allow other capitalization.
@cdupont What's your use-case for the library? I'm happy to split the library part from the executable, it just hadn't occurred to me that anyone would want this. |
Right imgName -> Plain [Image [] ((if absolutePath then pathSeparator : imgName else imgName),"")] | ||
let codeBlock = CodeBlock (ident, "haskell":delete "diagrams" classes, attrs) code | ||
let block' = case readEcho attrs of | ||
(Just Above) -> Table [] [AlignLeft] [] [] [[[codeBlock]], [[imgBlock]]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a table? We don't currently use a table in the documentation, and I generally try to avoid tables for layout in HTML.
I cherry-picked most of the changes, while preserving the command-line parsing and the existing recognized classes. In particular, I included these changes:
Thank you for this PR. |