josineto / pandoc-odt-filters Goto Github PK
View Code? Open in Web Editor NEWFilters to improve pandoc's conversion to ODT
License: GNU General Public License v3.0
Filters to improve pandoc's conversion to ODT
License: GNU General Public License v3.0
Thank you for this effort. Today I tried to use your filter
pandoc -t odt+smart --lua-filter odt-custom-styles.lua "Cattolicesimo romano e forma politica".md -o "Cattolicesimo romano e forma politica".odt
but I get this error message:
Error running filter odt-custom-styles.lua: [string "odt-custom-styles.lua"]:7: unexpected symbol near '<'
and so: no conversion
Hey @jzeneto,
Thanks for the filters. I'm still wrapping my head around the lua
syntax and what's being done in odt-custom-styles.lua
, but I think I'll be able to contribute back once I do.
So, the custom styles are not being created for me.
Here's my command:
pandoc Thinspace.html --lua-filter ./pandoc-odt-filters/odt-custom-styles.lua -o thinspace-pandoc3.odt
I have markup that looks like this:
<div custom-style="scene-sep" class="scene-sep" style="text-align: center;">* * * * *</div>
It is styled on output in odt
as Text body
, and there is no custom style created called scene-sep
as expected.
I'll dive into this in the evening, but any leads as to why this is not working?
Also, I have full control over input markup. (I wrote a bunch of gulp plugins to coerce my md
files into the output html structure.)
I saw that here you are using a replacement function to just look up a value in a table. The function is unnecessary since if you pass a table with string keys and values as the replacement argument to string.gsub
Lua will automatically use the first capture (or the whole match if there was no capture) as a key to look up in the table and use the value of that key as replacement, so you can replace that with
text = string.gsub(text, escPattern, escapes)
and it will have the exact same effect, except that since no extra Lua function is created and called every time it is much more efficient. (You will still need a function if you want to look up another capture than the first one of course!)
hello - tested this out of curiosity - it seems tables do not show properly because the included text is somehow converted to paragraph style
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.