1
0
Fork 0
mirror of https://github.com/Oreolek/gamebookformat.git synced 2024-06-16 23:20:44 +03:00

Started documentation.

Also some tricks to get everything through checkexpected,
and a new b tag for bold text (only in html and json for now).
This commit is contained in:
Pelle Nilsson 2014-10-28 00:06:26 +01:00
parent a688ee9c27
commit 0cecd4cf63
27 changed files with 524 additions and 0 deletions

47
examples/doc.gamebook Normal file
View file

@ -0,0 +1,47 @@
title = gamebookformat 1.0 documentation
author = Pelle Nilsson
= Introduction
This is the documentation for gamebookformat 1.0. It was itself generated using
gamebookformat (or more precisely the formatgamebook.py tool).
* 1 start
[b]Getting Started.[b]
* 2 install
[b]Installation.[b]
* 3 tutorials
[b]Tutorials.[/b]
There are 4 tutorials of increasing complexity currently included
in this document: [[basictut][The Basic Tutorial]] shows how to make a simple
static gamebook for printing or reading on a screen.
[[advancedtut][The Advanced Tutorial]] adds many formatting tricks to make more
interesting gamebooks, but still only very static.
[[dyntut][The Dynamic Tutorial]] finally explains how to add mark-up to your
gamebooks to be make dynamic HTML gamebooks that can be played
in a browser (while still work well if it is printed on paper or
viewed in a simple ebook reader). Finally
[[custtut][The Customization Tutorial]] shows how to override the default templates
to make small or big changes to how gamebooks are rendered. The
tutorials do not cover all features of gamebookformat, so also
have a look at the included examples and the [[reference][Reference section below]]
to learn about all the things the tools can do.
* 4 basictut
[b]Basic Tutorial.[/b]
This tutorial will guide you through creating a simple gamebook with linked sections of text
with some simple formatting,
resulting in static html and rtf documents that can be easily navigated for manual play
printed on paper or on any computer or ebook reader.
* 5 advancedtut
[b]Advanced Tutorial.[/b]
This tutorial continues the [[basictut][Basic Tutorial]], only adding some more
details to do more advanced formatting like adding images to
books or how to make links that display text instead of numbers.
* 6 dyntut
[b]Dynamic Tutorial.[/b]
* 7 custtut
[b]Customization Tutorial[/b].
* 8 reference
[b]Reference.[/b]

1
expected/bgg.map Normal file
View file

@ -0,0 +1 @@
{"start": 1, "second": 4, "end": 2, "third": 3}

1
expected/codewords.map Normal file
View file

@ -0,0 +1 @@
{"notsofun": 8, "autotest": 7, "the_end": 3, "second": 2, "choice": 9, "xortest": 4, "start": 1, "noautotest": 6, "cheater": 5}

1
expected/counters.map Normal file
View file

@ -0,0 +1 @@
{"death": 4, "start": 1, "inittest2": 2, "inittest": 3, "getgold": 9, "losegold": 7, "rich": 6, "dangerous": 8, "hurrah": 5}

7
expected/doc.check Normal file
View file

@ -0,0 +1,7 @@
examples/doc.json: Could not reach section 'custtut' from start.
examples/doc.json: Could not reach section 'basictut' from start.
examples/doc.json: Could not reach section 'dyntut' from start.
examples/doc.json: Could not reach section 'install' from start.
examples/doc.json: Could not reach section 'tutorials' from start.
examples/doc.json: Could not reach section 'advancedtut' from start.
examples/doc.json: Could not reach section 'reference' from start.

8
expected/doc.dot Normal file
View file

@ -0,0 +1,8 @@
digraph gamebook {
Getting Started.Installation.Tutorials.3->4
3->5
3->6
3->7
3->8
Basic Tutorial.Advanced Tutorial.5->4
Dynamic Tutorial.Customization TutorialReference.}

157
expected/doc.html Normal file
View file

@ -0,0 +1,157 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1">
<title>gamebookformat 1.0 documentation</title>
<script type="text/javascript" src="gamebookformatplay.js"></script>
<link rel="stylesheet" href="gamebookformat.css"
type="text/css" />
<script>
if (typeof gamebook !== 'undefined') {
gamebook.id = 'doc';
}
</script>
</head>
<body>
<div class="hideintrolink nodisplay"
onclick="gamebook.hideIntroSections()">(hide instructions)</div>
<div class="gamebook">
<div class="introsection">
<div class="introsectionheading">Introduction</div>
<div class="introsectionbody">
This is the documentation for gamebookformat 1.0. It was itself generated using gamebookformat (or more precisely the formatgamebook.py tool).
</div>
</div>
<div class="resumelink nodisplay"
onclick="gamebook.loadGame()">Resume saved game.</div>
<div class="startlink"
onclick="gamebook.turnTo(1)">Turn to 1 to begin.</div>
<script>
if (typeof gamebook !== 'undefined' && gamebook.hasSavedGame()) {
var resumeLinks = document.getElementsByClassName('resumelink');
Array.prototype.forEach.call(resumeLinks, function(e) {
e.classList.remove('nodisplay');
});
}
</script>
<div class="section" id="section1">
<div class="sectionnumber" id="para1">1</div>
<div class="sectiontext">
<b>Getting Started.</b>
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(1, document.getElementById('section1'));
}
</script><div class="section" id="section2">
<div class="sectionnumber" id="para2">2</div>
<div class="sectiontext">
<b>Installation.</b>
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(2, document.getElementById('section2'));
}
</script><div class="section" id="section3">
<div class="sectionnumber" id="para3">3</div>
<div class="sectiontext">
<b>Tutorials.</b>
There are 4 tutorials of increasing complexity currently included in this document: <a class="sectionref enabledlink" data-ref="4"
href="#section4">The Basic Tutorial</a> shows how to make a simple static gamebook for printing or reading on a screen. <a class="sectionref enabledlink" data-ref="5"
href="#section5">The Advanced Tutorial</a> adds many formatting tricks to make more interesting gamebooks, but still only very static. <a class="sectionref enabledlink" data-ref="6"
href="#section6">The Dynamic Tutorial</a> finally explains how to add mark-up to your gamebooks to be make dynamic HTML gamebooks that can be played in a browser (while still work well if it is printed on paper or viewed in a simple ebook reader). Finally <a class="sectionref enabledlink" data-ref="7"
href="#section7">The Customization Tutorial</a> shows how to override the default templates to make small or big changes to how gamebooks are rendered. The tutorials do not cover all features of gamebookformat, so also have a look at the included examples and the <a class="sectionref enabledlink" data-ref="8"
href="#section8">Reference section below</a> to learn about all the things the tools can do.
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(3, document.getElementById('section3'));
}
</script><div class="section" id="section4">
<div class="sectionnumber" id="para4">4</div>
<div class="sectiontext">
<b>Basic Tutorial.</b>
This tutorial will guide you through creating a simple gamebook with linked sections of text with some simple formatting, resulting in static html and rtf documents that can be easily navigated for manual play printed on paper or on any computer or ebook reader.
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(4, document.getElementById('section4'));
}
</script><div class="section" id="section5">
<div class="sectionnumber" id="para5">5</div>
<div class="sectiontext">
<b>Advanced Tutorial.</b>
This tutorial continues the <a class="sectionref enabledlink" data-ref="4"
href="#section4">Basic Tutorial</a>, only adding some more details to do more advanced formatting like adding images to books or how to make links that display text instead of numbers.
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(5, document.getElementById('section5'));
}
</script><div class="section" id="section6">
<div class="sectionnumber" id="para6">6</div>
<div class="sectiontext">
<b>Dynamic Tutorial.</b>
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(6, document.getElementById('section6'));
}
</script><div class="section" id="section7">
<div class="sectionnumber" id="para7">7</div>
<div class="sectiontext">
<b>Customization Tutorial</b>
.
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(7, document.getElementById('section7'));
}
</script><div class="section" id="section8">
<div class="sectionnumber" id="para8">8</div>
<div class="sectiontext">
<b>Reference.</b>
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(8, document.getElementById('section8'));
}
</script> <div id="counters" class="counters">
</div>
<div id="counterTemplate" class="counterTemplate">
<span class="counterheading"></span>
<span class="countercontents"></span>
</div>
</div>
<div id="collections" class="collections">
</div>
<div id="collectionTemplate" class="collectionTemplate">
<span class="collectionheading"></span>
<span class="collectioncontents"></span>
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.prepare();
}
</script>
<div class="displayintrolink nodisplay"
onclick="gamebook.showIntroSections()">(show instructions)</div>
</div>
</body>
</html>

50
expected/doc.json Normal file
View file

@ -0,0 +1,50 @@
{
"title" : "gamebookformat 1.0 documentation",
"nr_sections" : "8",
"Introduction" : {
"intro" : true,
"text" : ["" ," This is the documentation for gamebookformat 1.0. It was itself generated using gamebookformat (or more precisely the formatgamebook.py tool). "]
},
"sections" : {"IGNORE-debug-json-padding-IGNORE" : "", "start" : {
"nr" : 1,
"text" : ["" ," ", "Getting Started."
," "]
}
, "install" : {
"nr" : 2,
"text" : ["" ," ", "Installation."
," "]
}
, "tutorials" : {
"nr" : 3,
"text" : ["" ," ", "Tutorials."
," There are 4 tutorials of increasing complexity currently included in this document: ",{"reference" : "4", "name" : "The Basic Tutorial"}," shows how to make a simple static gamebook for printing or reading on a screen. ",{"reference" : "5", "name" : "The Advanced Tutorial"}," adds many formatting tricks to make more interesting gamebooks, but still only very static. ",{"reference" : "6", "name" : "The Dynamic Tutorial"}," finally explains how to add mark-up to your gamebooks to be make dynamic HTML gamebooks that can be played in a browser (while still work well if it is printed on paper or viewed in a simple ebook reader). Finally ",{"reference" : "7", "name" : "The Customization Tutorial"}," shows how to override the default templates to make small or big changes to how gamebooks are rendered. The tutorials do not cover all features of gamebookformat, so also have a look at the included examples and the ",{"reference" : "8", "name" : "Reference section below"}," to learn about all the things the tools can do."]
}
, "basictut" : {
"nr" : 4,
"text" : ["" ," ", "Basic Tutorial."
," This tutorial will guide you through creating a simple gamebook with linked sections of text with some simple formatting, resulting in static html and rtf documents that can be easily navigated for manual play printed on paper or on any computer or ebook reader."]
}
, "advancedtut" : {
"nr" : 5,
"text" : ["" ," ", "Advanced Tutorial."
," This tutorial continues the ",{"reference" : "4", "name" : "Basic Tutorial"},", only adding some more details to do more advanced formatting like adding images to books or how to make links that display text instead of numbers."]
}
, "dyntut" : {
"nr" : 6,
"text" : ["" ," ", "Dynamic Tutorial."
," "]
}
, "custtut" : {
"nr" : 7,
"text" : ["" ," ", "Customization Tutorial"
,"."]
}
, "reference" : {
"nr" : 8,
"text" : ["" ," ", "Reference."
]
}
}}

1
expected/doc.map Normal file
View file

@ -0,0 +1 @@
{"custtut": 7, "basictut": 4, "reference": 8, "start": 1, "dyntut": 6, "install": 2, "tutorials": 3, "advancedtut": 5}

80
expected/doc.rtf Normal file
View file

@ -0,0 +1,80 @@
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww14140\viewh14860\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
\f0\b\fs24 \cf0
\b \qc gamebookformat 1.0 documentation
\b0\
\
\b \qc Introduction
\b0\
\ql This is the documentation for gamebookformat 1.0. It was itself generated using gamebookformat (or more precisely the formatgamebook.py tool). \
\
\b Turn to 1 to begin.
\b0\
\
\b \qc {\*\bkmkstart s1}1{\*\bkmkend s1}
\b0\
\ql Getting Started. \
\
\b \qc {\*\bkmkstart s2}2{\*\bkmkend s2}
\b0\
\ql Installation. \
\
\b \qc {\*\bkmkstart s3}3{\*\bkmkend s3}
\b0\
\ql Tutorials. There are 4 tutorials of increasing complexity currently included in this document: \b {\field{\*\fldinst REF s4 \\h }{\fldrslt The Basic Tutorial}}
\b0
shows how to make a simple static gamebook for printing or reading on a screen. \b {\field{\*\fldinst REF s5 \\h }{\fldrslt The Advanced Tutorial}}
\b0
adds many formatting tricks to make more interesting gamebooks, but still only very static. \b {\field{\*\fldinst REF s6 \\h }{\fldrslt The Dynamic Tutorial}}
\b0
finally explains how to add mark-up to your gamebooks to be make dynamic HTML gamebooks that can be played in a browser (while still work well if it is printed on paper or viewed in a simple ebook reader). Finally \b {\field{\*\fldinst REF s7 \\h }{\fldrslt The Customization Tutorial}}
\b0
shows how to override the default templates to make small or big changes to how gamebooks are rendered. The tutorials do not cover all features of gamebookformat, so also have a look at the included examples and the \b {\field{\*\fldinst REF s8 \\h }{\fldrslt Reference section below}}
\b0
to learn about all the things the tools can do. \
\
\b \qc {\*\bkmkstart s4}4{\*\bkmkend s4}
\b0\
\ql Basic Tutorial. This tutorial will guide you through creating a simple gamebook with linked sections of text with some simple formatting, resulting in static html and rtf documents that can be easily navigated for manual play printed on paper or on any computer or ebook reader. \
\
\b \qc {\*\bkmkstart s5}5{\*\bkmkend s5}
\b0\
\ql Advanced Tutorial. This tutorial continues the \b {\field{\*\fldinst REF s4 \\h }{\fldrslt Basic Tutorial}}
\b0
, only adding some more details to do more advanced formatting like adding images to books or how to make links that display text instead of numbers. \
\
\b \qc {\*\bkmkstart s6}6{\*\bkmkend s6}
\b0\
\ql Dynamic Tutorial. \
\
\b \qc {\*\bkmkstart s7}7{\*\bkmkend s7}
\b0\
\ql Customization Tutorial. \
\
\b \qc {\*\bkmkstart s8}8{\*\bkmkend s8}
\b0\
\ql Reference. \
\
}

113
expected/doc.tex Normal file
View file

@ -0,0 +1,113 @@
\documentclass[a5paper,onecolumn]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[hidelinks]{hyperref}
\usepackage{graphicx}
\usepackage[top=3.3cm, bottom=3.3cm, left=2cm, right=2cm]{geometry}
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse
\else
\ifnum\pdfoutput=1
\pdftrue
\else
\pdffalse
\fi
\fi
\title{gamebookformat 1.0 documentation}
\author{Pelle Nilsson}
\date{}
\newcounter{sectionnr}
\begin{document}
\maketitle
\clearpage
\thispagestyle{empty}
\pagestyle{empty}
\subsection*{\begin{center} \textbf{Introduction} \end{center}}
\noindent
This is the documentation for gamebookformat 1.0. It was itself generated using gamebookformat (or more precisely the formatgamebook.py tool).
\vspace{1em}
Turn to 1 to begin.
\phantomsection
\refstepcounter{sectionnr}
\label{section1}
\subsection*{\begin{center} \textbf{1} \end{center}}
\noindent
Getting Started.
\vspace{1em}
\phantomsection
\refstepcounter{sectionnr}
\label{section2}
\subsection*{\begin{center} \textbf{2} \end{center}}
\noindent
Installation.
\vspace{1em}
\phantomsection
\refstepcounter{sectionnr}
\label{section3}
\subsection*{\begin{center} \textbf{3} \end{center}}
\noindent
Tutorials. There are 4 tutorials of increasing complexity currently included in this document: The Basic Tutorial (\textbf{\autoref{section4}})
shows how to make a simple static gamebook for printing or reading on a screen. The Advanced Tutorial (\textbf{\autoref{section5}})
adds many formatting tricks to make more interesting gamebooks, but still only very static. The Dynamic Tutorial (\textbf{\autoref{section6}})
finally explains how to add mark-up to your gamebooks to be make dynamic HTML gamebooks that can be played in a browser (while still work well if it is printed on paper or viewed in a simple ebook reader). Finally The Customization Tutorial (\textbf{\autoref{section7}})
shows how to override the default templates to make small or big changes to how gamebooks are rendered. The tutorials do not cover all features of gamebookformat, so also have a look at the included examples and the Reference section below (\textbf{\autoref{section8}})
to learn about all the things the tools can do.
\vspace{1em}
\phantomsection
\refstepcounter{sectionnr}
\label{section4}
\subsection*{\begin{center} \textbf{4} \end{center}}
\noindent
Basic Tutorial. This tutorial will guide you through creating a simple gamebook with linked sections of text with some simple formatting, resulting in static html and rtf documents that can be easily navigated for manual play printed on paper or on any computer or ebook reader.
\vspace{1em}
\phantomsection
\refstepcounter{sectionnr}
\label{section5}
\subsection*{\begin{center} \textbf{5} \end{center}}
\noindent
Advanced Tutorial. This tutorial continues the Basic Tutorial (\textbf{\autoref{section4}})
, only adding some more details to do more advanced formatting like adding images to books or how to make links that display text instead of numbers.
\vspace{1em}
\phantomsection
\refstepcounter{sectionnr}
\label{section6}
\subsection*{\begin{center} \textbf{6} \end{center}}
\noindent
Dynamic Tutorial.
\vspace{1em}
\phantomsection
\refstepcounter{sectionnr}
\label{section7}
\subsection*{\begin{center} \textbf{7} \end{center}}
\noindent
Customization Tutorial.
\vspace{1em}
\phantomsection
\refstepcounter{sectionnr}
\label{section8}
\subsection*{\begin{center} \textbf{8} \end{center}}
\noindent
Reference.
\vspace{1em}
\end{document}

31
expected/doc.txt Normal file
View file

@ -0,0 +1,31 @@
gamebookformat 1.0 documentation
Introduction
This is the documentation for gamebookformat 1.0. It was itself generated using gamebookformat (or more precisely the formatgamebook.py tool).
Turn to 1 to begin.
1
Getting Started.
2
Installation.
3
Tutorials. There are 4 tutorials of increasing complexity currently included in this document: The Basic Tutorial (4) shows how to make a simple static gamebook for printing or reading on a screen. The Advanced Tutorial (5) adds many formatting tricks to make more interesting gamebooks, but still only very static. The Dynamic Tutorial (6) finally explains how to add mark-up to your gamebooks to be make dynamic HTML gamebooks that can be played in a browser (while still work well if it is printed on paper or viewed in a simple ebook reader). Finally The Customization Tutorial (7) shows how to override the default templates to make small or big changes to how gamebooks are rendered. The tutorials do not cover all features of gamebookformat, so also have a look at the included examples and the Reference section below (8) to learn about all the things the tools can do.
4
Basic Tutorial. This tutorial will guide you through creating a simple gamebook with linked sections of text with some simple formatting, resulting in static html and rtf documents that can be easily navigated for manual play printed on paper or on any computer or ebook reader.
5
Advanced Tutorial. This tutorial continues the Basic Tutorial (4), only adding some more details to do more advanced formatting like adding images to books or how to make links that display text instead of numbers.
6
Dynamic Tutorial.
7
Customization Tutorial.
8
Reference.

13
expected/doc.vcheck Normal file
View file

@ -0,0 +1,13 @@
examples/doc.json: Could not reach section 'custtut' from start.
examples/doc.json: Could not reach section 'basictut' from start.
examples/doc.json: Could not reach section 'dyntut' from start.
examples/doc.json: Could not reach section 'install' from start.
examples/doc.json: Could not reach section 'tutorials' from start.
examples/doc.json: Could not reach section 'advancedtut' from start.
examples/doc.json: Could not reach section 'reference' from start.
examples/doc.json: ending (death?) section found: custtut
examples/doc.json: ending (death?) section found: basictut
examples/doc.json: ending (death?) section found: start
examples/doc.json: ending (death?) section found: dyntut
examples/doc.json: ending (death?) section found: install
examples/doc.json: ending (death?) section found: reference

1
expected/format.map Normal file
View file

@ -0,0 +1 @@
{"named2": 5, "named1": 6, "good": 3, "dum": 7, "start": 1, "bad": 2, "formatspecific": 4}

1
expected/items.map Normal file
View file

@ -0,0 +1 @@
{"drop_stick": 8, "curse": 9, "door": 11, "start": 1, "autotest": 2, "inside": 5, "treasure": 6, "cut_rope": 4, "tjunction": 12, "won": 3, "portal": 7, "attempt_break_door_with_sword": 10}

1
expected/itemslist.map Normal file
View file

@ -0,0 +1 @@
{"drop_stick": 8, "curse": 9, "door": 11, "start": 1, "autotest": 2, "inside": 5, "treasure": 6, "cut_rope": 4, "tjunction": 12, "won": 3, "portal": 7, "attempt_break_door_with_sword": 10}

View file

@ -0,0 +1 @@
{"tjunction": 3, "end_todo": 1, "curse": 2, "start": 1}

1
expected/references.map Normal file
View file

@ -0,0 +1 @@
{"Dummy": 396, "end": 397, "random": 399, "altend": 398, "next": 400, "start": 1}

1
expected/trade.map Normal file
View file

@ -0,0 +1 @@
{"start": 1, "other": 4, "theend": 2, "someotherplace": 3}

1
expected/unreachable.map Normal file
View file

@ -0,0 +1 @@
{"notevenincluded": 4, "nothere": 5, "here": 6, "start": 1, "nothereeither": 3, "secondfake": 2}

1
expected/withdemo.map Normal file
View file

@ -0,0 +1 @@
{"demo2": 4, "start": 1, "demo1": 5, "theend": 3, "demoinfo": 2}

1
expected/withmaps.map Normal file
View file

@ -0,0 +1 @@
{"Dummy": 98, "end": 99, "start": 10}

1
expected/withmaps1.map Normal file
View file

@ -0,0 +1 @@
{"start" : 10}

1
expected/withmaps2.map Normal file
View file

@ -0,0 +1 @@
{"end" : 99}

1
expected/withoutdemo.map Normal file
View file

@ -0,0 +1 @@
{"notindemo2": 6, "altend": 2, "demo2": 5, "start": 1, "demo1": 7, "theend": 4, "demoinfo": 3, "notindemo1": 8}

1
templates/html/b.html Normal file
View file

@ -0,0 +1 @@
<b>%(inner)s</b>

1
templates/json/b.json Normal file
View file

@ -0,0 +1 @@
, "%(inner)s"