-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sonntag, 1. Februar 2009 19:50:45 John Mandereau wrote: > Reinhold Kainhofer a écrit : > > However, the other part of our splitting algorithm is implemented in the > > extract_texi_filenames.py script (which generates the file names for the > > output html files), we might find a solution by tweaking that script, so > > it places all subsections into the same html file... > > Let's got for hacking extract_texi_filenames.py; unless you prefer to do > it, I plan to do it before Wednesday.
I took a quick look, and currently it is very much tied to our splitting algorithm (i.e. on each node, but place unnumbered sections and the like together with the previous section). I'm attaching a patch to add a --split=MODE (or -s MODE) command-line option to the script as a starting point, but I haven't implemented its effect yet (in extract_sections and process_sections). I don't think I'll be able to implement it in the next few days, so I'll leave that to you ;) Cheers, Reinhold - -- - ------------------------------------------------------------------ Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/ * Financial & Actuarial Math., Vienna Univ. of Technology, Austria * http://www.fam.tuwien.ac.at/, DVR: 0005886 * LilyPond, Music typesetting, http://www.lilypond.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iD8DBQFJhflRTqjEwhXvPN0RAtwIAKCGGt3F7n3H+6dpfEwN/kspy/E67QCgm/fr vDTB5UGzG+/16OaGYgcbbrU= =hN+/ -----END PGP SIGNATURE-----
diff --git a/scripts/build/extract_texi_filenames.py b/scripts/build/extract_texi_filenames.py index 5798d5d..f367b79 100644 --- a/scripts/build/extract_texi_filenames.py +++ b/scripts/build/extract_texi_filenames.py @@ -26,13 +26,40 @@ import re import os import getopt -optlist, args = getopt.getopt (sys.argv[1:],'o:') -files = args +optlist, args = getopt.getopt (sys.argv[1:],'o:s:h', + ['output=', 'split=', 'help') + +help_text = r"""Usage: %(program_name)s [OPTIONS]... TEXIFILE... +Extract files names for texinfo (sub)sections from the texinfo files. + +Options: + -h, --help print this help + -o, --output=DIRECTORY write .xref-map files to DIRECTORY + -s, --split=MODE split manual according to MODE. Possible values + are section and custom (default) +""" + +def help (text): + sys.stdout.write ( text) + sys.exit (0) outdir = '.' -for x in optlist: - if x[0] == '-o': - outdir = x[1] +split = "custom" +for opt in options: + o = opt[0] + a = opt[1] + if o == '-h' or o == '--help': + # We can't use vars () inside a function, as that only contains all + # local variables and none of the global variables! Thus we have to + # generate the help text here and pass it to the function... + help (help_text % vars ()) + elif o == '-o' or o == '--output': + outdir = a + elif o == '-s' or o == '--split': + split = a + else: + raise Exception ('unknown option: ' + o) + if not os.path.isdir (outdir): if os.path.exists (outdir):
_______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel