dialoa / collection Goto Github PK
View Code? Open in Web Editor NEWA Pandoc Lua filter to build collections
License: MIT License
A Pandoc Lua filter to build collections
License: MIT License
Citeproc crashes when the bibliography field is present but empty. It would be nice for collection
to be able to validate import sources metadata before building them.
Currently the filter simply throws metadata at the imported file with --metadata-file
flags, without e.g. first integrating the generic and child metadata specified in master. In a redesign it would first build the metadata first, validate it, and then send it to the imported file.
Currently in native import mode we run pandoc -t json. This is useless if people use filters that need to have the ultimate output format in FORMAT.
Solution: we run pandoc -t FORMAT (adjusting html when building an epub), but we catch the AST object rather than the output. To do this we need a filter that outputs the AST as json in a temp file that we can pick up. The command would look something like this:
pandoc source -t FORMAT -L catch.lua -M catch-filter-output=temporary.json
When targetting LaTeX pandoc-crossref (and possibly other filters) turn citations in to \ref commands. Since we run isolate after other filters, these aren't prefixed.
NB, check out the case in which the RawInline includes more than \ref, e.g. some formatting (\ref{...}), or perhaps when the ref is within a large LaTeX block.
Provide an option to continue example lists from one source to another
When gathering bibliography fields from sources, adjust relative paths. On by default, option to deactivate.
Without or with --extract-media.
A document can hyperlink to files of any type. When links have relative targets, we need to make sure that they're correct in the resulting document. What are the options?
3 is needed to make image inclusion in PDF/epub and extract-media work. We should cater to 1 in case the user is already entering the links with a specific root in mind. We might want to cater for 2 as it mimicks having writen a big master document directly with links relative to it. We might want to cater for 4 to ensure outputs work out
I suggest implementing 3 and 1. Users can achieve 2 and 4 by running pandoc from the master or output directory, respectively and relying on 3.
See example 04, recursive mode. Currently the sub-master file needs to specify the location of its children relative to the main master.
If a user runs the collection with --extract-media, we need to extract the media from every source and put them in a common folder. Provided each source's path in the combined document is relative to the pwd, Pandoc will reproduce the relevant folder structure in the new media bag (at least if the locations are subfolders of pwd), so this alone should prevent any filename conflict. Check that this is the case.
Pandoc sets some template variables automatically: $math$
if there's math, $csl-refs$
if there are citeproc references, and so on. In Raw mode these are set wrong because by the time the raw blocks are imported in the master document Pandoc doesn't see the citeproc references and the maths.
Workaround: the template should include needed LaTeX code unconditionally. Downside: will load mathjax only if not needed.
Workaround 2: make our own duplicates of Pandoc's internal template variables, and pass them from sources to main?
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.