Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Commit 168d38f

Browse files
Quick support for inclusion of vector-rendered graphviz through docbook toolchain.
Based on "the (not very tested) example" provided by Lex Trotman on https://groups.google.com/forum/#!topic/asciidoc/IddY7N7aIl4 Works for me on Ubuntu 16.04. Save the text below to test: == Exemple of vector graphviz in PDF Assuming this is saved as `asciidoc_graphviz_svg_docbook_pdf.asciidoc.txt`, render with: a2x -f pdf asciidoc_graphviz_svg_docbook_pdf.asciidoc.txt ["graphviz", "helloworld.svg", format="svg"] --------------------------------------------------------------------- digraph helloworld { hello->world; } ---------------------------------------------------------------------
1 parent 582bfaa commit 168d38f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

filters/graphviz/graphviz-filter.conf

+16
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ ifdef::basebackend-xhtml11[]
3838
<div class="title">{caption={figure-caption} {counter:figure-number}. }{title}</div>
3939
</div>
4040
endif::basebackend-xhtml11[]
41+
ifdef::basebackend-docbook[]
42+
[graphviz-svg-block]
43+
<figure{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}{pgwide-option? pgwide="1"}><title>{title}</title>
44+
{title%}<informalfigure{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>{pgwide-option?<?dbfo pgwide="1"?>}
45+
# DocBook XSL Stylesheets custom processing instructions.
46+
<?dbfo keep-together="{breakable-option#auto}"?>
47+
<?dbfo keep-together="{unbreakable-option#always}"?>
48+
<mediaobject>
49+
<imageobject>
50+
<imagedata format="SVG" fileref="{svgsdir=}{svgsdir?/}{target}"{width? contentwidth="{width}"}{height? contentdepth="{height}"}{scale? scale="{scale}"}{scaledwidth? width="{scaledwidth}" scalefit="1"}{align? align="{align}"}/>
51+
</imageobject>
52+
<textobject><phrase>{alt={target}}</phrase></textobject>
53+
</mediaobject>
54+
{title%}</informalfigure>
55+
{title#}</figure>
56+
endif::basebackend-docbook[]
4157

4258
#
4359
# DEPRECATED: Pre 8.2.7 filter definition.

0 commit comments

Comments
 (0)