5621: add quick samples of odt and man files generation via docutils

svn: r20763
This commit is contained in:
Jérôme Rapinat 2012-12-03 18:19:39 +00:00
parent 81172d0c95
commit bb7470e604

View File

@ -87,8 +87,16 @@ def main():
help="test if 'python' and 'sphinx' are properly installed")
parser.add_argument("-b", "--build",
action="store_true", dest="build", default=True,
help="build documentation")
action="store_true", dest="build", default=False,
help="build man documentation (via sphinx-build)")
parser.add_argument("-m", "--man",
action="store_true", dest="man", default=False,
help="build man documentation (via docutils)")
parser.add_argument("-o", "--odt",
action="store_true", dest="odt", default=False,
help="build odt documentation (via docutils)")
args = parser.parse_args()
@ -98,6 +106,12 @@ def main():
if args.build:
build()
if args.man:
man()
if args.odt:
odt()
def build():
"""
Build documentation.
@ -125,6 +139,28 @@ def build():
# for update/migration
os.system('''%(program)s -b gettext -D language="%(lang)s" master_doc="%(lang)s" . _build/gettext/%(lang)s'''
% {'lang': lang, 'program': sphinxCmd})
def man():
"""
man file generation via docutils (python)
"""
os.system('''rst2man en.rst gramps.1''')
for lang in LANGUAGES:
os.system('''rst2man %(lang)s/%(lang)s.rst -l %(lang)s %(lang)s/gramps.1'''
% {'lang': lang})
def odt():
"""
odt file generation via docutils (python)
"""
os.system('''rst2odt en.rst gramps.odt''')
for lang in LANGUAGES:
os.system('''rst2odt %(lang)s/%(lang)s.rst -l %(lang)s %(lang)s/gramps.odt'''
% {'lang': lang})
if __name__ == "__main__":
main()