aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-07-07Use takeP in LaTeX reader.newlatex2John MacFarlane
2017-07-07Parsing: added takeP, takeWhileP for efficient parsing of [Char].John MacFarlane
2017-07-07Fixed tests.John MacFarlane
2017-07-07LaTeX reader: fixed regression with control sequences in options.John MacFarlane
2017-07-07Allow `\newcommand\foo{blah}` without braces.John MacFarlane
2017-07-07Added test cases for #1390, #2118, #3236, #3779, #934, #982.John MacFarlane
Not all passing yet.
2017-07-07Removed dead code.John MacFarlane
2017-07-07Fixed import warning.John MacFarlane
2017-07-06Rewrote LaTeX reader with proper tokenization.John MacFarlane
This rewrite is primarily motivated by the need to get macros working properly (#982, #934, #3779, #3236, #1390, #2888, #2118). A side benefit is that the reader is significantly faster (27s -> 19s in one benchmark, and there is a lot of room for further optimization). We now tokenize the input text, then parse the token stream. Macros modify the token stream, so they should now be effective in any context, including math. Thus, we no longer need the clunky macro processing capacities of texmath. A custom state LaTeXState is used instead of ParserState. This, plus the tokenization, will require some rewriting of the exported functions rawLaTeXInline, inlineCommand, rawLaTeXBlock. * Added Text.Pandoc.Readers.LaTeX.Types (new exported module). Exports Macro, Tok, TokType, Line, Column. [API change] * Text.Pandoc.Parsing: adjusted type of `insertIncludedFile` so it can be used with token parser. * Removed old texmath macro stuff from Parsing. Use Macro from Text.Pandoc.Readers.LaTeX.Types instead. * Removed texmath macro material from Markdown reader. * Changed types for Text.Pandoc.Readers.LaTeX's rawLaTeXInline and rawLaTeXBlock. (Both now return a String, and they are polymorphic in state.) * Added orgMacros field to OrgState. [API change] * Removed readerApplyMacros from ReaderOptions. Now we just check the `latex_macros` reader extension.
2017-07-06Logging: added MacroAlreadyDefined.John MacFarlane
2017-06-30MANUAL: document ibooks specific epub metadata.John MacFarlane
2017-06-30Allow ibooks-specific metadata in epubs. Closes #2693.John MacFarlane
You can now have the following fields in your YAML metadata, and it will be treated appropriately in the generated EPUB. ``` ibooks: version: 1.3.4 specified-fonts: false ipad-orientation-lock: portrait-only iphone-orientation-lock: landscape-only binding: true scroll-axis: vertical ``` This commit also fixes a regression in stylesheet paths.
2017-06-30Updated stack.pkg.yaml.John MacFarlane
2017-06-30Removed `hard_line_breaks` extension from `markdown_github`.John MacFarlane
GitHub has two Markdown modes, one for long-form documents like READMEs and one for short things like issue coments. In issue comments, a line break is treated as a hard line break. In README, wikis, etc., it is treated as a space as in regular Markdown. Since pandoc is more likely to be used to convert long-form documents from GitHub Markdown, `-hard_line_breaks` is a better default. Closes #3594.
2017-06-30Make `east_asian_line_breaks` affect all readers/writers.John MacFarlane
Closes #3703.
2017-06-30Updated jats tests for new texmath version.John MacFarlane
2017-06-30Use latest texmath.John MacFarlane
2017-06-30Markdown writer: Ensure that `+` and `-` are escaped properly...John MacFarlane
so they don't cause spurious lists. Previously they were only if succeeded by a space, not if they were at end of line. Closes #3773.
2017-06-29Added parameter for user data directory to runLuaFilter.John MacFarlane
in Text.Pandoc.Lua. Also to pushPandocModule. This change allows users to override pandoc.lua with a file in their local data directory, adding custom functions, etc. @tarleb, if you think this is a bad idea, you can revert this. But in general our data files are all overridable.
2017-06-29data/pandoc.lua: regularize constructors.John MacFarlane
We now use Pandoc instead of Doc (though Doc remains a deprecated Synonym), and we deprecate DoubleQuoted, SingleQuoted, InlineMath, and DisplayMath.
2017-06-29Text.Pandoc.Lua: more code simplification.John MacFarlane
Also, now we check before running walkM that the function table actually does contain something relevant. E.g. if your filter just defines Str, there's no need to run walkM for blocks, meta, or the whole document. This should help performance a bit (and it does, in my tests).
2017-06-29Lua filters: Remove special treatment of Quoted, Math.John MacFarlane
No more SingleQuoted, DoubleQuoted, InlineMath, DisplayMath. This makes everything uniform and predictable, though it does open up a difference btw lua filters and custom writers.
2017-06-29Text.Pandoc.Lua: refactored to remove duplicated code.John MacFarlane
2017-06-29Text.Pandoc.Lua: use generics to reduce boilerplate.John MacFarlane
I tested this with the str.lua filter on MANUAL.txt, and I could see no significant performance degradation. Doing things this way will ease maintenance, as we won't have to manually modify this module when types change. @tarleb, do we really need special cases for things like DoubleQuoted and InlineMath?
2017-06-28Added link-table example to doc/lua-filters.md.John MacFarlane
2017-06-28Make `papersize: a4` work regardless of the case of `a4`.John MacFarlane
It is converted to `a4` in LaTeX and `A4` in ConTeXt.
2017-06-28LaTeX template: added `natbiboptions` variable.John MacFarlane
Closes #3768.
2017-06-28Muse reader: parse indented blockquotes (#3769)Alexander Krotov
2017-06-28LaTeX writer: fixed detection of otherlangs.John MacFarlane
We weren't recursing into inline contexts. Closes #3770.
2017-06-27Text.Pandoc.Lua: catch lua errors in filter functionsAlbert Krewinkel
Replace lua errors with `LuaException`s.
2017-06-27Text.Pandoc.Lua: keep element unchanged if filter returns nilAlbert Krewinkel
This was suggested by jgm and is consistent with the behavior of other filtering libraries.
2017-06-27Text.Pandoc.Lua: simplify filter function runnerAlbert Krewinkel
The code still allowed to pass an arbitrary number of arguments to the filter function, as element properties were passed as function arguments at some point. Now we only pass the element as the single arg, so the code to handle multiple arguments is no longer necessary.
2017-06-27data/pandoc.lua: add accessors to Table elementsAlbert Krewinkel
2017-06-27Require nonempty alt text for `implicit_figures`.John MacFarlane
A figure with an empty caption doesn't make sense. Closes #2844.
2017-06-27RST reader: support anchors.John MacFarlane
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 MacFarlane
For example, .. _hello: .. _goodbye: example.com Here both `hello` and `goodbye` should link to `example.com`. Fixes the first part of #262.
2017-06-27Docx writer: Allow 9 list levels.John MacFarlane
Closes #3519.
2017-06-27Removed redundant element from data/docx/word/numbering.xml.John MacFarlane
The elements we need are generated when the document is compiled; this didn't do anything.
2017-06-27HTML reader: Use the lang value of <html> to set the lang meta value. (#3765)bucklereed
* HTML reader: Use the lang value of <html> to set the lang meta value. * Fix for pre-AMP environments.
2017-06-26OpenDocument/ODT writer: Added support for table of contents.John MacFarlane
Closes #2836. Thanks to @anayrat.
2017-06-26Support `--toc` in `opendocument`/`odt`.John MacFarlane
2017-06-26Use `table-of-contents` for contents of toc, make `toc` a boolean.John MacFarlane
Changed markdown, rtf, and HTML-based templates accordingly. This allows you to set `toc: true` in the metadata; this previously produced strange results in some output formats. Closes #2872. For backwards compatibility, `toc` is still set to the toc contents. But it is recommended that you update templates to use `table-of-contents` for the toc contents and `toc` for a boolean flag.
2017-06-26Muse writer: fix hlint errors (#3764)Alexander Krotov
2017-06-26LaTeX writer: use BCP47 parser.John MacFarlane
2017-06-26parseBCP47: Parse extensions and private-use as variants.John MacFarlane
Even though officially they aren't. This suffices for our purposes.
2017-06-26minor updates to vimwiki reader. (#3759)Yuchen Pei
- updated comments in Vimwiki.hs to reflect current status of implementation - added vimwiki to trypandoc
2017-06-26Muse reader: fix horizontal rule parsing (#3762)Alexander Krotov
Do not parse 3 dashes as horizontal rule and allow whitespace after rule
2017-06-26Muse reader: simplify para implementation (#3761)Alexander Krotov
2017-06-25BCP47: split toLang from getLang, rearranged types.John MacFarlane
2017-06-25Refactored ConTeXt writer to use BCP47.John MacFarlane
BCP47 - consistent case for BCP47 fields (e.g. uppercase for region).