2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-21 17:35:55 +01:00

All pictures in PDF/SVG

This commit is contained in:
Thomas Nagy 2016-07-02 13:10:13 +02:00
parent 4e3c5044e5
commit 0b2ae5fabd
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
3 changed files with 14 additions and 11 deletions

View File

@ -1,7 +1,5 @@
== Using the development version
A few notes on the waf development follow.
=== Execution traces
==== Logging

View File

@ -4,7 +4,7 @@ The Waf Book
:quotes.++:
:numbered!:
{set:PIC:{backend@docbook:.eps:.png}}
{set:PIC:{backend@docbook:.pdf:.svg}}
[preface]
== Introduction

View File

@ -31,9 +31,9 @@ def ascii_doc_scan(self):
name = m.group(2)
if m.group(3) == '{PIC}':
ext = '.eps'
ext = '.svg'
if self.generator.rule.rfind('A2X') > 0:
ext = '.png'
ext = '.pdf'
k = p.find_resource(name.replace('{PIC}', ext))
if k:
@ -89,6 +89,8 @@ def configure(conf):
conf.find_program('source-highlight', var='SOURCE_HIGHLIGHT')
conf.find_program('dot')
conf.find_program('dblatex')
conf.find_program('epstopdf')
conf.find_program('pdf2svg')
try:
conf.find_program('semantik-d')
except conf.errors.ConfigurationError:
@ -99,18 +101,22 @@ def build(bld):
#bld(features='subst', is_copy=True, source='asciidoc-dblatex.sty asciidoc-dblatex.xsl', target='asciidoc-dblatex.sty asciidoc-dblatex.xsl')
for x in bld.path.ant_glob('*.eps'):
bld(features='subst', source=x.name, target=x.name, is_copy=True)
bld(rule='${CONVERT} ${bld.raw_deps[tsk.uid()]} -density 600 ${SRC} ${TGT}', source=x, target=x.change_ext('.png'), scan=scansize)
#bld(features='subst', source=x.name, target=x.name, is_copy=True)
#bld(rule='${CONVERT} ${bld.raw_deps[tsk.uid()]} -density 600 ${SRC} ${TGT}', source=x, target=x.change_ext('.png'), scan=scansize)
bld(rule='${EPSTOPDF} ${SRC} --outfile=${TGT}', source=x, target=x.change_ext('.pdf'), scan=scansize)
bld(rule='${PDF2SVG} ${SRC} ${TGT}', source=x.change_ext('.pdf'), target=x.change_ext('.svg'), scan=scansize)
for x in bld.path.ant_glob('*.dot'):
tg = bld(rule='${DOT} -Teps -o${TGT} ${SRC}', source=x, target=x.change_ext('.eps'))
tg = bld(rule='${DOT} -Tpng -o${TGT} ${SRC}', source=x, target=x.change_ext('.png'), scan=scansize)
#tg = bld(rule='${DOT} -Teps -o${TGT} ${SRC}', source=x, target=x.change_ext('.eps'))
tg = bld(rule='${DOT} -Tsvg -o${TGT} ${SRC}', source=x, target=x.change_ext('.svg'))
tg = bld(rule='${DOT} -Tpdf -o${TGT} ${SRC}', source=x, target=x.change_ext('.pdf'))
#tg = bld(rule='${DOT} -Tpng -o${TGT} ${SRC}', source=x, target=x.change_ext('.png'), scan=scansize)
#tg = bld(rule='${CONVERT} ${bld.raw_deps[tsk.uid()]} ${SRC} ${TGT}', source=x.change_ext('.eps'), target=x.change_ext('.png'), scan=scansize)
for x in bld.path.ant_glob('*.semd'):
bld(rule='${SEMANTIK_D} ${SRC[0].abspath()} -o ${TGT[0].abspath()}', source=x, target=x.change_ext('.svg'))
bld(rule='${SEMANTIK_D} ${SRC[0].abspath()} -o ${TGT[0].abspath()}', source=x, target=x.change_ext('.pdf'))
bld(rule='${SEMANTIK_D} ${SIZEPARAMS} ${SRC[0].abspath()} -o ${TGT[0].abspath()}', source=x, target=x.change_ext('.png'), features="sizer")
for x in bld.path.ant_glob('pics/*.png'):
bld(features='subst', source=x, target=x.name, is_copy=True)
@ -125,7 +131,6 @@ def build(bld):
bld(features='subst', source=x, target=x, is_copy=True)
with open('../../waflib/Context.py', 'r') as f:
version = re.compile('WAFVERSION=[\'"]([^\'"]+)', re.M).search(f.read()).group(1)
def sfun(tsk, text):