summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Pretty.hs
AgeCommit message (Collapse)Author
2019-08-25Use new doctemplates, doclayout.John MacFarlane
+ Remove Text.Pandoc.Pretty; use doclayout instead. [API change] + Text.Pandoc.Writers.Shared: remove metaToJSON, metaToJSON' [API change]. + Text.Pandoc.Writers.Shared: modify `addVariablesToContext`, `defField`, `setField`, `getField`, `resetField` to work with Context rather than JSON values. [API change] + Text.Pandoc.Writers.Shared: export new function `endsWithPlain` [API change]. + Use new templates and doclayout in writers. + Use Doc-based templates in all writers. + Adjust three tests for minor template rendering differences. + Added indentation to body in docbook4, docbook5 templates. The main impact of this change is better reflowing of content interpolated into templates. Previously, interpolated variables were rendered independently and intepolated as strings, which could lead to overly long lines. Now the templates interpolated as Doc values which may include breaking spaces, and reflowing occurs after template interpolation rather than before.
2019-03-28Use strict instead of lazy sum.John MacFarlane
sum is lazy; replace with `foldl' (+) 0` to avoid stack overflow in Text.Pandoc.Pretty with very long strings. Closes #5401.
2019-03-01Remove license boilerplate.John MacFarlane
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2018-11-06Text.Pandoc.Pretty: don't render BreakingSpace at end of line...John MacFarlane
or beginning of line. Closes #5050.
2018-11-01Change 'groff' -> 'roff'.John MacFarlane
These formats (man, ms) are not groff-specific.
2018-10-23Simplify Text.Pandoc.Pretty.offsetAlexander Krotov
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-16Monoid/Semiground cleanup relying on custom Prelude.John MacFarlane
2018-03-16Pretty: Semigroup instance for Doc with base >= 4.9.John MacFarlane
2018-01-05Update copyright notices to include 2018Albert Krewinkel
2017-11-01hlintAlexander Krotov
2017-10-28Try to fix imports for older ghc.John MacFarlane
2017-10-28Change order of imports to satisfy older ghc.John MacFarlane
2017-10-27hlint changes.John MacFarlane
2017-08-08Fix `blanklines' documentation (#3843)Alexander
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-05-27Pretty: Eq instance for Doc.John MacFarlane
2017-05-13Update dates in copyright noticesAlbert Krewinkel
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-03-22Revert "Experimental change to charWidth in Pretty."John MacFarlane
This reverts commit c59e31722471ce3a67a41413de4e6a5ecfd00ba1.
2017-03-22Experimental change to charWidth in Pretty.John MacFarlane
Hunch that this might help with #3526.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane
2017-03-03Pretty: don't error for blocks of size < 1.John MacFarlane
Instead, resize to 1. Note, this (together with earlier changes to the Markdown writer) seems to fix #1785. The table renders as garbage, but pandoc now completes the conversion quickly and doesn't get tied up.
2017-02-23Pretty: simplified definition of realLength.John MacFarlane
2016-12-05Pretty: Added `afterBreak`.John MacFarlane
This makes it possible to insert escape codes for content that needs escaping at the beginning of a line.
2016-11-23Fixed some bugs in Pretty that caused blank lines in tables.John MacFarlane
The bugs caused spurious blank lines in grid tables when we had things like blankline $$ blankline Closes #3251.
2016-11-19Added function to compute the minimal width of a documentBjörn Peemöller
2016-11-19Added error message for illegal call to Pretty.blockBjörn Peemöller
2016-09-02Remove an inline monad compatibility macro.Jesse Rosenthal
2016-09-02Remove Compat.MonoidJesse Rosenthal
This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
2016-07-14Fixed compiler warnings.John MacFarlane
2016-03-22Updated copyright dates to include 2016.John MacFarlane
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane
mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.
2015-11-09Restored Text.Pandoc.Compat.Monoid.John MacFarlane
Don't use custom prelude for latest ghc. This is a better approach to making 'stack ghci' and 'cabal repl' work. Instead of using NoImplicitPrelude, we only use the custom prelude for older ghc versions. The custom prelude presents a uniform API that matches the current base version's prelude. So, when developing (presumably with latest ghc), we don't use a custom prelude at all and hence have no trouble with ghci. The custom prelude no longer exports (<>): we now want to match the base 4.8 prelude behavior.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-10-14Use custom Prelude to avoid compiler warnings.John MacFarlane
- The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
2015-07-25Pretty: comment fix (mb21).John MacFarlane
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane
2015-02-18Remove partial function from PrettyMatthew Pickering
2014-12-06Text.Pandoc.Pretty: Improve performance of realLengthMatthew Pickering
Eliminates memory usage and twofold increase in speed.
2014-10-20Pretty: Make CR + BLANKLINE = BLANKLINE.John MacFarlane
This fixes an extra blank line we were getting at the end of markdown fragments (as well as rst, org, etc.) Closes #1705.
2014-07-27Text.Pandoc.Pretty: added blanklines.John MacFarlane
This ensures a certain number of blanklines (and no more) in output.
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel
2014-02-06Removed RenderState datatype context.Merijn Verstraaten
Reasoning: - It's not Haskell2010 - It breaks some tools - Doesn't actually do anything - RenderState doesn't even have a Monoid instance
2014-01-02Pretty: Added nestle. API change, minor version bump to 1.12.3.John MacFarlane
2013-08-04Remove CPP from default-extensions; add pragmas to modules as needed.John MacFarlane
2013-02-28Pretty: Fixed chomp so it works inside Prefixed elements.John MacFarlane
2013-02-28Pretty: Better Show instance for debugging purposes.John MacFarlane
2012-08-13Pretty: Fixed bug that caused combining characters to be dropped.John MacFarlane