aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
AgeCommit message (Collapse)AuthorFilesLines
2017-12-13Custom writer: define instances for newtype wrapperAlbert Krewinkel1-69/+57
The custom writer used its own `ToLuaStack` instance definitions, which made it difficult to share code with Lua filters, as this could result in conflicting instances. A `Stringify` wrapper is introduced to avoid this problem.
2017-12-13Markdown reader: always use four space rule for example lists.John MacFarlane1-9/+16
It would be awkward to indent example list contents to the first non-space character after the label, since example list labels are often long. Thanks to Bernhard Fisseni for the suggestion.
2017-12-12Markdown: Improved computation of relative cell widths in pipe tables.John MacFarlane1-1/+1
2017-12-12Pipe tables: use full text width for tables with wrapping cells.John MacFarlane1-2/+2
Previously we computed the column sizes based on the ratio between the header lines and the text width (as set by `--columns`). This meant that tables with very short header lines would be very narrow. With this change, pipe tables with wrapping cells will always take up the whole text width. The relative column widths will still be determined by the ratio of header lines, but they will be normalized to add up to 1.0.
2017-12-13fig, table-wrap & caption Divs for JATS writerHamish Mackenzie1-6/+30
Support writing <fig> and <table-wrap> elements with <title> and <caption> inside them by using Divs with class set to on of fig, table-wrap or cation. The title is included as a Heading so the constraint on where Heading can occur is also relaxed. Also leaves out empty alt attributes on links.
2017-12-11`--pdf-engine-opt`: fix bug where option order was reversed.John MacFarlane1-1/+1
Closes #4137.
2017-12-11Fix comment that confused compiler.Jesse Rosenthal1-2/+0
2017-12-11Remove redundant imports from Docx writer.Jesse Rosenthal1-3/+0
These were a result of moving functions to the OOXML module.
2017-12-11Integrate Powerpoint writer into pandoc.Jesse Rosenthal3-0/+5
2017-12-11Add Powerpoint writer.Jesse Rosenthal1-0/+1665
This imports the essential Powerpoint writer. It works following the standard Pandoc conventions for making other sorts of slides. At the moment, there are still these TODOs: 1. Syntax highlighting is not yet implemented. (This is difficult because there are no character classes in Powerpoint.) 2. Footnotes and Definition lists are not yet implemented. (Notes will usually take the form of a final slide. 3. Image placement and auto-resizing has a few glitches. 4. Reference powerpoint files don't work dependably from the command line. This will be implemented, but at the moment users are advised to change themes from within Powerpoint.
2017-12-11Add necessary powerpoint functions to Class.Jesse Rosenthal1-0/+64
2017-12-11Create shared OOXML writer file.Jesse Rosenthal2-33/+110
This is for functions used by both Powerpoint and Docx writers.
2017-12-10Changes for skylighting-0.5.John MacFarlane3-6/+7
This fixes a bug in 2.0.4, whereby pandoc could not read the theme files generated with `--print-highlight-style`. It also fixes some CSS issues involving line numbers. Highlighted code blocks are now enclosed in a div with class sourceCode. Highlighting CSS no longer sets a generic color for pre and code; we only set these for class `sourceCode`. This will close #4133 and #4128.
2017-12-10Lua filters: fix package loading for Lua 5.1Albert Krewinkel1-1/+4
The list of package searchers is named `package.loaders` in Lua 5.1 and LuaJIT, and `package.searchers` in Lua 5.2 and later.
2017-12-09Man writer: omit internal links.John MacFarlane1-0/+2
That is, just print the link text without the url. Closes #4136.
2017-12-08LaTeX reader: fix \ before newline.John MacFarlane1-3/+14
This should be a nonbreaking space, as long as it's not followed by a blank line. This has been fixed at the tokenizer level. Closes #4134.
2017-12-06Markdown reader: accept processing instructions as raw HTML.John MacFarlane1-2/+3
Closes #4125.
2017-12-06Lua filters: use script to initialize the interpreterAlbert Krewinkel2-13/+9
The file `init.lua` is used to initialize the Lua interpreter which is used in Lua filters. This gives users the option to require libraries which they want to use in all of their filters, and to extend default modules.
2017-12-02Lua filters: refactor lua module handlingAlbert Krewinkel4-56/+190
The integration with Lua's package/module system is improved: A pandoc-specific package searcher is prepended to the searchers in `package.searchers`. The modules `pandoc` and `pandoc.mediabag` can now be loaded via `require`.
2017-12-06hlint Muse reader and testsAlexander Krotov1-4/+4
2017-12-06Muse reader: don't allow emphasis to be preceded by letterAlexander Krotov1-2/+12
2017-12-05Muse reader: support multiline directives in Amusewiki modeAlexander Krotov1-4/+24
2017-12-04Markdown reader: Don't parse native div as table caption.John MacFarlane1-1/+1
Closes #4119.
2017-12-04Add `empty_paragraphs` extension.John MacFarlane7-33/+52
* Deprecate `--strip-empty-paragraphs` option. Instead we now use an `empty_paragraphs` extension that can be enabled on the reader or writer. By default, disabled. * Add `Ext_empty_paragraphs` constructor to `Extension`. * Revert "Docx reader: don't strip out empty paragraphs." This reverts commit d6c58eb836f033a48955796de4d9ffb3b30e297b. * Implement `empty_paragraphs` extension in docx reader and writer, opendocument writer, html reader and writer. * Add tests for `empty_paragraphs` extension.
2017-12-04Muse reader: add underline support in Emacs Muse modeAlexander Krotov1-1/+7
2017-12-03Removed unnecessary import.John MacFarlane1-1/+1
2017-12-03commonmark/gfm writer: use raw html for native divs/spans.John MacFarlane1-4/+14
This allows a pandoc markdown native div or span to be rendered in gfm using raw html tags.
2017-12-03HTML writer: export tagWithAttributes.John MacFarlane1-2/+19
This is a helper allowing other writers to create single HTML tags.
2017-12-03commonmark/gfm writer: implement `raw_html` and `raw_tex` extensions.John MacFarlane1-6/+12
Note that `raw_html` is enabled by default for `gfm`, while `raw_tex` is disabled by default.
2017-12-02Docx writer: allow empty paragraphs.John MacFarlane2-4/+8
See #2252. This also changes fixDisplayMath from Text.Pandoc.Writers.Shared so that it no longer produces empty Para as an artifact. (That was the original reason the writer omitted them.)
2017-12-02Docx reader: don't strip out empty paragraphs.John MacFarlane1-3/+1
We now have the `--strip-empty-paragraphs` option for that, if you want it. Closes #2252. Updated docx reader tests. We use stripEmptyParagraphs to avoid changing too many tests. We should add new tests for empty paragraphs.
2017-12-02Shared.blocksToInlines: rewrote using builder.John MacFarlane1-24/+27
This gives us automatic normalization, so we don't get for example two consecutive Spaces.
2017-12-02Add --strip-empty-paragraphs option.John MacFarlane2-5/+24
This works for any input format.
2017-12-02LaTeX writer: escape `_` in code with --listings.John MacFarlane1-1/+1
2017-12-01LaTeX writer: allow specifying just width or height for image size.John MacFarlane1-1/+6
Previously both needed to be specified (unless the image was being resized to be smaller than its original size). If height but not width is specified, we now set width to textwidth (and similarly if width but not height is specified). Since we have keepaspectratio, this yields the desired result.
2017-12-01LaTeX writer: escape ~ in code with --listings.John MacFarlane1-1/+1
Closes #4111.
2017-12-01Revert "LaTeX writer: Add keepaspectratio to includegraphics..."John MacFarlane1-6/+1
This reverts commit 171187a4527497701b3c77bd56cea2d770d4e3b0.
2017-12-01Lua/StackInstances: push Pandoc and Meta via constructorAlbert Krewinkel1-7/+5
Pandoc and Meta elements are now pushed by calling the respective constructor functions of the pandoc Lua module. This makes serialization consistent with the way blocks and inlines are pushed to lua and allows to use List methods with the `blocks` value.
2017-12-01List.lua: add missing fixes as discussed in #4099Albert Krewinkel1-1/+1
The changes were missing due to an error while using git.
2017-11-30LaTeX writer: Add keepaspectratio to includegraphics...John MacFarlane1-1/+6
...if only one of height/width is given.
2017-11-29Support beamer `\alert` in LaTeX reader. Closes #4091.John MacFarlane1-0/+1
2017-11-29Let papersizes a0, a1, a2, ... be case-insensitive in LaTeX and ConTeXt.John MacFarlane2-5/+8
2017-11-29Muse reader: correctly remove indentation from notesAlexander Krotov1-2/+2
Exactly one space is required and considered to be part of the marker.
2017-11-28Add basic lua List module (#4099)Albert Krewinkel1-5/+23
The List module is automatically loaded, but not assigned to a global variable. It can be included in filters by calling `List = require 'List'`. Lists of blocks, lists of inlines, and lists of classes are now given `List` as a metatable, making working with them more convenient. E.g., it is now possible to concatenate lists of inlines using Lua's concatenation operator `..` (requires at least one of the operants to have `List` as a metatable): function Emph (emph) local s = {pandoc.Space(), pandoc.Str 'emphasized'} return pandoc.Span(emph.content .. s) end Closes: #4081
2017-11-28Added --print-highlight-style option.John MacFarlane1-1/+26
This generates a JSON version of a highlighting style, which can be saved as a .theme file, modified, and used with `--highlight-style`. Closes #4106. Closes #4096.
2017-11-28Support `--webtex` for `gfm` output.John MacFarlane2-9/+18
2017-11-28make normalizeDate more forgiving (#4101)Mauro Bieg1-1/+1
also parse two-digit days, e.g. "April 20, 2017"
2017-11-27Fix --help output for --highlight-style to include FILE (#4098)Mauro Bieg1-1/+1
Closes #4095.
2017-11-27Muse reader: parse "~~" as non-breaking space in Emacs modeAlexander Krotov1-0/+7
2017-11-26Clearer deprecation warning for --latexmathml, --asciimathml, -m.John MacFarlane1-1/+1
Previously we only mentioned `--latexmathml`, even if `-m` was used.