Giter VIP home page Giter VIP logo

questworlds's People

Contributors

eggdropsoap avatar iancooper avatar jlaufersweiler avatar sciencefish avatar

Watchers

 avatar

questworlds's Issues

Automatically compile ConTeXt to PDF

Currently, create_context.sh compiles the markdown to TeX source (to be edited/refined/compiled manually).

Once stable, create_context.sh or its successor should either make pandoc produce ConTeXt-PDFs directly, or invoke the context engine to do so after compiling the ConTeXt source.

preamble.ctx and preamble.book.ctx need to be integrated

The preamble.ctx and preamble.book.ctx files exist because they allow hacking on the ConTeXt PDF results without having to constantly re-run pandoc.

Once stable, their contents should either be integrated into the respective context*.template files, or used as input to the -H switch of pandoc in create_context.sh.

(TeX) Auto-numbering sections doesn't match hardcoded numbers

Stripping off the hardcoded numbers in the markdown Headers to let ConTeXt generate real section numbers works, but the resulting numbering isn't tracking the original numbering right. The obstacle is twofold:

  • Switching from table section headers to markdown table captions removes those as numbered sections, drifting the numbering sequence.
  • Some hardcoded numbering does not progress systematically. This can be from numbering errors (e.g.) or non-systematic numbering (e.g., §5.0.1).

Both reasons should be respected / not affect the numbering by the ConTeXt PDF output.

Possible fix strategies

Both could be fixed by having pandoc generate ownnumber= keys in the \section calls.

Addressing this with a filter similar to stripHeaderNumbers.lua and a post-processor, perhaps a piece of inline Lua code in the ConTeXt template, to embed the hardcoded numbers into the sections with \section[ownnumber=] might work. Since the context writer discards the key=value section, processing after the filter is necessary—the number can only be smuggled in via the reference= value, which if I use a regular format, can be parsed back into a correct ownnumber= value. Might also require a whole separate post-processor on the tex code before compiling, since I'm not sure that embedded Lua can easily grab and manipulate surrounding ConTeXt code.

(In theory it should be addressed with a simpler filter that directly places ownnumber, but Pandoc's ConTeXt writer discards the key=value section of the Pandoc AST that filters operate on.)

Just the problems caused by the tables section->caption change could be addressed by reverting that in the markdown sources, filtering to place non-display section headers that still participate in the numbering sequence, while using the filter to inject table captions. That may be more viable for long-term upstream compatibility. This still leaves the problem of sequence drift caused by upstream non-systematic hand-numbered sections (e.g., §5.0.1). That still can only be fixed by some kind of hard-coded number, such as reverting to hand-numbering in the titles, or some kind of solution using ownnumber=.

Side benefits of fixing by filter

While processing header numbers into reference fields in the AST, we can also have the script freelance and go find all the "see §x.x" text and replace with a live internal link. The reference being used to smuggle the numbering means that we'll have a regular, unique* identifier that is known accurate to use in the internal link.

* Will not be unique in case of repeated section numbers in the source. That's fine: testing shows context will just link to the first header reference, and otherwise not misbehave due the duplicate reference. It will just throw a warning during compile. On the plus side, such warnings will alert to numbering errors in the markdown sources.

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.