summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/RST.hs
Commit message (Collapse)AuthorAge
* Created Text.Pandoc.Writers.Shared, improved metaToJSON.John MacFarlane2013-07-01
| | | | | | | * 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.
* Metadata changes: Variables now completely shadow metadata.John MacFarlane2013-06-29
| | | | | | | | | 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.
* Writers: Use defField for defaults.John MacFarlane2013-06-27
| | | | | | | This way explicitly specified fields not overridden. Fixes a problem e.g. with specifying a documentclass via the command line using -V.
* Use new flexible metadata type.John MacFarlane2013-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Markdown/RST writers: Only autolink absolute URIs.John MacFarlane2013-04-14
| | | | | | | This fixes a regression and closes #830. $ echo '<a href="x">x</a>' | pandoc -f html -t markdown <x>
* Support :number-lines: in RST code output.John MacFarlane2013-03-06
|
* RST writer: Use `.. code:: language` for code blocks with language.John MacFarlane2013-01-26
| | | | | Closes #721. Also fixed whitespace in lhs tests.
* Use 'fig:' instead of '\SOH' in title to indicate figure.John MacFarlane2013-01-15
| | | | Revises 1a4b47e93368bfbd31daccdfedbd9527ee740201
* Implemented Ext_implicit_figures.John MacFarlane2013-01-14
| | | | | | | | | | | | * 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.
* RST writer: Fixes bug with links with duplicate text.John MacFarlane2013-01-13
| | | | | | | | | 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.
* RST writer: Properly handle images with no alt text.John MacFarlane2013-01-13
| | | | Closes #678.
* RST writer: Allow soft breaks w continuations in line blocks.John MacFarlane2013-01-13
|
* Use line block in RST writer when a paragraph contains linebreaks.John MacFarlane2013-01-13
| | | | | Previously linebreaks weren't supported in RST, since RST has no native linebreak construct.
* Added Attr field to Header.John MacFarlane2013-01-09
| | | | | | | | | | Previously header ids were autogenerated by the writers. Now they are generated (unless supplied explicitly) in the markdown parser, if the `header_identifiers` extension is selected. In addition, the textile reader now supports id attributes on headers.
* Don't put the text of an autolink in Code font.John MacFarlane2013-01-06
|
* Changed --toc-level to --toc-depth.John MacFarlane2013-01-05
|
* Implemented --toc-level for rst.John MacFarlane2013-01-05
|
* RST writer: Don't add ":align: center" to figures.John MacFarlane2012-11-04
|
* RST writer: Fixed hyperlinked images.John MacFarlane2012-09-16
| | | | | | | * Use :target: field when you have a simple linked image. * Don't wrap the reference. * Cleaned up code. * Closes #611.
* Changes to literate haskell options.John MacFarlane2012-08-08
| | | | | | | | | | | - Removed writerLiterateHaskell from WriterOptions. - Removed readerLiterateHaskell from ReaderOptions. - Added Ext_literate_haskell to Extensions. Test for this instead of the above. - Removed failUnlessLHS from Shared. Note: At this point, +lhs and .lhs extension no longer has any effect. Need to fix.
* Moved WriterOptions and associated types Shared -> Options.John MacFarlane2012-07-26
|
* Fixed whitespace errors.John MacFarlane2012-07-26
|
* RST writer: Don't wrap link references.John MacFarlane2012-04-21
| | | | Closes #487.
* RST writer: Better handling of inline formatting.John MacFarlane2012-03-24
| | | | | | | | | * `hi*there*hi` now gets rendered properly as `hi\ *there*\ hi` * Unnecessary '\ ' are avoided around :math:, :sub:, :sup: * Implemented most of the rules in http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules, though some unnecessary '\ ' may be inserted when unicode quotes are used.
* Don't wrap headers in markdown or rst.John MacFarlane2012-02-08
|
* Support for math in RST reader and writer.John MacFarlane2011-12-31
| | | | | | | | | | | | | | | | Inline math uses the :math:`...` construct. Display math uses .. math:: ... or if multilin .. math:: ... These seem to be supported now by rst2latex.py.
* Support Sphinx-style math in RST writer.John MacFarlane2011-12-30
| | | | http://sphinx.pocoo.org/latest/ext/math.html
* Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings.John MacFarlane2011-12-27
|
* Shared: Removed unescapeURI, modified escapeURI.John MacFarlane2011-12-02
| | | | | | | | | | | | escapeURI now only escapes space characters, leaving unicode characters as they are, instead of converting them to octets and URL-encoding them, as before. This gives more readable URIs. User agents now do the percent-encoding themselves. URIs are no longer unescaped at all on conversion to markdown, asciidoc, rst, org. Closes #349.
* RST writer: Fixed bug involving empty table cells.John MacFarlane2011-09-05
| | | | | | | isSimple was being calculated in a way that assumed there were no non-empty cells. Resolves #299. Thanks to rmunoz for reporting the bug.
* Add support for attributes in inline Code.John MacFarlane2011-01-26
| | | | | | | | Additional related changes: * URLs in Code in autolinks now use class "url". * Require highlighting-kate 0.2.8.2, which omits the final <br/> tag, essential for inline code.
* Bumped version to 1.8; depend on pandoc-types 1.8.John MacFarlane2011-01-26
| | | | | | | The old TeX, HtmlInline and RawHtml elements have been removed and replaced by generic RawInline and RawBlock elements. All modules updated to use the new raw elements.
* RST writer: blank line after literate Haskell code block.John MacFarlane2011-01-06
|
* Added new prettyprinting module.John MacFarlane2010-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added Text.Pandoc.Pretty. This is better suited for pandoc than the 'pretty' package. One advantage is that we now get proper wrapping; Emph [Inline] is no longer treated as a big unwrappable unit. Previously we only got breaks for spaces at the "outer level." We can also more easily avoid doubled blank lines. Performance is significantly better as well. * Removed Text.Pandoc.Blocks. Text.Pandoc.Pretty allows you to define blocks and concatenate them. * Modified markdown, RST, org readers to use Text.Pandoc.Pretty instead of Text.PrettyPrint.HughesPJ. * Text.Pandoc.Shared: Added writerColumns to WriterOptions. * Markdown, RST, Org writers now break text at writerColumns. * Added --columns command-line option, which sets stColumns and writerColumns. * Table parsing: If the size of the header > stColumns, use the header size as 100% for purposes of calculating relative widths of columns.
* Made spacing at end of output more consistent.John MacFarlane2010-07-20
| | | | | | | | | | | | Previously some of the writers added spurious whitespace. This has been removed, resolving Issue #232. NOTE: If your application combines pandoc's output with other text, for example in a template, you may need to add spacing. For example, a pandoc-generated markdown file will not have a blank line after the final block element. If you are inserting it into another markdown file, you will need to make sure there is a blank line between it and the next block element.
* Use unicode for smart punctuation in plain, markdown, rst formats.John MacFarlane2010-06-30
|
* Made KeyTable a map instead of an association list.John MacFarlane2010-05-08
| | | | | | | | * This affects the RST and Markdown readers. * The type for stateKeys in ParserState has also changed. * Pandoc, Meta, Inline, and Block have been given Ord instances. * Reference keys now have a type of their own (Key), with its own Ord instance for case-insensitive comparison.
* Markdown, RST writers: unescape URI in links, to make them readable.John MacFarlane2010-03-23
| | | | (Since they aren't required to be escaped in these formats.)
* Updated copyright notices.John MacFarlane2010-03-23
|
* RST writer: handle images in figures.fiddlosopher2010-03-18
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1899 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use template variables for include-before/after.fiddlosopher2010-03-13
| | | | | | | | | | | | * These options now imply -s; previously they worked also in fragment mode. * Users can now adjust position of include-before and include-after text in the templates. * Default position of include-before moved back (as it originally was) before table of contents. * Resolves Issue #217. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1883 788f1e2b-df1e-0410-8736-df70ead52e1b
* RST writer: Fixed headerless tables.fiddlosopher2010-03-11
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1879 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed redundant imports (found by ghc 6.12).fiddlosopher2009-12-31
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1750 788f1e2b-df1e-0410-8736-df70ead52e1b
* Improved RST writer.fiddlosopher2009-12-31
| | | | | | Updated test suite. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1725 788f1e2b-df1e-0410-8736-df70ead52e1b
* Fixed RST writer to use new templates.fiddlosopher2009-12-31
| | | | | | | | | Use stHasMath instead of stIncludes. This gives the user more control over how the math directive is defined. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1715 788f1e2b-df1e-0410-8736-df70ead52e1b
* Changed Meta author and date types to Inline lists instead of Strings.fiddlosopher2009-12-31
| | | | | | | | | | | | Meta [Inline] [[Inline]] [Inline] rather than Meta [Inline] [String] String. This is a breaking change for libraries that use pandoc and manipulate the metadata. Changed .native files in test suite for new Meta format. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1699 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed unneeded writer options; use template variables instead.fiddlosopher2009-12-31
| | | | | | | | | Removed writerIncludeAfter, writerIncludeBefore, writerTitlePrefix, writerHeader. Removed corresponding fields of Options structure in pandoc.hs. The options now set template variables (writerVariables) instead. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1684 788f1e2b-df1e-0410-8736-df70ead52e1b
* Improved syntax for markdown definition lists.fiddlosopher2009-12-07
| | | | | | | | | | | | | | | | | | | Definition lists are now more compatible with PHP Markdown Extra. Resolves Issue #24. + You can have multiple definitions for a term (but still not multiple terms). + Multi-block definitions no longer need a column before each block (indeed, this will now cause multiple definitions). + The marker no longer needs to be flush with the left margin, but can be indented at or two spaces. Also, ~ as well as : can be used as the marker (this suggestion due to David Wheeler.) + There can now be a blank line between the term and the definitions. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1656 788f1e2b-df1e-0410-8736-df70ead52e1b
* Better looking simple tables. Resolves Issue #180.fiddlosopher2009-11-28
| | | | | | | | | | | | | | | * Markdown reader: simple tables are now given column widths of 0. * Column width of 0 is interpreted as meaning: use default column width. * Writers now include explicit column width information only for multiline tables. (Exception: RTF writer, which requires column widths. In this case, columns are given equal widths, adding up to the text width.) * Simple tables should now look better in most output formats. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1631 788f1e2b-df1e-0410-8736-df70ead52e1b
* Specially mark code blocks that were "literate" in the input.fiddlosopher2009-11-03
| | | | | | | | | | | They can then be treated differently in the writers. This allows authors to distinguish bits of the literate program they are writing from source code examples, even if the examples are marked as Haskell for highlighting. Resolves Issue #174. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1618 788f1e2b-df1e-0410-8736-df70ead52e1b