aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/RST.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-01-10RST reader: better handling for headers with an anchor.John MacFarlane1-2/+12
Instead of creating a div containing the header, we put the id directly on the header. This way header promotion will work properly. Closes #4240.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-12-24RST reader: allow empty list items (as docutils does).John MacFarlane1-2/+2
Closes #4193.
2017-12-14RST reader: more accurate parsing of references.John MacFarlane1-36/+24
Previously we erroneously included the enclosing backticks in a reference ID (closes #4156). This change also disables interpretation of syntax inside references, as in docutils. So, there is no emphasis in `my *link*`_
2017-11-14RST reader: better support for 'container' directive.John MacFarlane1-1/+3
Create a div, incorporate name attribute and classes. Closes #4066.
2017-10-29Source code reformatting.John MacFarlane1-6/+5
2017-10-29More hlint fixes.John MacFarlane1-50/+46
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-21/+21
2017-09-30Removed writerSourceURL, add source URL to common state.John MacFarlane1-1/+1
Removed `writerSourceURL` from `WriterOptions` (API change). Added `stSourceURL` to `CommonState`. It is set automatically by `setInputFiles`. Text.Pandoc.Class now exports `setInputFiles`, `setOutputFile`. The type of `getInputFiles` has changed; it now returns `[FilePath]` instead of `Maybe [FilePath]`. Functions in Class that formerly took the source URL as a parameter now have one fewer parameter (`fetchItem`, `downloadOrRead`, `setMediaResource`, `fillMediaBag`). Removed `WriterOptions` parameter from `makeSelfContained` in `SelfContained`.
2017-08-27RST reader: Fixed `..include::` directive.John MacFarlane1-9/+9
Closes #3880.
2017-08-17RST reader/writer: support unknown interpreted text roles...John MacFarlane1-4/+2
...by parsing them as Span with "role" attributes. This way they can be manipulated in the AST. Closes #3407.
2017-08-10RST reader: implement csv-table directive.John MacFarlane1-45/+56
Most attributes are supported, including `:file:` and `:url:`. A (probably insufficient) test case has been added. Closes #3533.
2017-08-10RST reader: Basic support for csv-table directive.John MacFarlane1-0/+52
* Added Text.Pandoc.CSV, simple CSV parser. * Options still not supported, and we need tests. See #3533.
2017-08-09RST reader: reorganize block parsers for ~20% faster parsing.John MacFarlane1-3/+4
2017-08-09Removed spurious comments.John MacFarlane1-4/+0
2017-08-08RST reader: support :widths: attribute for table directive.John MacFarlane1-3/+13
2017-06-27RST reader: support anchors.John MacFarlane1-1/+23
E.g. `hello` .. _hello: paragraph This is supported by putting "paragraph" in a Div with id `hello`. Closes #262.
2017-06-27RST reader: Handle chained link definitions.John MacFarlane1-7/+20
For example, .. _hello: .. _goodbye: example.com Here both `hello` and `goodbye` should link to `example.com`. Fixes the first part of #262.
2017-06-20Move CR filtering from tabFilter to the readers.John MacFarlane1-1/+1
The readers previously assumed that CRs had been filtered from the input. Now we strip the CRs in the readers themselves, before parsing. (The point of this is just to simplify the parsers.) Shared now exports a new function `crFilter`. [API change] And `tabFilter` no longer filters CRs.
2017-06-10Changed all readers to take Text instead of String.John MacFarlane1-2/+5
Readers: Renamed StringReader -> TextReader. Updated tests. API change.
2017-05-28RST reader: use anyLineNewline in rawListItem (#3702)Alexander Krotov1-2/+2
2017-05-24Parsing: Provide parseFromString'.John MacFarlane1-25/+25
This is a verison of parseFromString specialied to ParserState, which resets stateLastStrPos at the end. This is almost always what we want. This fixes a bug where `_hi_` wasn't treated as emphasis in the following, because pandoc got confused about the position of the last word: - [o] _hi_ Closes #3690.
2017-05-23RST reader: reformatting (code line length).John MacFarlane1-23/+47
2017-05-23RST Reader: parse list table directive (#3688)keiichiro shikano1-1/+28
Closes #3432.
2017-05-22Move indentWith to Text.Pandoc.Parsing (#3687)Alexander Krotov1-9/+0
2017-05-20RST reader: make use of anyLineNewline (#3686)Alexander Krotov1-2/+1
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-2/+2
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-02Generalize tableWith, gridTableWithAlbert Krewinkel1-3/+9
The parsing functions `tableWith` and `gridTableWith` are generalized to work with more parsers. The parser state only has to be an instance of the `HasOptions` class instead of requiring a concrete type. Block parsers are required to return blocks wrapped into a monad, as this makes it possible to use parsers returning results wrapped in `Future`s.
2017-03-19RST reader: recurse into bodies of unknown directives.John MacFarlane1-1/+2
In most cases it's better to preserve the content than to emit it. This isn't guaranteed to have good results; it will fail spectacularly for unknown raw or verbatim directives. See #3432.
2017-03-10Removed normalizeSpaces from Text.Pandoc.Shared.John MacFarlane1-0/+6
Rewrote functions in RST reader and writer to avoid the need for it. Closes #1530.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-26/+26
2017-03-03RST reader: support RST-style citations.John MacFarlane1-14/+54
The citations appear at the end of the document as a definition list in a special div with id `citations`. Citations link to the definitions. Added stateCitations to ParserState. Closes #853.
2017-03-02RST reader: Handle multiline cells in simple tables.John MacFarlane1-8/+16
Closes #1166.
2017-02-28RST reader: implemented implicit internal header links.John MacFarlane1-18/+42
Cloess #3475.
2017-02-26RST reader: support scale and align attributes of images.John MacFarlane1-5/+25
Closes #2662.
2017-02-17Fixed repeated log messages in RST reader.John MacFarlane1-13/+14
See #3447. To complete fixes on this issue, we need to do the same for the other readers. Note that the changes required are minimal -- add reportLogMessages to the end of the main parser, and replace report with logMessage. (except for trace)
2017-02-15Fix indirect hyperlink targets. Closes #512.John MacFarlane1-23/+33
2017-02-11RST reader: Support `.. line-block` directive.John MacFarlane1-2/+7
This is deprecated but may still be in older documents.
2017-02-11RST reader/writer: properly handle table captions.John MacFarlane1-1/+1
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-11RST reader: Initial support of .. table directive.John MacFarlane1-4/+21
This allows adding captions to tables.
2017-02-11Fixed small bug in RST list parsing.John MacFarlane1-3/+2
See #3432. Previously the parser didn't handle properly this case: * - a - b * - c - d
2017-02-11Use new warnings throughout the code base.John MacFarlane1-33/+28
2017-02-07RST reader: Improved admonition support.John MacFarlane1-6/+8
* We no longer add an "admonition" class, we just use the class for the type of admonition, "note" for example. * We put the word corresponding to the label in a paragraph inside a div at the beginning of the admonition with class "admonition-title". * This is about as close as we can get to RST's own output. See #223.
2017-02-07Refactored some files formerly in LaTeX reader.John MacFarlane1-12/+4
* Export readFileFromDirs from Class. * Export insertIncludedFile from Parsing. Simplified code in LaTeX/RST readers.
2017-01-27Shared: rename compactify', compactify'DL -> compactify, compactifyDL.John MacFarlane1-2/+2
2017-01-27Removed Shared.compactify.John MacFarlane1-8/+13
Changed signatures on Parsing.tableWith and Parsing.gridTableWith.
2017-01-25Removed readerSmart and the --smart option; added Ext_smart extension.John MacFarlane1-1/+1
Now you will need to do -f markdown+smart instead of -f markdown --smart This change opens the way for writers, in addition to readers, to be sensitive to +smart, but this change hasn't yet been made. API change. Command-line option change. Updated manual.
2017-01-25Removed `--normalize` option and normalization functions from Shared.John MacFarlane1-1/+1
* Removed normalize, normalizeInlines, normalizeBlocks from Text.Pandoc.Shared. These shouldn't now be necessary, since normalization is handled automatically by the Builder monoid instance. * Remove `--normalize` command-line option. * Don't use normalize in tests. * A few revisions to readers so they work well without normalize.
2017-01-25RST reader: rebase-related fixes to warnings.John MacFarlane1-13/+12
2017-01-25RST reader: removed now unnecessary lifts.John MacFarlane1-8/+7