Age | Commit message (Collapse) | Author | Files | Lines |
|
hslua no longer provides lua stack instances for Int and Double, the
necessary instances are added to the Custom writer and the lua filtering
system.
|
|
Stack instances for common data types are now provides by hslua. The
instance for Either was useful only for a very specific case; the
function that was using the `ToLuaStack Either` instance was rewritten
to work without it.
Closes: #3805
|
|
Raw table accessing functions never call back into haskell, which allows
the compiler to use more aggressive optimizations. This improves lua
filter performance considerably (⪆5% speedup).
|
|
|
|
|
|
This follows the suggestions given by the FSF for GPL licensed software.
<https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
|
|
Attributes was written to behave much like a normal table, in order to
simplify working with it. However, all Attr containing elements were
changed to provide panflute-like accessors to Attr components, rendering
the previous approach unnecessary.
|
|
Attributes are always passed as the last element, making it possible to
omit this argument. Argument order for `Header` was wrong and is fixed.
|
|
Meta elements that are treated as lua tables (i.e. MetaList,
MetaInlines, MetaBlocks, and MetaMap), are no longer wrapped in an
additional table but simply marked via a metatable. This allows
treating those meta values just like normal tables, while still making
empty elements of those values distinguishable.
|
|
Element attributes are pushed to the stack via the `Attributes`
function. `Attributes` creates an Attr like triple, but the triple also
allows table-like access to key-value pairs.
|
|
|
|
Lua string are used to represent nullary data constructors. The previous
table-based representation was based on the JSON serialization, but can
be simplified. This also matches the way those arguments are passed to
custom writers.
|
|
The lua filters and custom lua writer system defined very similar
StackValue instances for strings and tuples. These instance definitions
are extracted to a separate module to enable sharing.
|
|
|
|
Native lua booleans and strings are used to represent MetaBool and
MetaString values. This is more natural than the previous table-based
representation. The old lua representation can still be read back to
haskell, ensuring compatibility with the `pandoc.MetaBool` and
`pandoc.MetaString` lua constructors.
|
|
Pushing values to the lua stack via custom functions is faster and more
flexible.
|
|
All element creation tasks are handled by lua functions defined in the
pandoc module.
|
|
All element creation tasks are handled in the lua module.
|
|
|
|
Inline elements are no longer pushed and pulled via aeson's Value.
|
|
Pandoc elements are pushed and pulled from the lua stack via custom
instances.
|
|
Reading of simple block values from the lua stack is handled manually,
but most block constructors are still handled via instances of aeson's
Value type.
|
|
Getting inline instances from the lua stack is handled manually for some
simple inline constructors, including the `Str` constructor. This avoids
the indirect route through aeson's Value type and improves performance
considerably (approx. 30% speedup for some filters).
|
|
Plain text readers are exposed to lua scripts via the `pandoc.reader`
submodule, which is further subdivided by format. Converting e.g. a
markdown string into a pandoc document is possible from within lua:
doc = pandoc.reader.markdown.read_doc("Hello, World!")
A `read_block` convenience function is provided for all formats,
although it will still parse the whole string but return only the first
block as the result.
Custom reader options are not supported yet, default options are used
for all parsing operations.
|