aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-04-14Lua filter: Re-order code of stack value instancesAlbert Krewinkel1-106/+122
2017-04-14Lua filter: use lua strings for nullary constructorsAlbert Krewinkel2-124/+41
Lua string are used to represent nullary data constructors. The previous table-based representation was based on the JSON serialization, but can be simplified. This also matches the way those arguments are passed to custom writers.
2017-04-14Avoid repeating StackValue instances definitionsAlbert Krewinkel5-156/+166
The lua filters and custom lua writer system defined very similar StackValue instances for strings and tuples. These instance definitions are extracted to a separate module to enable sharing.
2017-04-14Extract lua helper functions into Lua.Util moduleAlbert Krewinkel5-131/+152
2017-04-14Use lua bools and strings for MetaBool, MetaStringAlbert Krewinkel1-2/+2
Native lua booleans and strings are used to represent MetaBool and MetaString values. This is more natural than the previous table-based representation. The old lua representation can still be read back to haskell, ensuring compatibility with the `pandoc.MetaBool` and `pandoc.MetaString` lua constructors.
2017-04-14Merge pull request #3569 from tarleb/lua-destructured-filter-functionsAlbert Krewinkel11-214/+978
Destructuring lua filter functions
2017-04-14Lua filter: use destructured functions for block filtersAlbert Krewinkel3-21/+26
Filtering functions take element components as arguments instead of the whole block elements. This resembles the way elements are handled in custom writers.
2017-04-14Drop dependency on hslua-aesonAlbert Krewinkel6-23/+15
Pushing values to the lua stack via custom functions is faster and more flexible.
2017-04-14Push blocks via lua constructors and constantsAlbert Krewinkel2-78/+336
All element creation tasks are handled by lua functions defined in the pandoc module.
2017-04-14s/safed/saved/Alexander Krotov1-1/+1
2017-04-14Push inlines via lua constructors and constantsAlbert Krewinkel1-41/+29
All element creation tasks are handled in the lua module.
2017-04-13Use lua constructors to push meta valuesAlbert Krewinkel4-34/+198
2017-04-13Improve lua module documentationAlbert Krewinkel1-140/+315
2017-04-12Use lowercase a4 for latex papersize example.John MacFarlane1-1/+1
2017-04-12Lua module: provide multi-param Inline constructorsAlbert Krewinkel1-4/+160
Instead of taking only a single argument containing the pre-packed element contents, `Inline` constructors now take the same arguments as the respective filter and `Custom` writer function
2017-04-12Lua filter: use destructured functions for inline filtersAlbert Krewinkel2-37/+63
Instead of taking the whole inline element, forcing users to destructure it themselves, the components of the elements are passed to the filtering functions.
2017-04-12Man writer: Fix handling of nested font commands.John MacFarlane3-13/+56
Previously pandoc emitted incorrect markup for bold + italic, for example, or bold + code. Closes #3568.
2017-04-11Lua filter: use custom StackValue Inline instanceAlbert Krewinkel3-31/+156
Inline elements are no longer pushed and pulled via aeson's Value.
2017-04-10Docx writer: don't take "distArchive" from datadir.John MacFarlane1-2/+3
The docx writer takes components from the distribution's version of reference.docx when it can't find them in a user's custom reference.docx. (This sometimes happens because Word will sometimes omit components needed for larger documents when saving a simple one.) Previously, we allowed a reference.docx in the data directory (e.g. `~/.pandoc`) to be used as the distribution's reference.docx. This led to a bizarre situation where pandoc would produce a good docx using `--template ~/.pandoc/ref.docx`, but if `ref.docx` were moved to `~/.pandoc/reference.docx`, it would then produce a corrupted docx. Closes #3322 (I think).
2017-04-09stack.yaml: update foundation to 0.0.6 (#3565)Alexander Krotov1-0/+1
foundation-0.0.4 from lts-8.8 does not build on FreeBSD
2017-04-09Use stack lts-8.8.John MacFarlane2-4/+2
This gives us a newer verison of executable-path, which we need for FreeBSD.
2017-04-07Fixed a typo (#3562)Sam Kim1-1/+1
2017-04-07Lua filter: improve doc filter performanceAlbert Krewinkel2-37/+56
Pandoc elements are pushed and pulled from the lua stack via custom instances.
2017-04-06Ensure correctness of StackValue instancesAlbert Krewinkel2-0/+29
2017-04-06Lua filter: Improve block filter performanceAlbert Krewinkel1-7/+44
Reading of simple block values from the lua stack is handled manually, but most block constructors are still handled via instances of aeson's Value type.
2017-04-06Lua filter: Improve inline filter performanceAlbert Krewinkel1-7/+73
Getting inline instances from the lua stack is handled manually for some simple inline constructors, including the `Str` constructor. This avoids the indirect route through aeson's Value type and improves performance considerably (approx. 30% speedup for some filters).
2017-04-04Use lua registry instead of named globalsAlbert Krewinkel1-5/+11
This is slightly cleaner while keeping performance approximately the same.
2017-04-06Ms writer: wider indents for lists.John MacFarlane2-101/+102
Previously some indents weren't wide enough, leading the list item to start on a line after the marker.
2017-04-06Allow raw latex commands starting with `\start` in Markdown.John MacFarlane2-1/+10
Previously these weren't allowed because they were interpreted as starting ConTeXt environments, even without a corresponding \stop... Closes #3558.
2017-04-05Ms writer: respect text wrapping options.John MacFarlane3-70/+45
2017-04-04Ms writer improvements:John MacFarlane4-22/+30
- added some variables to the default template. - cleaner output for images (stringify alt text).
2017-04-04Small fixes to ms template.John MacFarlane1-6/+6
2017-04-04Ms writer: ensure that @ is escaped in URIs.John MacFarlane2-3/+7
Otherwise we may get unescaped @s that give eqn fits, with @ as the delimiter character.
2017-04-04Error: Added PandocOptionError.John MacFarlane2-1/+3
2017-04-04Add original classes to JS obfuscated links (#3554)Timm Albers1-1/+4
HTML links containing classes originally now preserve them when using javascript email obfuscation. Fixes #2989
2017-04-04Merge pull request #3556 from nunull/issue1831_footnoteBackRefsJohn MacFarlane3-11/+11
Add class to footnote back references
2017-04-03Add class to footnote back referencesTimm Albers3-11/+11
The HTML writer now also adds the class footnoteBack to back references of footnotes. This allows for easier CSS styling.
2017-04-03Merge pull request #3553 from nunull/masterJohn MacFarlane1-2/+5
Include \VerbatimFootnotes for highlighted code blocks
2017-04-03Include \VerbatimFootnotes for highlighted code blocksTimm Albers1-2/+5
Updated the LaTeX writer to also include \VerbatimFootnotes in the preamble for highlighted code blocks. Previously this was only done for raw code blocks.
2017-04-03Removed unused import.John MacFarlane1-1/+0
2017-04-03Removed unused imports from Setup.hs.John MacFarlane1-6/+2
2017-04-03Merge pull request #3550 from tarleb/lua-readers-submoduleJohn MacFarlane6-32/+172
Lua module: add readers submodule
2017-04-02Make sure docx/_rels/.rels gets into data files.John MacFarlane1-1/+5
embedDir in file-embed excludes hidden files, so we need to add this manually.
2017-04-02MANUAL: document highlighting support in ms.John MacFarlane1-6/+6
2017-04-02Revert "Revert "Use file-embed instead of hsb2hs to embed data files.""John MacFarlane6-38/+8
This reverts commit 1fa15c225b515e1fa1c6566f90f1be363a4d770f.
2017-04-02Text.Pandoc.App: Throw errors rather than exiting.John MacFarlane6-57/+72
These are caught (and lead to exit) in pandoc.hs, but other uses of Text.Pandoc.App may want to recover in another way. Added PandocAppError to PandocError (API change). This is a stopgap: later we should have a separate constructor for each type of error. Also fixed uses of 'exit' in Shared.readDataFile, and removed 'err' from Shared (API change). Finally, removed the dependency on extensible-exceptions. See #3548.
2017-04-02Lua module: add readers submoduleAlbert Krewinkel6-32/+172
Plain text readers are exposed to lua scripts via the `pandoc.reader` submodule, which is further subdivided by format. Converting e.g. a markdown string into a pandoc document is possible from within lua: doc = pandoc.reader.markdown.read_doc("Hello, World!") A `read_block` convenience function is provided for all formats, although it will still parse the whole string but return only the first block as the result. Custom reader options are not supported yet, default options are used for all parsing operations.
2017-04-01Added data/default.theme to repository.John MacFarlane1-0/+177
2017-04-01Allow a theme file as argument to `--highlight-style`.John MacFarlane3-3/+17
Also include a sample, `default.theme`, in `data/`.
2017-04-01Ms writer: added syntax highlighting.John MacFarlane3-7/+90
Closes #3547. Macro definitions are inserted in the template when there is highlighted code. Limitations: background colors and underline currently not supported.