- -h, --help print this help
- -o,output=NAME write tely doc to NAME
- -t,title=TITLE set tely tely doc title TITLE
-""")
- sys.exit (0)
-
-(options, files) = getopt.getopt(sys.argv[1:], 'hn:t:', [
- 'help', 'name=', 'title='])
-
-name="ly-doc"
-title="Ly Doc"
-for opt in options:
- o = opt[0]
- a = opt[1]
- if o == '-h' or o == '--help':
- help ()
- elif o == '-n' or o == '--name':
- name = a
- elif o == '-t' or o == '--title':
- title = a
- else:
- raise 'unknown opt ', o
-
-def strip_extension (f, ext):
- (p, e) = os.path.splitext (f)
- if e == ext:
- e = ''
- return p + e
-
-if files:
- dir = os.path.dirname (name)
- if not dir:
- dir = "."
- name = strip_extension (os.path.basename (name), ".tely")
-
- s = '''\input texinfo
-@setfilename %s.info
-@settitle %s
+ -h, --help print this help
+ -f, --fragment-options=OPTIONS use OPTIONS as lilypond-book fragment
+ options
+ -o, --output=NAME write tely doc to NAME
+ -t, --title=TITLE set tely doc title TITLE
+ --template=TEMPLATE use TEMPLATE as Texinfo template file,
+ instead of standard template; TEMPLATE should contain a command
+ '%(include_snippets)s' to tell where to insert LY-FILEs. When this
+ option is used, NAME and TITLE are ignored.
+""" % vars ())
+ sys.exit (0)
+
+(options, files) = getopt.getopt (sys.argv[1:], 'f:hn:t:',
+ ['fragment-options=', 'help', 'name=', 'title=', 'template='])
+
+name = "ly-doc"
+title = "Ly Doc"
+template = '''\input texinfo
+@setfilename %%(name)s.info
+@settitle %%(name)s
+
+@documentencoding utf-8
+@iftex
+@afourpaper
+@end iftex
+
+@finalout @c we do not want black boxes.