Git Product home page Git Product logo

Comments (6)

Oreolek avatar Oreolek commented on July 21, 2024

Maybe Pandoc?

from gamebookformat.

lifelike avatar lifelike commented on July 21, 2024

Yes, Pandoc is a tool I consider. Probably a format that Pandoc can use as input.

But I suspect Twine export (and graphs?) would still have to be implemented by essentially parsing the entire file and supporting all formatting markup it has.

So probably the simplest possible markup language that has good text editor support, a python library to parse it, and is supported by Pandoc. Preferably one that makes it possible to do things like inventory management and disabling some links without too many kludges.

from gamebookformat.

lifelike avatar lifelike commented on July 21, 2024

An alternative that would solve many/most/all issues would be to use a custom format but enforce a much stricter output style (possibly with a few different templates). Almost every gamebook use a format where there are no inline links in the text but rather just paragraphs of plain text followed by a list of possible branches to follow. That is also the most common form used in digital books. There are some exceptions to this, but the old/current gamebookformat (and other tools?) would still be around for that. With a much simpler structure like that it would be possible to feed everything to Pandoc for instance (and Twine) without too much code to maintain.

from gamebookformat.

lifelike avatar lifelike commented on July 21, 2024

I experimented with Pandoc a bit a few weeks ago and it looks very promising. With a very simple Lua filter a Markdown file can be processed to have numbered headers (all links and headers rewritten by the filter) and then output to a PDF or HTML or EPUB or other formats. Basically everything useful that gamebookformat does, other than the graphs. I think graphs can be done reasonably easily by outputting to JSON (that Pandoc also handles) and write an external script to turn that into a DOT file for GraphViz. The JSON-file can be used for checks similar to what gamebookformat does (look for sections that can not be reached etc).

My experimental filter does not shuffle the paragraphs, but not sure if that is a significant issue, and actually it is probably a more sane way to work with a gamebook anyway.

When I get around to post that as its own new project I will link to it from here and then symbolically close this issue.

from gamebookformat.

lifelike avatar lifelike commented on July 21, 2024

I experimented with Pandoc a bit a few weeks ago and it looks very promising. With a very simple Lua filter a Markdown file can be processed to have numbered headers (all links and headers rewritten by the filter) and then output to a PDF or HTML or EPUB or other formats. Basically everything useful that gamebookformat does, other than the graphs.

For graphs it should be possible to also use Pandoc and a Lua custom output format writer to generate a DOT file. The same feature can probably be abused to generate a report of unreachable paragraphs or unexpected endings etc.
http://lua.space/general/extending-pandoc-with-lua

My experimental filter does not shuffle the paragraphs, but not sure if that is a significant issue, and actually it is probably a more sane way to work with a gamebook anyway.

When I get around to post that as its own new project I will link to it from here and then symbolically close this issue.

from gamebookformat.

lifelike avatar lifelike commented on July 21, 2024

Posted a new repository with a Pandoc filter for gamebooks, which I think makes a lot more sense. There is not (yet?) any support for outputting graphs or sanity-checking books that gamebookformat can do, but it does number and shuffle paragraphs, and Pandoc has tons of features for taking care of everything else (outputs EPUB, PDF, HTML, DOCX, and many other file formats).

https://github.com/lifelike/pangamebook

from gamebookformat.

Related Issues (7)

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.