GithubHelp home page GithubHelp logo

collection's People

Contributors

jdutant avatar twsh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

twsh

collection's Issues

Convert links to any material

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?

  1. Mimick pandoc's behaviour. Let the source files relative links as they are.
  2. Adjust to make them relative to the master file directory.
  3. Adjust to make them relative to the present working directory.
  4. Adjust to make them relative to the output file directory.

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.

Native mode should set FORMAT correctly

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

Isolate + pandoc-crossref when targetting LaTeX

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.

  • one solution would be run isolate before and recognize the pandoc-crossref pseudo-citation links, revise them. Pb: doesn't work for other filters, you still need to run isolate after other filters in case they created links.
  • another solution is for isolate to scan the rawinlines too for LaTeX ref commands.

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.

Pandoc's template variables are wrong in raw mode

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?

Handle media filenames conflicts when using --extract-media

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.

Build and validate import metadata

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.