% % %% % % txt2CYOA : a "choose your own adventure" easily made with txt2tags % % % look at the README.txt included with this archive % % by Eric Forgeot (c) 2007-2009 % % Licensed under a CC-By-SA licence % http://creativecommons.org/licenses/by-sa/3.0/ % TXT2CYOA CODE STARTS HERE % % TEX %!target: tex %!options(tex): --outfile txt2cyoa.tex % HTML %!-REMOVE-target: xhtml %!options(xhtml): --outfile txt2cyoa.html %!--style(xhtml): ../includes/cyoa_style.css %!style(xhtml): ../includes/cyoa_style_handheld.css % TXT %!-REMOVE-target: txt %!options(txt): --outfile txt2cyoa_graph.txt % %%% GBL % voir http://redohome.hd.free.fr/gameBooks % %!preproc: '@titre ([^ ].*?)$' ' ' %!preproc: '@auteur ([^ ].*?)$' ' ' %!preproc: '@licence ([^ ].*?)$' ' ' % remplace les titres des paragraphes %!--NOTWORKING--preproc: '^#(\d+)# ([^ ].*?)$' '#\1#\n\n###\2###' %!--NOTWORKING--preproc: '#(\d+)#' '== \1 ==' %!--NOTWORKING--preproc: '###([^ ].*?)###' '=== \1 ===' %!--NOTWORKING--preproc: '^#(\d+)# ([^ ].*?)$' '== \1 ==' % les choix de texte %!preproc: '^>([^ ].*?)=(\d+)' '- \1 rdv au \2' %!preproc: '\ê\;' ê %!preproc: '\à\;' à %!preproc: '\é\;' é %!preproc: '\è\;' è %!preproc: '\ù\;' ù %!preproc: '\ä\;' ä %!preproc: '\ë\;' ë %!preproc: '\ï\;' ï %!preproc: '\ü\;' ü % %%% fin de GBL % PREPROC options %!preproc: '^==(\d+)==$' 'WARNING : \1 is not named !!!!' % add anchor to headings %!-NOT-USED-preproc: '^==(\d+)==' '==\1==[\1]' % desactive pour un autre usage (nommage des paragraphes) % Si vous voulez utiliser des liens nommés, il faut pas d'espace!! % add anchor to headings with space %!preproc: '^== (\d+) ==' '==\1==[\1]' % bold links %!preproc: '\[(\d+) #(\d+)\]' '**[\1 #\1]**' % number at end of the line = link % bold for named links and normal links too %!--NOT-WORKING--preproc: '(\d+) #([^ ].*?)$' '**[\1 #\2]**' %!preproc: '(\d+)$' '**[\1 #\1]**' % for graphviz %!preproc(txt): '^==(\d+)==' '<=\1=>' %!preproc(txt): '^== (\d+) ==' '<=\1=>' %!postproc(txt): '(\d+) \(#(\d+)\)' '\1;' %!--postproc(txt): '(\w)' '' %!postproc(txt): "c'" "c" %!postproc(txt): "d'" "d" %!postproc(txt): "j'" "j" %!postproc(txt): "l'" "l" %!postproc(txt): "m'" "m" %!postproc(txt): "n'" "n" %!postproc(txt): "s'" "s" %!postproc(txt): "t'" "t" %!postproc(txt): "u'" "u" %!--DOESNT-WORK--postproc(txt): '(\d+)' '@@@\1@@@' %!postproc(txt): 'au (\d+)' '@@@\1@@@' %pour eviter les chiffres au milieu des lignes, avant le rdv : %!postproc(txt): '(\d+),' '' %chiffre seul : %!postproc(txt): ' (\d+) ' '' %!postproc(txt): '([a-z A-Z])' '' %!postproc(txt): '([é è ê à ç ù û î ï])' '' %!postproc(txt): '([" ´ \( \) , . ! ? \-:])' '' %!postproc(txt): '(=\[\]=)' '' %!postproc(txt): '(\+\(\))' '' %!postproc(txt): '(====)' '' %!postproc(txt): '(\/\/)' '' %!postproc(txt): '(\d+\(\d+\))' '' %!postproc(txt): '(\(\d+\))' '' %!postproc(txt): '(\(\))' '' %!postproc(txt): '\[\#\]' '' %!postproc(txt): '\[\d+\]' '' %!postproc(txt): '^' '' %!postproc(txt): '^<=(\d+)=>' '\1->' %!postproc(txt): '@@@(\d+)@@@' ' \1' % POSTPROC options %!postproc(tex): 'wrap=\\includegraphics{([^ ].*?)}=wrap' '\\begin{wrapfigure}{l}{0\\textwidth} \\vspace{-00mm} \\includegraphics[height=4cm]{\1} \\vspace{-00mm} \\end{wrapfigure} ' % center section + bold %!postproc(tex): '\\subsection\*{([^ ].*?)}' '\\textbf{\\begin{center}\\subsection*{\Huge{\1}}\\end{center}}' % BIG FONTS %!postproc(tex): '\\begin{document}' '\\begin{document}\n\\begin{LARGE}' %!postproc(tex): '\\end{document}' '\\end{LARGE}\n\\end{document}' %!postproc(xhtml): 'wrap==wrap' '' % makes all images wrapping (looks nicer). Comment this if you prefer regular images placement or if you need a cover centered for your game %!--postproc(xhtml): '' '' % %%%%%%%%%%%%%%%%%%%%% % div id for javascript inside html % %!--postproc(xhtml): '

([^ ].*?)

([^ ].*?)

\1

\2
([^ ].*?)' '\n\n$