mvhenderson / pandoc-filter-node Goto Github PK
View Code? Open in Web Editor NEWPandoc filtering for Node.js
License: MIT License
Pandoc filtering for Node.js
License: MIT License
What it says in the title.
Hi - thanks for this project.
However, one thing that this lacks right now is support for promises being returned from the action method. Given the async nature in node, this is almost mandatory. I've looked at the tests and they don't have an example either.
Would also be awesome to have an example/test showing async callback code in action - say for example the abc.py sample from the python pandoc filters repo.
I don't know enough about JavaScript to know whether this is the same issue as #1 (though I suspect it is), but let me describe it anyway :-)
All the examples end with pandoc.stdio(action)
where action
is a function like:
function action(type, value, format, meta) {
// ...
return something;
}
In my case, inside action
I need to call a function that takes a callback (as is typical for Node):
function action(type, value, format, meta) {
// ...
doAsync(value, function () { ... });
}
So I won't have something to return from inside action
.
I am right now trying to hack it out by copying and editing much of the internals of pandoc-filter
.
(Specifically, stdio
which is an alias for toJSONFilter
calls filter
which calls walk
and it appears I need to hack a copy of that function: https://github.com/mvhenderson/pandoc-filter-node/blob/be9d69ac/index.js#L47,L79 .)
But I imagine this is a common use case, and it would be better if pandoc-filter
supported this.
Pandoc 3 introduces Figure
type, but this library doesn't seem to support it.
I'm using this package and while trawling through the pandoc repository I noticed that the next version of pandoc
will alter the JSON output.
It looks like the python pandocfilters project already supports the change, so I just thought I'd raise it here too.
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.