aboutsummaryrefslogtreecommitdiff
path: root/pandoc.cabal
AgeCommit message (Collapse)AuthorFilesLines
2021-12-22Add markua test files to extra-source-files.John MacFarlane1-0/+2
2021-12-22Add text wrapping to HTML output.John MacFarlane1-0/+1
Previously the HTML writer was exceptional in not being sensitive to the `--wrap` option. With this change `--wrap` now works for HTML. The default (as with other formats) is automatic wrapping to 72 columns. A new internal module, T.P.Writers.Blaze, exports `layoutMarkup`. This converts a blaze Html structure into a doclayout Doc Text. In addition, we now add a line break between an `img` tag and the associated `figcaption`. Note: Output is never wrapped in `writeHtmlStringForEPUB`. This accords with previous behavior since previously the HTML writer was insensitive to `--wrap` settings. There's no real need to wrap HTML inside a zipped container. Note that the contents of script, textarea, and pre tags are always laid out with the `flush` combinator, so that unwanted spaces won't be introduced if these occur in an indented context in a template. Closes #7764.
2021-12-19Add a writer for Markua 0.10 (#7729)binaarinen1-0/+2
Markua is a markdown variant used by Leanpub. More information about Markua can be found at https://leanpub.com/markua/read. Adds a new exported function `writeMarkua` from T.P.Writers.Markdown. [API change] Closes #1871. Co-authored by Tim Wisotzki and Samuel Lemmenmeier.
2021-12-17Lua: add function `pandoc.utils.references`Albert Krewinkel1-0/+1
List with all cited references of a document. Closes: #7752
2021-12-13Lua: support topdown traversalsAlbert Krewinkel1-1/+1
The traversal order of filters can now be selected by setting the key `traverse` of the filter to either `'topdown'` or `'typewise'`; the default remains `'typewise'`. Topdown traversals can be cut short by returning `false` as a second value from the filter function. No child-element of the returned element is processed in that case.
2021-12-11fix(IpynbOutput)!: rank always favors output formatKolen Cheung1-0/+3
Previously, both `fmt == f` case and Image have a rank of 1. In the end, e.g. from ipynb to html conversion, if both html and image exists, it actually prefers the image. This commit changes this, so that fmt == f is always highest rank, and rank never collides. This is achieved by keeping fmt == f case having rank 1, and every other rank increased by 1.
2021-12-11Custom reader: pass list of sources instead of concatenated textAlbert Krewinkel1-0/+1
The first argument passed to Lua `Reader` functions is no longer a plain string but a richer data structure. The structure can easily be converted to a string by applying `tostring`, but is also a list with elements that contain each the *text* and *name* of each input source as a property of the respective name. A small example is added to the custom reader documentation, showcasing its use in a reader that creates a syntax-highlighted code block for each source code file passed as input. Existing readers must be updated.
2021-12-10Switch to released pandoc-lua-marshal-0.1.2Albert Krewinkel1-1/+1
Cell values are now marshaled as userdata objects; a constructor function for table cells is provided as `pandoc.Cell`.
2021-12-09Lua: update to latest pandoc-lua-marshal (0.1.1)Albert Krewinkel1-2/+1
- `walk` methods are added to `Block` and `Inline` values; the methods are similar to `pandoc.utils.walk_block` and `pandoc.utils.walk_inline`, but apply to filter also to the element itself, and therefore return a list of element instead of a single element. - Functions of name `Doc` are no longer accepted as alternatives for `Pandoc` filter functions. This functionality was undocumented.
2021-12-06Ipynb reader & writer: properly handle cell "id".John MacFarlane1-1/+1
This is passed through if it exists (in Nb4); otherwise the writer will add a random one so that cells all have an "id". Closes #7728.
2021-12-02Allow unicode-transforms 0.4.0.John MacFarlane1-1/+1
2021-11-30Update cabal description.John MacFarlane1-24/+28
2021-11-28Bump pandoc-lua-marshall lower bound to 0.1.0.1 in cabal file.John MacFarlane1-1/+1
Closes #7721.
2021-11-27Lua: use package pandoc-lua-marshal (#7719)Albert Krewinkel1-14/+6
The marshaling functions for pandoc's AST are extracted into a separate package. The package comes with a number of changes: - Pandoc's List module was rewritten in C, thereby improving error messages. - Lists of `Block` and `Inline` elements are marshaled using the new list types `Blocks` and `Inlines`, respectively. These types currently behave identical to the generic List type, but give better error messages. This also opens up the possibility of adding element-specific methods to these lists in the future. - Elements of type `MetaValue` are no longer pushed as values which have `.t` and `.tag` properties. This was already true for `MetaString` and `MetaBool` values, which are still marshaled as Lua strings and booleans, respectively. Affected values: + `MetaBlocks` values are marshaled as a `Blocks` list; + `MetaInlines` values are marshaled as a `Inlines` list; + `MetaList` values are marshaled as a generic pandoc `List`s. + `MetaMap` values are marshaled as plain tables and no longer given any metatable. - The test suite for marshaled objects and their constructors has been extended and improved. - A bug in Citation objects, where setting a citation's suffix modified it's prefix, has been fixed.
2021-11-20Bump to 2.16.2John MacFarlane1-1/+1
2021-11-17Update build files (#7696)Fabián Heredia Montiel1-6/+1
* Drop old windows 32-bit constraints - basement >= 0.0.10 was 0.0.12 on stackage-18.10 - foundation >= 0.0.23 was 0.0.26.1 on stackage-18.10 * Update cabal `tested-with` field to correspond to `ci.yml` matrix * ghc: 8.10.{2,4} → 8.10.7
2021-11-10Remove unneeded package dependencies from benchmark target.John MacFarlane1-3/+0
2021-11-09Require ghc >= 8.6, base >= 4.12.John MacFarlane1-17/+13
This allows us to get rid of the old custom prelude and some crufty cpp. But the primary reason for this is that conduit has bumped its base lower bound to 4.12, making it impossible for us to support lower base versions.
2021-11-09Require Cabal 2.4. Use wildcards...John MacFarlane1-84/+3
...to ensure that all pptx tests are included. Closes #7677.
2021-11-08Lua: ensure that 're' module is always available.Albert Krewinkel1-1/+1
The module is shipped with LPeg.
2021-11-07Replace old sample custom reader with a full-featured reader for creole.John MacFarlane1-0/+2
This is better as an example. And it is faster than pandoc's regular creole parser, which shows that high-performance readers can be developed this way.
2021-11-05Add interface for custom readers written in Lua. (#7671)John MacFarlane1-0/+1
New module Text.Pandoc.Readers.Custom, exporting readCustom [API change]. Users can now do `-f myreader.lua` and pandoc will treat the script myreader.lua as a custom reader, which parses an input string to a pandoc AST, using the pandoc module defined for Lua filters. A sample custom reader can be found in data/reader.lua. Closes #7669.
2021-11-04Lua: include lpeg module (#7649)Albert Krewinkel1-0/+1
Compiles the 'lpeg' library (Parsing Expression Grammars For Lua) into the program. Package maintainers may choose to rely on package dependencies to make lpeg available, in which case they can compile the with the constraint `lpeg +rely-on-shared-lpeg-library`.
2021-11-04Require latest hslua (2.0.1).Albert Krewinkel1-2/+2
This fixes issues with - misleading error messages when a required function parameter is omitted; - absent properties still being listed in the output of `pairs`; and - alias accessing leading to errors instead of returning `nil`, e.g. with `(pandoc.Str '').identifier`. Fixes: #7661 See also: #7657
2021-11-02Allow tasty-bench 0.3.x.John MacFarlane1-1/+1
2021-11-02Bump to 2.16.1, update changelog.John MacFarlane1-1/+1
2021-10-31Bump to 2.16, update changelog.John MacFarlane1-1/+1
2021-10-30Allow time 1.13John MacFarlane1-2/+2
2021-10-27Require latest skylighting (0.12.1).John MacFarlane1-2/+2
2021-10-27Switch back from HsYAML to yaml.John MacFarlane1-5/+5
Reasons: - Performance: HsYAML is around 20 times slower in parsing large YAML bibliographies (#6084). - An issue was submitted to HsYAML, but it hasn't gotten any attention. HsYAML seems borderline unmaintained; it hasn't had a commit in over a year. - Unfortunately this goes back on our attempts to free ourselves from C dependencies (#4535). But I don't see a better alternative until a better pure Haskell parser is available. Closes #6084. Notes: - We've removed the FromYAML instances for all types that had them, since this is a HsYAML-specific typeclass [API change]. (The yaml package just uses From/ToJSON.) - Unlike HsYAML (in the configuration we were using), yaml parses 'Y', 'N', 'Yes', 'No', 'On', 'Off' as boolean values. Users may need to quote these when they are meant to be interpreted as strings. Similarly, 'null' is parsed as a YAML null value (and will be treated as an empty string by pandoc rather than the string 'null'). Quoting it will force it to be interpreted as a string. - Some tests had to be adjusted accordingly. - Pandoc now behaves better when the YAML metadata contains escaping errors: instead of just falling back on treating the section as a table, it raises a YAML parsing error.
2021-10-26Lua: marshal ListAttributes values as userdata objectsAlbert Krewinkel1-0/+1
2021-10-23Use ipynb 0.1.0.2.John MacFarlane1-2/+2
With this change pandoc can be built with aeson >= 2.
2021-10-22Bump to 2.15, updaet man page.John MacFarlane1-1/+1
2021-10-22Use citeproc 0.6, commonmark 0.2.2.1, commonmark-extensions 0.2.2John MacFarlane1-3/+3
2021-10-22Use texmath 0.12.3.2John MacFarlane1-1/+1
2021-10-22Use pandoc-types 1.22.1.John MacFarlane1-2/+2
2021-10-22Lua: marshal Version values as userdataAlbert Krewinkel1-1/+1
2021-10-22Lua: marshal Attr values as userdataAlbert Krewinkel1-0/+1
- Adds a new `pandoc.AttributeList()` constructor, which creates the associative attribute list that is used as the third component of `Attr` values. Values of this type can often be passed to constructors instead of `Attr` values. - `AttributeList` values can no longer be indexed numerically.
2021-10-22Switch to hslua-2.0Albert Krewinkel1-8/+7
The new HsLua version takes a somewhat different approach to marshalling and unmarshalling, relying less on typeclasses and more on specialized types. This allows for better performance and improved error messages. Furthermore, new abstractions allow to document the code and exposed functions.
2021-10-17pptx: Fix list level numberingEmily Bourke1-0/+2
In PowerPoint, the content of a top-level list is at the same level as the content of a top-level paragraph – the only difference is that a list style has been applied. At the moment, the pptx writer increments the paragraph level on each list, turning what should be top-level lists into second-level lists. This commit changes that logic, only incrementing the paragraph level on continuation paragraphs of lists. - Fixes https://github.com/jgm/pandoc/issues/4828 - Fixes https://github.com/jgm/pandoc/issues/4663
2021-10-12Revert "Depend on pandoc-types 1.23, remove Null constructor on Block."John MacFarlane1-2/+2
This reverts commit fb0d6c7cb63a791fa72becf21ed493282e65ea91.
2021-10-12Allow aeson 2.0John MacFarlane1-1/+1
2021-10-11Require doclayout >= 0.3.1.1.John MacFarlane1-1/+1
This fixes recognition of "real widths" of emoji characters, which is important for tabular layout.
2021-10-10Translations: don't depend on the fact that Aeson Object is...John MacFarlane1-1/+0
implemented internally as a HashMap. This is no longer public as of aeson 2.0.0.0.
2021-10-05Allow time 1.12.John MacFarlane1-2/+2
2021-10-01Depend on pandoc-types 1.23, remove Null constructor on Block.John MacFarlane1-2/+2
2021-09-28Switch from pretty-simple to pretty-show for native output.John MacFarlane1-1/+2
Update tests. Reason: it turns out that the native output generated by pretty-simple isn't always readable by the native reader. According to https://github.com/cdepillabout/pretty-simple/issues/99 it is not a design goal of the library that the rendered values be readable using 'read'. This makes it unsuitable for our purposes. pretty-show is a bit slower and it uses 4-space indents (non-configurable), but it doesn't have this serious drawback.
2021-09-21Use pretty-simple to format native output.John MacFarlane1-1/+2
Previously we used our own homespun formatting. But this produces over-long lines that aren't ideal for diffs in tests. Easier to use something off-the-shelf and standard. Closes #7580. Performance is slower by about a factor of 10, but this isn't really a problem because native isn't suitable as a serialization format. (For serialization you should use json, because the reader is so much faster than native.)
2021-09-18Use skylighting-0.12, skylighting-core-0.12.John MacFarlane1-2/+2
This fixes highlighting issues with typescript, scala, and other syntaxes that include keyword lists from different syntaxes.
2021-09-18pptx: Support footers in the reference docEmily Bourke1-0/+5
In PowerPoint, it’s possible to specify footers across all slides, containing a date (optionally automatically updated to today’s date), the slide number (optionally starting from a higher number than 1), and static text. There’s also an option to hide the footer on the title slide. Before this commit, none of that footer content was pulled through from the reference doc: this commit supports all the functionality listed above. There is one behaviour which may not be immediately obvious: if the reference doc specifies a fixed date (i.e. not automatically updating), and there’s a date specified in the metadata for the document, the footer date is replaced by the metadata date. - Include date, slide number, and static footer content from reference doc - Respect “slide number starts from” option - Respect “Don’t show on title slide” option - Add tests