Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
A new type `SimpleTable` is made available to Lua filters. It is
similar to the `Table` type in pandoc versions before 2.10;
conversion functions from and to the new Table type are provided.
Old filters using tables now require minimal changes and can use,
e.g.,
if PANDOC_VERSION > {2,10,1} then
pandoc.Table = pandoc.SimpleTable
end
and
function Table (tbl)
tbl = pandoc.utils.to_simple_table(tbl)
…
return pandoc.utils.from_simple_table(tbl)
end
to work with the current pandoc version.
|
|
This makes the example a bit more realistic/valuable by checking if the metadata value "date" is already present, before changing the value.
|
|
|
|
|
|
The example is outdated and requires a complete overhaul.
|
|
|
|
This changes the Lua API. It is highly unlikely for this change to
affect existing filters, since the documentation for the new Table
constructor (and type) was incomplete and partly wrong before.
The Lua API is now more consistent, as all constructors for elements
with attributes now take attributes as the last parameter.
|
|
|
|
|
|
|
|
Handling of export settings and other keywords (like `#+LINK`) has been
combined and unified.
|
|
These export settings are treated like their non-extra counterparts,
i.e., the values are added to the `header-includes` metadata list.
|
|
The values of all lines are read as inlines and collected in the
`subtitle` metadata field.
|
|
See discussion in #4788.
Closes: #4387
|
|
The value is stored in the `institute` metadata field and used in the
default beamer presentation template.
|
|
|
|
Showcase temporary directory handling with `with_temporary_directory`
and `with_working_directory`.
|
|
Change description of BulletList parameter from 'List of Blocks' to 'List of List of Blocks'.
|
|
so it works with latest pandoc. Closes #6185.
|
|
Closes: #6040
|
|
Lists of Inline and Block elements can now be filtered via `Inlines` and
`Blocks` functions, respectively. This is helpful if a filter conversion
depends on the order of elements rather than a single element.
For example, the following filter can be used to remove all spaces
before a citation:
function isSpaceBeforeCite (spc, cite)
return spc and spc.t == 'Space'
and cite and cite.t == 'Cite'
end
function Inlines (inlines)
for i = #inlines-1,1,-1 do
if isSpaceBeforeCite(inlines[i], inlines[i+1]) then
inlines:remove(i)
end
end
return inlines
end
Closes: #6038
|
|
|
|
Remove example using pandoc API directly (we have other
docs for that and it was outdated).
Closes #6065.
|
|
This follows the advise on the Lua
website (https://www.lua.org/about.html#name):
> […] "Lua" is a name, the name of the Earth's moon and the name of the
> language. Like most names, it should be written in lower case with an
> initial capital, that is, "Lua".
|
|
Thanks to @bpj for the idea.
|
|
The functions `table.insert`, `table.remove`, and `table.sort` are added
to pandoc.List elements. They can be used as methods, e.g.
local numbers = pandoc.List {2, 3, 1}
numbers:sort() -- numbers is now {1, 2, 3}
|
|
|
|
Links and anchors now follow consistent conventions, like lowercase-only
anchor names.
This breaks some links to specific sections in the document, but will
make it much easier to link documentation in the future.
|
|
It is now possible to construct a new List via `pandoc.List()` instead of
`pandoc.List:new()`.
|
|
|
|
Metadata defaults can be given via the command line `--metadata-file`.
Adding raw format snippets is a common use case for Lua filters, so it
seems sensible to provide an example.
Thanks to @efx for proposing this filter.
Closes: pandoc/lua-filters#70
|
|
|
|
|
|
See: #5892
|
|
Closes #5851.
We avoid the failure with a boolean value by simply checking
to make sure we have a table before indexing.
|
|
|
|
See: #5851
|
|
Attr values can now be given as normal Lua tables; this can be used as a
convenient alternative to define Attr values, instead of constructing
values with `pandoc.Attr`. Identifiers are taken from the *id* field,
classes must be given as space separated words in the *class* field. All
remaining fields are included as misc attributes.
With this change, the following lines now create equal elements:
pandoc.Span('test', {id = 'test', class = 'a b', check = 1})
pandoc.Span('test', pandoc.Attr('test', {'a','b'}, {check = 1}))
This also works when using the *attr* setter:
local span = pandoc.Span 'text'
span.attr = {id = 'test', class = 'a b', check = 1}
Furthermore, the *attributes* field of AST elements can now be a plain
key-value table even when using the `attributes` accessor:
local span = pandoc.Span 'test'
span.attributes = {check = 1} -- works as expected now
Closes: #5744
|
|
Text.Pandoc.Shared:
+ Remove `Element` type [API change]
+ Remove `makeHierarchicalize` [API change]
+ Add `makeSections` [API change]
+ Export `deLink` [API change]
Now that we have Divs, we can use them to represent the structure
of sections, and we don't need a special Element type.
`makeSections` reorganizes a block list, adding Divs with
class `section` around sections, and adding numbering
if needed.
This change also fixes some longstanding issues recognizing
section structure when the document contains Divs.
Closes #3057, see also #997.
All writers have been changed to use `makeSections`.
Note that in the process we have reverted the change
c1d058aeb1c6a331a2cc22786ffaab17f7118ccd
made in response to #5168, which I'm not completely
sure was a good idea.
Lua modules have also been adjusted accordingly.
Existing lua filters that use `hierarchicalize` will
need to be rewritten to use `make_sections`.
|
|
|
|
|
|
|
|
|
|
Closes: #5568
|
|
Closes #5552.
|
|
|
|
Function `pandoc.mediabag.delete` allows to remove a single item of the given
name from the media bag.
|
|
Function `pandoc.mediabag.empty` was added. It allows to clean-out the media
bag, removing all entries.
|