1
0
Fork 0
mirror of https://github.com/Oreolek/gamebookformat.git synced 2024-05-01 16:49:23 +03:00
Go to file
2013-06-29 22:05:12 +02:00
examples Added example gamebook to post to BGG. 2013-06-25 23:18:54 +02:00
expected DOT templates no longer relying on hack to get refs. 2013-06-26 18:47:14 +02:00
o Optional templates to select PDF (LaTeX) paper format (A5, A4, or Letter). 2013-06-29 21:43:59 +02:00
templates DOT templates no longer relying on hack to get refs. 2013-06-26 18:47:14 +02:00
test/templatejs node test script working with new html scripts 2013-06-16 22:25:16 +02:00
.gitignore Stubs for testing html template javascript using node.js. 2013-06-16 09:41:32 +02:00
buildexamplegamebook.py Print command-line used when building example gamebook. 2013-06-29 22:05:12 +02:00
formatgamebook.py Option to only include sections with specific tag. 2013-06-16 23:43:45 +02:00
gamebookformat.css HTML output now playable with JavaScript disabled or missing js file. 2013-06-18 22:59:13 +02:00
gamebookformatplay.js Cost tag that sets a price on something found. 2013-06-24 01:14:30 +02:00
Makefile Attempt to make checkexpected test more stable. 2013-06-23 22:51:09 +02:00
output.py DOT templates no longer relying on hack to get refs. 2013-06-26 18:47:14 +02:00
quote.py Basic quoting of different output formats. 2013-06-11 00:02:29 +02:00
readme.org Option to only include sections with specific tag. 2013-06-16 23:43:45 +02:00
sections.py Fixed problem with section used for missing. 2013-06-20 22:59:25 +02:00
templates.py templates.py can be executed now to extract a template from command-line. 2013-06-16 09:06:21 +02:00
test_output.py Removed test for found references, code now being removed. 2013-06-26 18:48:19 +02:00
test_sections.py Option to only include sections with specific tag. 2013-06-16 23:43:45 +02:00
todo.org Template for plain non-tagged text. 2013-06-26 11:37:48 +02:00

gamebookformat

A tool to format gamebooks into various formats useful for playing the gamebook on paper or a screen (or for debugging it).

Usage

formatgamebook.py [-h] [-M] [-t D] inputfile [inputfile ...] outputfile

positional arguments:
  inputfile             input gamebook file (eg test.gamebook)
  outputfile            output file (eg test.tex or test.rtf)

optional arguments:
  -h, --help            show this help message and exit
  -i T, --include T     only include sections with tag
  -M, --no-default-map  ignore default map file
  -t D, --template D    add custom template dir
  -S, --no-shuffle      do not shuffle sections

Supported Output Formats

Name Extension Description
LaTeX .tex Useful to generate PDFs using pdflatex or whatever LaTeX tools you prefer.
Rich Text Format .rtf Supported because the Windhammer Prize requires it.
Graphviz DOT .dot Use with the Graphviz dot tool to generate a flowchart graph of all sections in the gamebook.
HTML .html Play gamebook in browser.
Plain Text .txt Raw plain text without formatting.
Debug Plain Text .debug Plain text debug output of gamebook contents.

More to be added.

Gamebook Format

The input file expected by the formatgamebook.py script must be in a format containing information about all sections in the book plus some optional metadata. The format should (when TBD) be documented here.

By design the format is similar enough to Emacs Org-Mode that some edit shortcuts works in that mode without additional configuration (eg C-c C-q to edit section tags). References to sections can be followed using C-c C-o while editing the book in org-mode.

Dependencies

Required

Python 2.7
To run formatgamebook.py.

Optional

To make something useful from some of the outputted files.

pdflatex
Make pdf from tex files.
Graphviz
Includes the dot command that can make images from dot files.

Development

The following are only needed for working on improving the scripts (and even then you can proabbly do without all or most).

GNU make
Runs tests and various other useful development tasks. (This in turn depends on some tools like diff, but if you have make installed you probably have them as well.)
node.js
To run some tests of HTML (JavaScript) templates.
nodeunit
Unit test framework for node.js.

License

Copyright (c) 2013 Pelle Nilsson All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.