python-tldp/tldp/doctypes/docbook5xml.py

53 lines
1.8 KiB
Python
Raw Normal View History

2016-02-11 03:22:23 +00:00
#! /usr/bin/python
2016-02-18 21:25:02 +00:00
# -*- coding: utf8 -*-
2016-02-11 03:22:23 +00:00
from __future__ import absolute_import, division, print_function
2016-02-11 03:22:23 +00:00
import logging
2016-02-11 03:22:23 +00:00
from tldp.utils import which
from tldp.doctypes.common import BaseDoctype, SignatureChecker
2016-02-26 19:56:28 +00:00
logger = logging.getLogger(__name__)
class Docbook5XML(BaseDoctype, SignatureChecker):
2016-02-17 21:49:33 +00:00
formatname = 'DocBook XML 5.x'
2016-02-11 03:22:23 +00:00
extensions = ['.xml']
signatures = ['-//OASIS//DTD DocBook V5.0/EN',
'http://docbook.org/ns/docbook', ]
2016-02-12 20:43:45 +00:00
tools = ['xsltproc', 'html2text', 'fop', 'dblatex']
def create_txt(self):
logger.info("Creating txt for %s", self.source.stem)
def create_pdf(self):
logger.info("Creating PDF for %s", self.source.stem)
def create_html(self):
logger.info("Creating chunked HTML for %s", self.source.stem)
def create_htmls(self):
logger.info("Creating single page HTML for %s", self.source.stem)
2016-02-11 03:22:23 +00:00
@classmethod
def argparse(cls, p):
descrip = 'executables for %s' % (cls.formatname,)
g = p.add_argument_group(title=cls.__name__, description=descrip)
g.add_argument('--docbook5xml-xsltproc', type=which,
default=which('xsltproc'),
help='full path to xsltproc [%(default)s]')
g.add_argument('--docbook5xml-html2text', type=which,
default=which('html2text'),
help='full path to html2text [%(default)s]')
g.add_argument('--docbook5xml-fop', type=which,
default=which('fop'),
help='full path to fop [%(default)s]')
g.add_argument('--docbook5xml-dblatex', type=which,
default=which('dblatex'),
help='full path to dblatex [%(default)s]')
2016-02-11 03:22:23 +00:00
#
# -- end of file