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
|
|
|
|
2016-02-25 19:37:14 +00:00
|
|
|
from __future__ import absolute_import, division, print_function
|
2016-02-11 03:22:23 +00:00
|
|
|
|
2016-02-25 19:37:14 +00:00
|
|
|
import logging
|
2016-02-11 03:22:23 +00:00
|
|
|
|
2016-02-25 19:37:14 +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__)
|
|
|
|
|
2016-02-25 19:37:14 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2016-02-25 18:35:46 +00:00
|
|
|
@staticmethod
|
|
|
|
def argparse(p):
|
|
|
|
p.add_argument('--docbook5xml-xsltproc', type=which,
|
|
|
|
default=which('xsltproc'),
|
|
|
|
help='full path to xsltproc [%(default)s]')
|
|
|
|
p.add_argument('--docbook5xml-html2text', type=which,
|
|
|
|
default=which('html2text'),
|
|
|
|
help='full path to html2text [%(default)s]')
|
|
|
|
p.add_argument('--docbook5xml-fop', type=which,
|
|
|
|
default=which('fop'),
|
|
|
|
help='full path to fop [%(default)s]')
|
|
|
|
p.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
|