aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/RST.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-03-01Writers: Use gets to access MonadState where possible (#3480)Alexander Krotov1-14/+14
2017-02-11RST reader/writer: properly handle table captions.John MacFarlane1-4/+5
Currently the support for the `.. table` directive is a bit limited; we don't yet support the `widths` field. But at least you can have a proper captioned table.
2017-02-04Improved escaping in RST writer with smart option.John MacFarlane1-6/+20
2017-02-04Implemented +/-smart in rst writer.John MacFarlane1-3/+14
Moved unsmartify to Writers.Shared.
2017-01-25Revert "Added page breaks into Pandoc."John MacFarlane1-1/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Convert all writers to use PandocMonad.Jesse Rosenthal1-2/+3
Since PandocMonad is an instance of MonadError, this will allow us, in a future commit, to change all invocations of `error` to `throwError`, which will be preferable for the pure versions. At the moment, we're disabling the lua custom writers (this is temporary). This requires changing the type of the Writer in Text.Pandoc. Right now, we run `runIOorExplode` in pandoc.hs, to make the conversion easier. We can switch it to the safer `runIO` in the future. Note that this required a change to Text.Pandoc.PDF as well. Since running an external program is necessarily IO, we can be clearer about using PandocIO.
2017-01-25Adds support for pagebreaks (when it makes sense)Hubert Plociniczak1-0/+1
Update all writers to take into account page breaks. A straightforwad, far from complete, implementation of page breaks in selected writers. Readers will have to follow in the future as well.
2016-11-30Options: Removed writerStandalone, made writerTemplate a Maybe.John MacFarlane1-6/+6
Previously setting writerStandalone = True did nothing unless a template was provided in writerTemplate. Now a fragment will be generated if writerTemplate is Nothing; otherwise, the specified template will be used and standalone output generated. [API change]
2016-11-23Fixed some bugs in Pretty that caused blank lines in tables.John MacFarlane1-1/+1
The bugs caused spurious blank lines in grid tables when we had things like blankline $$ blankline Closes #3251.
2016-10-13Add support for the LineBlock element to writersAlbert Krewinkel1-2/+9
The following markup features are used to output the lines of the `LineBlock` element: - AsciiDoc: a `[verse]` block, - ConTeXt: text surrounded by `\startlines` and `\endlines`, - HTML: `div` with an per-element style setting to interpret the content as pre-wrapped, - Markdown: line blocks if the `line_blocks` extension is enabled, a simple paragraph with hard linebreaks otherwise, - Org: VERSE block, - RST: a line block, and - all other formats: a paragraph, containing hard linebreaks between lines. Custom lua writers should be updated to use the `LineBlock` element.
2016-01-05RST, Markdown writers: Fixed rendering of grid tables with blank rows.John MacFarlane1-1/+1
Closes #2615.
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-1/+9
Added threefold wrapping option. * Command line option: deprecated `--no-wrap`, added `--wrap=[auto|none|preserve]` * Added WrapOption, exported from Text.Pandoc.Options * Changed type of writerWrapText in WriterOptions from Bool to WrapOption. * Modified Text.Pandoc.Shared functions for SoftBreak. * Supported SoftBreak in writers. * Updated tests. * Updated README. Closes #1701.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-20/+48
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-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
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 MacFarlane1-1/+0
- 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-10-12RST writer: do header normalization only in "standalone" mode.John MacFarlane1-8/+5
If we're producing a fragment, just skip normalization. After all, the fragment might be somewhere in the middle of the document. It's more important for fragments to have consistency in rendering (so they can be pieced together) than to normalize. This closes #2394. It's simpler and more robust than my earlier fix.
2015-10-12Revert "RST writer: tweaks to header normalization."John MacFarlane1-22/+4
This reverts commit 476b383c578699567ac4630391a15855521ab3d4.
2015-10-12RST writer: tweaks to header normalization.John MacFarlane1-4/+22
These changes are intended to make the writer more useful to people who are processing small fragments, which may for example look like this: ### third level header from previous section ## second level header Previously such fragments got turned into two headers of the same level. The new algorithm avoids doing any normalization until we hit the minimal-level header in the fragment (here, the second level header). Closes #2394.
2015-09-19[RST Writer] Don't normalize heading levels below input minimumNikolay Yakimov1-1/+7
2015-08-13RST writer: ensure that `\ ` is inserted when needed...John MacFarlane1-0/+2
...before Cite and Span elements that begin with a "complex" element. Closes jgm/pandoc-citeproc#157.
2015-08-12RST writer: Don't insert `\ ` when complex expression in matched pairs.John MacFarlane1-3/+4
E.g. `` [:sup:`3`] `` is okay; you don't need `` [:sup:`3`\ ] ``.
2015-08-07Updated readers, writers and README for link attributemb211-4/+4
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-17/+45
(mb21)
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2015-04-16RST Writer: treat headings in block quotes, etc as rubricsNikolay Yakimov1-7/+29
2015-04-13RST Writer: Normalize headings to sequential levelsNikolay Yakimov1-1/+8
This is pretty much required by docutils.
2015-04-12Fixed toc depth in RST writer.John MacFarlane1-1/+1
Previously the depth was being rendered as a floating point number with a decimal point. Thanks to Nick Yakimov for noticing this.
2015-04-07RST writer: better handling of raw latex inline.John MacFarlane1-6/+12
We use `` :raw-latex:`...` `` and add a definition for this role to the template. Closes #1961.
2015-01-05ghc 7.10.1 RC1 requires specifying the type of String literals ↵Mark Wright1-3/+3
https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof...
2014-11-25Reverted "omit blank lines after list items," better fix for #1777.John MacFarlane1-6/+6
Now we do as before, including blank lines after list items in loose lists (even though RST doesn't care -- this is just a matter of visual appeal). But we chomp any excess whitespace after the last list item, which solves #1777.
2014-11-25RST writer: Omit blank lines after list items.John MacFarlane1-3/+3
They are optional in RST (except after the last list item, of course). Fixes #1777.
2014-11-25RST writer: Ensure blank line after figure.John MacFarlane1-1/+1
2014-11-19Fixed double-rendering of footnotes in RST tables.John MacFarlane1-3/+2
Closes #1769.
2014-09-30RST writer: Wrap line blocks with spaces before continuations.John MacFarlane1-1/+1
Improves on fix to #1656.
2014-09-29Don't wrap lines in rST line blocks.John MacFarlane1-1/+1
Closes #1656. Fixing pandoc to wrap the lines but insert spaces would be much more complicated. This at least makes the output semantically correct.
2014-08-04Use `stripPrefix` where appropriate.Artyom Kazak1-2/+3
2014-07-12Removed space at ends of lines in source.John MacFarlane1-1/+1
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-03-14RST writer: Avoid stack overflow with certain tables.John MacFarlane1-2/+6
Closes #1197. Note that there are still problems with the formatting of the tables inside tables with output produced from the input file in the original bug report. But this fixes the stack overflow problem.
2014-01-02RST writer: Ensure no blank line after def in definition list.John MacFarlane1-1/+1
Closes #992.
2013-10-16Use isURI instead of isAbsoluteURI.John MacFarlane1-2/+2
It allows fragments identifiers.
2013-10-11RST writer: Skip spaces after display math.John MacFarlane1-2/+8
Otherwise we get indentation problems, and part of the next paragraph may be rendered as part of the math.
2013-08-18Adjusted writers and tests for change in parsing of div/span.John MacFarlane1-1/+5
Textile, MediaWiki, Markdown, Org, RST will emit raw HTML div tags for divs. Otherwise Div and Span are "transparent" block containers.
2013-08-14Updated for removed unMeta, unFormat in pandoc-types.John MacFarlane1-2/+2
2013-08-10Adjustments for new Format newtype.John MacFarlane1-6/+9
2013-08-08Preliminary support for new Div and Span elements in writers.John MacFarlane1-0/+2
Currently these are "transparent" containers, except in HTML, where they produce div and span elements with attributes.
2013-07-01Created Text.Pandoc.Writers.Shared, improved metaToJSON.John MacFarlane1-4/+5
* Text.Pandoc.Writers.Shared contains shared functions used only in writers. * metaToJSON now takes a WriterOptions parameter, and will return an empty object if standalone is not specified.
2013-06-29Metadata changes: Variables now completely shadow metadata.John MacFarlane1-2/+2
Previously if you set a value both in metadata and with a variable, they'd be combined into a list. Now the variable replaces the value in document metadata. If many variables with the same name are set, a list is created. Shared: metaToJSON now has an argument for a variable list.
2013-06-27Writers: Use defField for defaults.John MacFarlane1-6/+6
This way explicitly specified fields not overridden. Fixes a problem e.g. with specifying a documentclass via the command line using -V.