removing boilerplate; go from asciidoc to docbook45

This commit is contained in:
Martin A. Brown 2016-03-08 09:16:33 -08:00
parent 62c9cef32f
commit ffe327ced0
1 changed files with 13 additions and 40 deletions

View File

@ -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