option handling in book2pdf, ilustrations, <latex> verbatim tag
[librarian.git] / scripts / book2pdf
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
5 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 #
7 from librarian.book2anything import Book2Anything, Option
8 import os.path
9 from optparse import OptionParser
10
11
12 class Book2Pdf(Book2Anything):
13     format_name = "PDF"
14     ext = "pdf"
15     uses_cover = True
16     uses_provider = True
17     transform_options = [
18         Option('-t', '--save-tex', dest='save_tex', metavar='FILE',
19                 help='path to save the intermediary LaTeX file to'),
20         Option('-x', '--save-texml', dest='save_texml', metavar='FILE',
21                 help='path to save the intermediary TeXML file to'),
22         Option('-m', '--morefloats', dest='morefloats', metavar='old/new/none',
23                 help='force morefloats in old (<1.0c), new (>=1.0c) or none'),
24         Option('-R', '--resources', dest='resources', metavar='DIR',
25                 help='a directory with additional resources'),
26         Option('-D', '--documentclass', dest='documentclass', 
27                help='LaTeX document class, defaults to "wl"')
28     ]
29
30
31 if __name__ == '__main__':
32     Book2Pdf.run()