From ffe327ced049501f7fdeee51708a26567209ba10 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Tue, 8 Mar 2016 09:16:33 -0800 Subject: [PATCH] removing boilerplate; go from asciidoc to docbook45 --- tldp/doctypes/asciidoc.py | 53 ++++++++++----------------------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/tldp/doctypes/asciidoc.py b/tldp/doctypes/asciidoc.py index 9f17175..26148c7 100644 --- a/tldp/doctypes/asciidoc.py +++ b/tldp/doctypes/asciidoc.py @@ -17,57 +17,30 @@ class Asciidoc(BaseDoctype): extensions = ['.txt'] signatures = [] - required = {'asciidoc_sgml2html': isexecutable, - 'asciidoc_html2text': isexecutable, - 'asciidoc_htmldoc': isexecutable, - 'asciidoc_a2x': isexecutable, + required = {'asciidoc_a2x': isexecutable, } - def make_name_pdf(self): - s = '''"{config.asciidoc_a2x}" \\ - --verbose \\ - --format pdf \\ - --destination-dir . \\ + def make_docbook45(self): + s = '''"{config.asciidoc_asciidoc}" \\ + --backend docbook45 \\ + --out-file {output.validsource} \\ "{source.filename}"''' return self.shellscript(s) - def make_name_txt(self): - s = 'cp --verbose --target-directory . -- "{source.filename}"' - return self.shellscript(s) + @depends(make_docbook45) + def docbook_subbuild(self): + config = self.config + source = self.output.validsource + return True - def make_name_htmls(self): - s = '''"{config.asciidoc_a2x}" \\ - --verbose \\ - --format xhtml \\ - --destination-dir . \\ - "{source.filename}"''' - return self.shellscript(s) - - def make_chunked_html(self): - s = '''"{config.asciidoc_a2x}" \\ - --verbose \\ - --format chunked \\ - --destination-dir . \\ - "{source.filename}"''' - return self.shellscript(s) - - @depends(make_chunked_html) - def move_chunked_html(self): - s = 'mv --no-clobber -v -- "{output.stem}.chunked" html' - return self.shellscript(s) - - @depends(move_chunked_html) - def make_name_html(self): - s = 'ln -sv --relative -- html/index.html {output.name_indexhtml}' - return self.shellscript(s) @classmethod def argparse(cls, p): descrip = 'executables and data files for %s' % (cls.formatname,) g = p.add_argument_group(title=cls.__name__, description=descrip) - g.add_argument('--asciidoc-a2x', type=arg_isexecutable, - default=which('a2x'), - help='full path to a2x [%(default)s]') + g.add_argument('--asciidoc-asciidoc', type=arg_isexecutable, + default=which('asciidoc'), + help='full path to asciidoc [%(default)s]') # # -- end of file