diff --git a/tldp/doctypes/docbook4xml.py b/tldp/doctypes/docbook4xml.py index db29575..3c12021 100644 --- a/tldp/doctypes/docbook4xml.py +++ b/tldp/doctypes/docbook4xml.py @@ -60,6 +60,20 @@ class Docbook4XML(BaseDoctype, SignatureChecker): return True @depends(graph, chdir_output) + def copy_static_resources(self): + source = list() + for d in ('images', 'resources'): + fullpath = os.path.join(self.source.dirname, d) + fullpath = os.path.abspath(fullpath) + if os.path.isdir(fullpath): + source.append('"' + fullpath + '"') + if not source: + logger.debug("%s no images or resources to copy", self.source.stem) + return True + s = 'rsync --archive --verbose %s ./' % (' '.join(source)) + return self.shellscript(s) + + @depends(graph, copy_static_resources) def make_name_htmls(self): '''create a single page HTML output''' s = '''"{config.docbook4xml_xsltproc}" > "{output.name_htmls}" \\ diff --git a/tldp/doctypes/docbooksgml.py b/tldp/doctypes/docbooksgml.py index f8d0671..6c6a98b 100644 --- a/tldp/doctypes/docbooksgml.py +++ b/tldp/doctypes/docbooksgml.py @@ -57,6 +57,20 @@ class DocbookSGML(BaseDoctype, SignatureChecker): return True @depends(graph, chdir_output) + def copy_static_resources(self): + source = list() + for d in ('images', 'resources'): + fullpath = os.path.join(self.source.dirname, d) + fullpath = os.path.abspath(fullpath) + if os.path.isdir(fullpath): + source.append('"' + fullpath + '"') + if not source: + logger.debug("%s no images or resources to copy", self.source.stem) + return True + s = 'rsync --archive --verbose %s ./' % (' '.join(source)) + return self.shellscript(s) + + @depends(graph, copy_static_resources) def make_blank_indexsgml(self): indexsgml = os.path.join(self.source.dirname, 'index.sgml') self.indexsgml = os.path.isfile(indexsgml) diff --git a/tldp/doctypes/linuxdoc.py b/tldp/doctypes/linuxdoc.py index ec96112..f79f1da 100644 --- a/tldp/doctypes/linuxdoc.py +++ b/tldp/doctypes/linuxdoc.py @@ -33,6 +33,20 @@ class Linuxdoc(BaseDoctype, SignatureChecker): return True @depends(graph, chdir_output) + def copy_static_resources(self): + source = list() + for d in ('images', 'resources'): + fullpath = os.path.join(self.source.dirname, d) + fullpath = os.path.abspath(fullpath) + if os.path.isdir(fullpath): + source.append('"' + fullpath + '"') + if not source: + logger.debug("%s no images or resources to copy", self.source.stem) + return True + s = 'rsync --archive --verbose %s ./' % (' '.join(source)) + return self.shellscript(s) + + @depends(graph, copy_static_resources) def make_htmls(self): '''create a single page HTML output (with incorrect name)''' s = '"{config.linuxdoc_sgml2html}" --split=0 "{source.filename}"' @@ -57,8 +71,8 @@ class Linuxdoc(BaseDoctype, SignatureChecker): def make_name_pdf(self): s = '''"{config.linuxdoc_htmldoc}" \\ --size universal \\ - -t pdf \\ --firstpage p1 \\ + --format pdf \\ --outfile "{output.name_pdf}" \\ "{output.name_htmls}"''' return self.shellscript(s)