mirror of
https://github.com/Oreolek/gamebookformat.git
synced 2024-06-17 07:30:43 +03:00
paged option
This commit is contained in:
parent
a27567979e
commit
72c05c7202
35
examples/paged.gamebook
Normal file
35
examples/paged.gamebook
Normal file
|
@ -0,0 +1,35 @@
|
|||
title = Paged Option
|
||||
id = paged
|
||||
|
||||
= Introduction
|
||||
This gamebook is formatted with the [b]paged[/b] option.
|
||||
Every section should begin at the top of a new page.
|
||||
Not the introsections though.
|
||||
|
||||
= Another Heading
|
||||
This is another introsection, just to confirm that
|
||||
it is not cause a new page-break.
|
||||
|
||||
= Formats
|
||||
Only some formats support page-breaks. HTML
|
||||
for instance currently does not (although it
|
||||
is technically possible to add it using
|
||||
print stylesheets).
|
||||
|
||||
* 1 start
|
||||
First section. You can go to [[second]] or [[third]]
|
||||
from here.
|
||||
|
||||
* second
|
||||
This is the second section. Yay.
|
||||
You can go on to [[third]] or [[end]] or back to [[start]].
|
||||
|
||||
* third
|
||||
This is the third section. It might or might not
|
||||
be numbered 3 though, because of the automatic
|
||||
section numbering in gamebookformat.
|
||||
You can go on to the end at [[end]].
|
||||
|
||||
* end
|
||||
This is The End.
|
||||
|
1
examples/paged.gamebook.options
Normal file
1
examples/paged.gamebook.options
Normal file
|
@ -0,0 +1 @@
|
|||
--option paged
|
5
options/paged/rtf/section.rtf
Normal file
5
options/paged/rtf/section.rtf
Normal file
|
@ -0,0 +1,5 @@
|
|||
\page \b \qc {\*\bkmkstart s%(nr)d}%(nr)d{\*\bkmkend s%(nr)d}
|
||||
\b0\
|
||||
\ql %(text)s \
|
||||
\
|
||||
|
6
options/paged/tex/sectionheading.tex
Normal file
6
options/paged/tex/sectionheading.tex
Normal file
|
@ -0,0 +1,6 @@
|
|||
\clearpage
|
||||
\phantomsection
|
||||
\refstepcounter{sectionnr}
|
||||
\label{section%(nr)d}
|
||||
\subsection*{\begin{center} \textbf{%(nr)d} \end{center}}
|
||||
|
26
readme.org
26
readme.org
|
@ -46,14 +46,15 @@ You can use *-o list* to generate a text file listing all sections and
|
|||
their numbers, or *-o list -i todo* to only list sections tagged as
|
||||
todo (or substitute whatever other tag(s) you are interested in).
|
||||
|
||||
| Name | Formats | Description |
|
||||
|----------+---------+-------------------------------------------------|
|
||||
| a4 | tex | A4 paper size documents (PDF). |
|
||||
| a5 | tex | A5 paper size documents (PDF). |
|
||||
| htmlbook | html | Generate [[https://github.com/oreillymedia/HTMLBook][HTMLBook]] compatible HTML. |
|
||||
| letter | tex | Letter paper size documents (PDF). |
|
||||
| list | txt | Only generate list of sections. |
|
||||
| static | html | Remove script link from HTML output. |
|
||||
| Name | Formats | Description |
|
||||
|----------+---------+----------------------------------------------------------------------------|
|
||||
| a4 | tex | A4 paper size documents (PDF). |
|
||||
| a5 | tex | A5 paper size documents (PDF). |
|
||||
| htmlbook | html | Generate [[https://github.com/oreillymedia/HTMLBook][HTMLBook]] compatible HTML. |
|
||||
| letter | tex | Letter paper size documents (PDF). |
|
||||
| list | txt | Only generate list of sections. |
|
||||
| paged | rtf,tex | Insert page-break before each section. (Not supported by all RTF viewers.) |
|
||||
| static | html | Remove script link from HTML output. |
|
||||
|
||||
** Adding Custom Templates
|
||||
Any of the built-in templates can be overridden easily. New
|
||||
|
@ -92,7 +93,6 @@ easy to add overrides without replacing anything (for
|
|||
instance by making a template with a *html/head-overrides.html* file).
|
||||
(TODO: Add example showing how to do that, because the last few
|
||||
sentences here probably did not make sense to anyone.)
|
||||
|
||||
** PDF (easy way)
|
||||
An easy way to make a PDF is to make a *RTF* of a book
|
||||
(eg *formatgamebook.py mybook.gamebook mybook.rtf*) and then
|
||||
|
@ -128,7 +128,6 @@ or *-o htmlbook* options. [[http://calibre-ebook.com/][Calibre]] seems to do a g
|
|||
to EPUB, so that should be a start. You probably want to
|
||||
do some experimentation to find a way that creates results
|
||||
you like.
|
||||
|
||||
** Twine 2 Export
|
||||
There is experimental support to generate output for [[http://twinery.org/2/#stories][Twine 2]]. Use
|
||||
output format *.twine2*. Use the *Import From
|
||||
|
@ -154,7 +153,6 @@ Run *checkgamebook.py -v* for verbose mode. Currently that just
|
|||
means that all ending (death?) sections of the book are printed,
|
||||
allowing you to manually check that there are no unexpected
|
||||
dead-ends.
|
||||
|
||||
** Number Map Files
|
||||
Whenever formatgamebook.py runs it looks for a file with the same
|
||||
name as the output file, but with a .map suffix (eg output.map if
|
||||
|
@ -176,7 +174,6 @@ the gamebook itself.
|
|||
tl;dr: If you make different output files in different formats the
|
||||
generated .map file will ensure that all files use the same
|
||||
random numbers for the same section.
|
||||
|
||||
** Gamebook Format
|
||||
The input file expected by the formatgamebook.py script must be in a
|
||||
format containing information about all sections in the book
|
||||
|
@ -188,17 +185,13 @@ 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 :: Or other tool to make PDF documents from [[http://www.latex-project.org/][tex files]].
|
||||
- Graphviz :: Includes the dot command that can make images from [[http://en.wikipedia.org/wiki/DOT_%28graph_description_language%29][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).
|
||||
|
@ -207,7 +200,6 @@ the scripts (and even then you can proabbly do without all or most).
|
|||
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
|
||||
|
|
10
todo.org
10
todo.org
|
@ -1,4 +1,4 @@
|
|||
* TODO [65/95] [68%]
|
||||
* TODO [66/102] [64%]
|
||||
** DONE Debug output
|
||||
** DONE DOT output
|
||||
** DONE LaTeX output
|
||||
|
@ -85,11 +85,15 @@
|
|||
CLOSED: [2014-09-23 Tue 23:10]
|
||||
** DONE Debug output should be called just JSON
|
||||
CLOSED: [2014-09-24 Wed 21:36]
|
||||
** TODO Make default templates for more tags
|
||||
** Make default templates for more tags
|
||||
CLOSED: [2015-04-08 Wed 21:01]
|
||||
Many tags can default to do the same as a b-tag for bold for instance.
|
||||
Make as many DEFAULT templates as possible and remove format-specific ones.
|
||||
This will make further development so much more nice.
|
||||
** TODO Paged option
|
||||
Actually not doing this, because the default just showing inner text
|
||||
is the best default anyway.
|
||||
** DONE Paged option
|
||||
CLOSED: [2015-04-08 Wed 21:31]
|
||||
Option -o paged to make each section render on its own page.
|
||||
Add template overrides for at least html, tex, and rtf.
|
||||
Probably change the style for section headers as well.
|
||||
|
|
Loading…
Reference in a new issue