aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Docx/Reducible.hs
AgeCommit message (Collapse)AuthorFilesLines
2014-08-16Rewrite Docx.hs and Reducible to use Builder.Jesse Rosenthal1-189/+175
The big news here is a rewrite of Docx to use the builder functions. As opposed to previous attempts, we now see a significant speedup -- times are cut in half (or more) in a few informal tests. Reducible has also been rewritten. It can doubtless be simplified and clarified further. We can consider this, at the moment, a reference for correct behavior.
2014-08-13Docx: Reducible forgot about smallcapsJesse Rosenthal1-0/+2
2014-08-12Docx reader: move combining logic to ReducibleJesse Rosenthal1-0/+10
Introduces a new function in Reducibles, concatR. The idea is that if we have two list of Reducibles (blocks or inlines), we can combine them and just perform the reduction on the joining parts (the last element of the first list, the first element of the second list). This is useful in cases where the two lists are already reduced, and we're only worried about the joining elements. This actually improves the efficiency a bit further, because concatR can be smart about empty lists.
2014-08-11Docx reader: handle empty reducibles.Jesse Rosenthal1-5/+6
2014-08-10Change head/tail to pattern guards.Jesse Rosenthal1-7/+8
2014-08-09Docx reader: Fix spacing issue.Jesse Rosenthal1-9/+10
Previously spaces at the beginning of Emph/Strong/etc were kept inside. This makes sure they are moved out.
2014-07-12Removed space at ends of lines in source.John MacFarlane1-4/+4
2014-06-23Add copyright block to T.P.R.Docx.Reducible.Jesse Rosenthal1-0/+31
2014-06-23Add new typeclass, ReducibleJesse Rosenthal1-0/+150
This defines a typeclass `Reducible` which allows us to "reduce" pandoc Inlines and Blocks, like so Emph [Strong [Str "foo", Space]] <++> Strong [Emph [Str "bar"]], Str "baz"] = [Strong [Emph [Str "foo", Space, Str "bar"], Space, Str "baz"]] So adjacent formattings and strings are appropriately grouped. Another set of operators for `(Reducible a) => (Many a)` are also included.