Commit graph

22 commits

Author SHA1 Message Date
John MacFarlane
642c022d81 sample.lua: add SingleQuoted, DoubleQuoted.
Closes #5104.
2018-11-29 10:42:05 -08:00
Albert Krewinkel
6082caf233
Custom writer: provide PANDOC_DOCUMENT instead of Setup function
Custom writers have access to the global variable `PANDOC_DOCUMENT`. The
variable contains a userdata wrapper around the full pandoc AST and
exposes two fields, `meta` and `blocks`. The field content is only
marshaled on-demand, performance of scripts not accessing the fields
remains unaffected.
2018-10-14 21:23:41 +02:00
Albert Krewinkel
49544069a2 Custom writer: give full access to doc in optional Setup function (#4967)
Custom writers can specify an optional `Setup` function. The function
takes the full Pandoc document as input and should not return any value.
Users can use this function to configure the writer depending on the
given document's content or its metadata.

data/sample.lua: add sample use of Setup function.
The change allows to control the image format used to encode the image
produced from dot code.

Closes #4957
2018-10-13 23:20:29 -07:00
Albert Krewinkel
273d4dfcfa
data/sample.lua: replace custom pipe function with pandoc.utils.pipe 2018-10-13 20:54:47 +02:00
Albert Krewinkel
3b2282c962
data/sample.lua: use next instead of for loop
Each definition list item contains just a single key and the associated
value.  Using `next` to get the key/value pair is more idiomatic than
iterating over the single-element table.
2017-12-27 20:11:19 +01:00
John MacFarlane
e19526846f Removed extra comment. 2017-12-27 10:52:12 -08:00
John MacFarlane
cb4123841c Revert "data/sample.lua: Fixed problem with definition lists."
This reverts commit 0e3736422e
in favor of @tarleb's fix.
2017-12-27 10:48:34 -08:00
John MacFarlane
27ba06fe8f data/sample.lua: fixed problem with tables.
Closes #4202.
2017-12-27 09:16:29 -08:00
John MacFarlane
0e3736422e data/sample.lua: Fixed problem with definition lists. 2017-12-27 09:16:01 -08:00
bumper314
5bd571f499 Fix sample.lua barfing on Raw data (#3358)
* Fix for "pandoc: user error (Incorrect result type (string expected, got nil))." when the source format contains Raw data.

* Update sample.lua
2017-01-18 12:47:15 +01:00
John MacFarlane
422b861edc Handle line blocks in sample.lua custom lua writer. 2016-10-23 20:00:07 +02:00
John MacFarlane
175cc2d44d Implement RawInline and RawBlock in sample lua custom writer.
Closes #2985.
2016-06-20 11:55:43 -07:00
John MacFarlane
a692bd2872 Custom writer: Pass attributes parameter to CaptionedImage.
Closes #2697.
2016-02-05 16:49:27 -08:00
John MacFarlane
536b6bf538 Implemented SoftBreak and new --wrap option.
Added threefold wrapping option.

* Command line option: deprecated `--no-wrap`, added
  `--wrap=[auto|none|preserve]`
* Added WrapOption, exported from Text.Pandoc.Options
* Changed type of writerWrapText in WriterOptions from
  Bool to WrapOption.
* Modified Text.Pandoc.Shared functions for SoftBreak.
* Supported SoftBreak in writers.
* Updated tests.
* Updated README.

Closes #1701.
2015-12-11 23:55:08 -08:00
John MacFarlane
f2f35224f6 sample.lua - define CaptionedImage, add newline at end.
Cloess #2393.
2015-09-15 09:28:18 -07:00
John MacFarlane
0e9d3db244 Custom writers now work with --template.
Removed HTML header scaffolding from data/sample.lua.
2014-07-16 15:17:08 -07:00
John MacFarlane
2a881541a0 Made Citation information available in lua custom writer. 2014-07-16 09:32:41 -07:00
John MacFarlane
b2aae73f14 Added Cite function to sample.lua. 2013-12-13 11:19:49 -08:00
John MacFarlane
e9de0f0e22 Preliminary support for new Div and Span elements in writers.
Currently these are "transparent" containers, except in HTML,
where they produce div and span elements with attributes.
2013-08-08 23:14:12 -07:00
John MacFarlane
cd399d1b9d Updated sample.lua for new metadata. 2013-07-14 20:43:21 -07:00
John MacFarlane
644e3239a9 Custom writer: Pass full metadata, not just tit/auth/date. 2013-06-27 22:55:10 -07:00
John MacFarlane
4fa2a94759 Added Text.Pandoc.Writers.Custom, --print-custom-lua-writer.
pandoc -t data/sample.lua

will load the script sample.lua and use it as a custom writer.
data/sample.lua is provided as an example.

Added `--print-custom-lua-writer` option to print the sample
script.
2013-04-14 00:31:39 -05:00