aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/RST.hs
AgeCommit message (Collapse)AuthorFilesLines
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.
2013-06-24Use new flexible metadata type.John MacFarlane1-25/+37
* Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this.
2013-04-14Markdown/RST writers: Only autolink absolute URIs.John MacFarlane1-3/+5
This fixes a regression and closes #830. $ echo '<a href="x">x</a>' | pandoc -f html -t markdown <x>
2013-03-06Support :number-lines: in RST code output.John MacFarlane1-2/+6
2013-01-26RST writer: Use `.. code:: language` for code blocks with language.John MacFarlane1-1/+6
Closes #721. Also fixed whitespace in lhs tests.
2013-01-15Use 'fig:' instead of '\SOH' in title to indicate figure.John MacFarlane1-2/+2
Revises 1a4b47e93368bfbd31daccdfedbd9527ee740201
2013-01-14Implemented Ext_implicit_figures.John MacFarlane1-1/+2
* In markdown reader, add a '\1' character to the beginning of the title of an image that is alone in its paragraph, if implicit_figures extension is selected. * In writers, check for Para [Image alt (src,'\1':tit)] and treat it as a figure if possible. * Updated tests. This is a bit of a hack, but it allows us to make implicit_figures an extension of the markdown reader, rather than the writers.
2013-01-13RST writer: Fixes bug with links with duplicate text.John MacFarlane1-6/+10
We now (a) use anonymous links for links with inline URLs, and (b) use an inline link instead of a reference link if the reference link would require a label that has already been used for a different link. Closes #511.