aboutsummaryrefslogtreecommitdiff
path: root/data
AgeCommit message (Collapse)AuthorFilesLines
2021-11-27Lua: use package pandoc-lua-marshal (#7719)Albert Krewinkel2-389/+0
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-11JATS template: fix incomplete previous commitAlbert Krewinkel2-1/+2
2021-11-11JATS template: fix equal-contrib attributeAlbert Krewinkel1-2/+1
The standard requires the value to be either `yes` or `no`, but is was set to `true` for authors who contributed equally.
2021-11-08Remove some extra stuff from data/creole.lua.John MacFarlane1-7/+0
2021-11-08Add disableLayout variable in revealjs templateChristophe Dervieux1-1/+1
This allows to modify it using Pandoc variable. Default value is correctly set to false by Pandoc.
2021-11-07Replace old sample custom reader with a full-featured reader for creole.John MacFarlane2-87/+197
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-06Pass ReaderOptions to custom readers as second parameter.John MacFarlane1-1/+1
2021-11-06Fuller sample custom reader.John MacFarlane1-20/+63
2021-11-05Add interface for custom readers written in Lua. (#7671)John MacFarlane1-0/+44
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-03Update bash_completion.tplS.P.H1-2/+10
- Specify local scope for highlight_styles; prevents global namespace pollution when sourcing completion from a file rather than adding `eval "$(pandoc --bash-completion)"` to .bashrc - Add argument completion for --print-highlight-style, --eol, and --markdown-headings
2021-11-01Lua: load module `pandoc.path` on startupAlbert Krewinkel1-0/+1
Previously the module always had to be loaded via `require 'pandoc.path'`. Closes: #7524
2021-11-01Lua: restore List behavior of MetaListAlbert Krewinkel1-0/+1
Fixes a regression introduced in 2.16 which had MetaList elements loose the `pandoc.List` properties. Fixes #7650
2021-10-29Lua: use hslua module abstraction where possibleAlbert Krewinkel1-115/+5
This will make it easier to generate module documentation in the future.
2021-10-26Lua: marshal SimpleTable values as userdata objectsAlbert Krewinkel1-24/+0
2021-10-26Lua: generate constants in module pandoc programmaticallyAlbert Krewinkel1-80/+0
2021-10-26Lua: marshal ListAttributes values as userdata objectsAlbert Krewinkel1-42/+0
2021-10-26Lua: marshal Block values as userdata objectsAlbert Krewinkel1-205/+0
Properties of Block values are marshalled lazily, which generally improves performance considerably. Script users may also notice the following differences: - Block element properties can no longer be accessed by numerical indexing of the `.c` field. The `.c` property now serves as an alias for `.content`, so some filter that used this undocumented method for property access may continue to work, while others will need to be updated and use proper property names. - The marshalled Block elements now have a `show` method, and a `__tostring` metamethod. Both return the Haskell string representation of the element. - Block values now have the Lua type `userdata` instead of `table`.
2021-10-25Lua: marshal Citation values as userdata objectsAlbert Krewinkel1-23/+0
2021-10-22Lua: marshal Inline elements as userdataAlbert Krewinkel1-271/+0
This includes the following user-facing changes: - Deprecated inline constructors are removed. These are `DoubleQuoted`, `SingleQuoted`, `DisplayMath`, and `InlineMath`. - Attr values are no longer normalized when assigned to an Inline element property. - It's no longer possible to access parts of Inline elements via numerical indexes. E.g., `pandoc.Span('test')[2]` used to give `pandoc.Str 'test'`, but yields `nil` now. This was undocumented behavior not intended to be used in user scripts. Use named properties instead. - Accessing `.c` to get a JSON-like tuple of all components no longer works. This was undocumented behavior. - Only known properties can be set on an element value. Trying to set a different property will now raise an error.
2021-10-22Lua: marshal Attr values as userdataAlbert Krewinkel1-152/+3
- 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-22Lua: marshal Pandoc values as userdataAlbert Krewinkel1-20/+0
2021-10-21Fix line numbers in source code with reveal.jsJohn MacFarlane1-0/+3
We need "overflow: visible" for these to work, and reveal's default css disables this. So this modifies the default template to add this. Closes #7634. Thanks to @cderv for diagnosing the issue.
2021-10-17pptx: Line up continuation paragraphsEmily Bourke1-1/+1
This commit changes the `marL` and `indent` values used for plain paragraphs and numbered lists, and changes the spacing defined in the reference doc master for bulleted lists. For paragraphs, there is now a left-indent taken from the `otherStyle` in the master. For numbered lists, the number is positioned where the text would be if this were a plain paragraph, and the text is indented to the next level. This means that continuation paragraphs line up nicely with numbered lists. It also /mostly/ matches the observed PowerPoint behaviour when inserting paragraphs and numbered lists: the only difference is that PowerPoint was using a different margin value for the first level numbered lists – I’ve changed this to match the other levels, as I don’t think it makes the spacing unappealing and it allows continuation paragraphs at any level to line up. With bulleted lists, I’m keeping the observed PowerPoint behaviour of specifying only a level, letting `marL` and `indent` be automatically taken from `bodyStyle`. To that end, this commit changes the `bodyStyle` spacing in the master of the default reference doc, to: - line up the text of the first paragraph in each bullet with any continuation paragraphs - line up nested bullet markers in any continuation paragraphs with the first paragraph, matching lists and plain paragraphs This does mean the continuation paragraphs still won’t line up for anyone using their own reference doc where they haven’t matched the `otherStyle` and `bodyStyle` indent levels, but I think people in that situation will be able to troubleshoot.
2021-10-16Ensure that babel is loaded also with pdflatex.John MacFarlane1-3/+2
This fixes a regression in #7604, which modernized babel usage but omitted to load babel for pdflatex, with the result that even simple documents could no longer be produced. Closes #7627.
2021-10-03Make babel use more idiomatichseg1-16/+13
* Use `babel`'s bidi implementation * Remove global `lang` option -- it broke eg hebrew * Import babel languages individually instead of as package options -- was broken for greek, hebrew * Move `header-includes` to after `babel` setup Closes #7604
2021-09-19Use babel, not polyglossia, with xelatex.John MacFarlane1-13/+1
Previously polyglossia worked better with xelatex, but that is no longer the case, so we simplify the code so that babel is used with all latex engines. This involves a change to the default LaTeX template.
2021-08-12Various sample.lua editorial fixes. (#7493)William Lupton1-8/+12
These address most of the items mentioned in #7487. There's also a table caption fix (the caption wasn't escaped).
2021-08-01RTF template: specify font family for fixed-width font f1.John MacFarlane1-1/+1
According to the spec, this is mandatory.
2021-07-22LaTeX writer: Use ulem for underline.John MacFarlane1-0/+1
ulem is conditionally included already when the `strikeout` variable is set, so we set this when there is underlined text, and use `\uline` instead of `\underline`. This fixes wrapping for underlined text. Closes #7351.
2021-07-05document-css: reset overflow-wrap on code blocksMauro Bieg1-1/+2
fixes #7423
2021-07-03Revert "LaTeX template: move title, author, date up to top of preamble."John MacFarlane1-29/+29
This reverts commit cc088687b4013c2b8b744eb337ed04fc63f315f2 and PR #7295. This fixes issues people had when using LaTeX commands defined later in the preamble (or in some cases UTF-8 text) in the title or author fields. Closes #7422.
2021-06-21reveal.js writer: better handling of options.John MacFarlane1-128/+70
Previously it was impossible to specify false values for options that default to true; setting the option to false just caused the portion of the template setting the option to be omitted. Now we prepopulate all the variables with their default values, including them unconditionally and allowing them to be overridden.
2021-05-20reveal.js template: use `hash: true` by default rather than...John MacFarlane1-4/+4
`history: true`. Closes #6968. Setting `hash: true` is enough to get linkability to a particular page of the slide show.
2021-05-20ConTeXt reader: improve ordered lists (#7304)Denis Maier1-0/+4
Closes #5016 - change ordered list from itemize to enumerate - adds new itemgroup for ordered lists - add fontfeature for table figures - remove width from itemize in context writer
2021-05-17LaTeX template: improve treatment of CSL entry-spacing.John MacFarlane1-3/+3
Previously with the default template settings (`indent` variable not set), we would get interparagraph spaces separating bib entries even with `entry-spacing="0"`. On the other hand, setting `entry-spacing="2"` gave ridiculously large spacing. This change makes the spacing caused by `entry-spacing` a multiple of `\parskip` by default, which gives aesthetically reasonable output. Those who want a larger or smaller unit (e.g. because they use `indent` which sets `\parskip` to 0) may `\setlength{\cslentryspacingunit}{10pt}` in header-includes to override the defaults. Closes #7296.
2021-05-16LaTeX template: move title, author, date up to top of preamble.John MacFarlane1-29/+29
This allows header-includes to use them, and puts them in a position where you can see them immediately. Closes #7295.
2021-05-16LaTeX template: define commands for zero width non-joiner characterAlbert Krewinkel1-0/+19
Closes: #6639 The zero-width non-joiner character is used to avoid ligatures (e.g. in German).
2021-05-15docx writer settings.xml:John MacFarlane1-5/+5
- Set zoom to 100% by default. - Align math options more with current Word defaults (e.g. Cambria Math font).
2021-05-15docx writer: Remove rsids from settings.docx.John MacFarlane1-11/+1
Word will add these when revisions are made. But it's pointless to start out with a set of them.
2021-05-15HTML-based slide shows: add support for institute (#7289)Thomas Hodgson5-1/+19
Add institute variable (string or list) to HTML-based slide formats.
2021-05-14LaTeX template: Move CSL macro defs before header-includes.John MacFarlane1-25/+25
This allows them to be overriden by header-includes. Closes #7286.
2021-05-10latex template: use non-starred names for xcolor color names.John MacFarlane1-1/+1
This should make svgnames and x11names work properly. Closes #6109.
2021-04-29Support toc-title in revealjs (#7171)Florian Kohrt1-0/+5
* Support toc-title in revealjs * Add semantic HTML "nav" tag Closes #7170. As with default.html5
2021-04-29Update default.latex (#7234)badumont1-1/+4
Fix bad vertical spacing after the bibliography.
2021-04-28list of figures before list of tables in LaTeX and ConTeXt templates (#7235)Julien Dutant2-6/+6
2021-03-16Remove JS comment from HTML (#7154)Florian Kohrt1-1/+1
Illegal, turn into HTML comment
2021-03-14Handle 'nocite' better with --biblatex and --natbib.John MacFarlane1-0/+3
Previously the nocite metadata field was ignored with these formats. Now it populates a `nocite-ids` template variable and causes a `\nocite` command to be issued. Closes #4585.
2021-03-11JATS templates: support 'equal-contrib' attrib for authorsAlbert Krewinkel2-2/+2
Authors who contributed equally to a paper may be marked with `equal-contrib`.
2021-02-26Wrap url colours in braces in the default LaTeX template (#7121)Loïc Grobol1-4/+4
2021-02-20revealjs writer: add 'center' option for vertical slide centering.maurerle1-0/+4
Closes #7104.