aboutsummaryrefslogtreecommitdiff
path: root/src/Text
AgeCommit message (Collapse)AuthorFilesLines
2017-06-25Support `lang` attribute in OpenDocument and ODT writers.John MacFarlane3-18/+72
This adds the required attributes to the temporary styles, and also replaces existing language attributes in styles.xml. Support for lang attributes on Div and Span has also been added. Closes #1667.
2017-06-25Added InvalidLang to LogMessage.John MacFarlane1-0/+7
2017-06-25Text.Pandoc.Writers.Shared: export splitLang.John MacFarlane1-0/+19
2017-06-25Text.Pandoc.Writers.Shared: added getLang.John MacFarlane1-2/+13
2017-06-25Muse reader: Require space before and after '=' for code (#3758)Alexander Krotov1-3/+10
2017-06-24Readers.getReader, Writers.getWriter API change.John MacFarlane4-22/+20
Now these functions return a pair of a reader/writer and an Extensions, instead of building the extensions into the reader/writer. The calling code must explicitly set readerExtensions or writerExtensions using the Extensions returned. The point of the change is to make it possible for the calling code to determine what extensions are being used. See #3659.
2017-06-24Extensions: Monoid instance for Extensions.John MacFarlane1-1/+5
[API change]
2017-06-23Added comment in source.John MacFarlane1-0/+3
2017-06-23Markdown reader: interpret YAML metadata as Inlines when possible.John MacFarlane1-12/+13
If the metadata field is all on one line, we try to interpret it as Inlines, and only try parsing as Blocks if that fails. If it extends over one line (including possibly the `|` or `>` character signaling an indented block), then we parse as Blocks. This was motivated by some German users finding that date: '22. Juin 2017' got parsed as an ordered list. Closes #3755.
2017-06-23Markdown writer: make sure `plain`, `markdown_github`, etc. work for raw.John MacFarlane1-5/+9
Previously only `markdown` worked. Note: currently a raw block labeled `markdown_github` will be printed for any `markdown` format.
2017-06-23HTML writer: make sure html4, html5 formats work for raw blocks/inlines.John MacFarlane1-14/+26
2017-06-23Text.Pandoc.Extensions: Added `Ext_raw_attribute`.John MacFarlane2-9/+37
Documented in MANUAL.txt. This is enabled by default in pandoc markdown and multimarkdown.
2017-06-22EPUB writer: put title_page.xhtml in text/.John MacFarlane1-2/+2
2017-06-22EPUB writer: Fixed various things with new EPUB structure.John MacFarlane1-6/+6
2017-06-22Added `--epub-subdirectory` option.John MacFarlane1-0/+10
This specifies the subdirectory in the OCF container that holds the EPUB specific content. Closes #3720.
2017-06-22Added `writerEpubSubdirectory` to `WriterOptions`.John MacFarlane3-8/+13
[API change] The EPUB writer now takes its EPUB subdirectory from this option. Also added `PandocEpubSubdirectoryError` to `PandocError`. This is raised if the EPUB subdirectory is not all ASCII alphanumerics. See #3720.
2017-06-21Change default EPUB directory structure in OCF container.John MacFarlane1-11/+22
See #3720. We now put all EPUB related content in an EPUB/ subdirectory by default (later this will be configurable). mimetype META-INF/ com.apple.ibooks.display-options.xml container.xml EPUB/ <<--configurable-->> fonts/ <<--static-->> font.otf media/ <<--static-->> cover.jpg fig1.jpg styles/ <<--static-->> stylesheet.css content.opf toc.ncx text/ <<--static-->> ch001.xhtml
2017-06-20Removed an 'error' bomb.John MacFarlane1-1/+4
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane25-47/+51
Now we raise a proper error on template failure.
2017-06-20Odt reader: replaced collectRights with rights from Data.Either.John MacFarlane2-6/+2
2017-06-20Text.Pandoc.Templates: change type of renderTemplate'.John MacFarlane1-10/+14
Now it runs in PandocMonad and raises a proper PandocTemplateError if there are problems, rather than failing with uncatchable 'error'.
2017-06-20Text.Pandoc.Error: added PandocTemplateError.John MacFarlane1-0/+2
2017-06-20Move CR filtering from tabFilter to the readers.John MacFarlane17-104/+115
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-20Updated code example.John MacFarlane1-4/+10
2017-06-20Text.Pandoc.Lua - added DeriveDataTypeable for ghc 7.8.John MacFarlane1-3/+4
2017-06-20Lua: use registry to store function referencesAlbert Krewinkel1-29/+19
Using the registry directly instead of a custom table is cleaner and more efficient. The performance improvement is especially noticable when filtering on frequent elements like Str.
2017-06-20Lua: apply hslint suggestionsAlbert Krewinkel1-33/+32
2017-06-20Removed redundant import.John MacFarlane1-1/+0
2017-06-20App: issue proper errors instead of using 'error'.John MacFarlane1-2/+3
2017-06-20Text.Pandoc.Lua: throw LuaException instead of using 'error'.John MacFarlane2-8/+25
Text.Pandoc.App: trap LuaException and issue a PandocFilterError.
2017-06-20Muse reader: check that headers start at the first column (#3749)Alexander Krotov1-0/+2
2017-06-20Docbook, JATS, TEI writers: print INFO message when omitting interior header.John MacFarlane3-8/+14
This only applies to section headers inside list items, e.g., which were otherwise silently omitted. See #3750.
2017-06-20FB2 writer: don't fail with an error on interior headers (e.g. in list).John MacFarlane1-3/+5
Instead, omit them with an INFO message. Closes #3750.
2017-06-20Fixed footnotes in table captions.John MacFarlane1-16/+18
Note that if the table has a first page header and a continuation page header, the notes will appear only on the first occurrence of the header. Closes #2378.
2017-06-19Tracing: give less misleading line information with parseWithString.John MacFarlane2-3/+9
Previously positions would be reported past the end of the chunk. We now reset the source position within the chunk and report positions "in chunk."
2017-06-19Vimwiki reader: adjusted for changes in trace.John MacFarlane1-5/+3
2017-06-19Separated tracing from logging.John MacFarlane9-39/+40
Formerly tracing was just log messages with a DEBUG log level. We now make these things independent. Tracing can be turned on or off in PandocMonad using `setTrace`; it is independent of logging. * Removed `DEBUG` from `Verbosity`. * Removed `ParserTrace` from `LogMessage`. * Added `trace`, `setTrace` to `PandocMonad`.
2017-06-19Muse reader: fix list item continuation parsing (#3747)Alexander Krotov1-2/+2
2017-06-19Added Vimwiki reader (#3705).Yuchen Pei2-0/+658
* New module Text.Pandoc.Readers.Vimwiki, exporting readVimwiki [API change]. * New input format `vimwiki`. * New data file, `data/vimwiki.css`, for displaying the HTML produced by this reader and pandoc's HTML writer in the style of vimwiki's own HTML export.
2017-06-19Text.Pandoc.Writers.Math: export defaultMathJaxURL, defaultKaTeXURL.John MacFarlane2-4/+13
This will ensure that we only need to update these in one place. (Currently, for example, the mathjax URL is used in both App and trypandoc.) Closes #3685.
2017-06-19Add Muse reader (#3620)Alexander Krotov2-0/+580
2017-06-18Use revealjs's math plugin for mathjax.John MacFarlane1-1/+7
This is a thin wrapper around mathjax that makes math look better on revealjs. See https://github.com/hakimel/reveal.js/#mathjax We do this by setting the 'mathjax' boolean variable and using it in the revealjs template. Also, for revealjs and mathjax, we don't assign the usual thing to the 'math' variable, since it's handled by mathjax config. Closes #3743.
2017-06-18In producing PDFs, warn if the font is missing some characters.John MacFarlane2-13/+40
* Added `MissingCharacter` to `LogMessage` in Text.Pandoc.Logging. * Parse the (xe)latex log for missing character warnings and issue the warning. Closes #3742.
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane32-33/+33
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-12Merge branch 'master' into textcolor-supportschrieveslaach98-2712/+2671
2017-06-12Changed "extracting..." warning to a regular log message.John MacFarlane3-35/+25
This makes it sensitive to proper verbosity settings. (It is now treated as INFO rather than WARNING, so one doesn't get these messages for creation of tmp images while making a pdf.) API changes: * Removed extractMediaBag from Text.Pandoc.MediaBag. * Added Extracting as constructor for LogMessage.
2017-06-12Markdown writer: don't allow soft break in header.John MacFarlane1-0/+7
Closes #3736.
2017-06-11Don't allow backslash + newline to affect block structure.John MacFarlane1-3/+8
Note that as a result of this change, the following, which formerly produced a header with two lines separated by a line break, will now produce a header followed by a paragraph: # Hi\ there This may affect some existing documents that relied on this undocumented and unintended behavior. This change makes pandoc more consistent with other Markdown implementations, and with itself (since the two-space version of a line break doesn't work inside ATX headers, and neither version works inside Setext headers). Closes #3730.
2017-06-11Properly decode source from stdin.John MacFarlane1-2/+1
This should fix the appveyor failures.
2017-06-11Rewrote HTML reader to use Text throughout.John MacFarlane1-137/+194
- Export new NamedTag class from HTML reader. - Effect on memory usage is modest (< 10%).