mirror of https://github.com/tLDP/python-tldp
handle the images and resources during publication
This commit is contained in:
parent
2509fcfe16
commit
1c4f283482
|
@ -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}" \\
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue