mizuho 0.9.6 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +4 -2
- data/Rakefile +0 -37
- data/asciidoc/BUGS +9 -18
- data/asciidoc/BUGS.txt +5 -14
- data/asciidoc/CHANGELOG +1433 -266
- data/asciidoc/CHANGELOG.txt +2821 -1810
- data/asciidoc/COPYING +339 -339
- data/asciidoc/COPYRIGHT +18 -18
- data/asciidoc/INSTALL +189 -30
- data/asciidoc/INSTALL.txt +175 -19
- data/asciidoc/MANIFEST +88 -0
- data/asciidoc/Makefile.in +29 -13
- data/asciidoc/README +16 -17
- data/asciidoc/README.txt +35 -36
- data/asciidoc/a2x.py +902 -0
- data/asciidoc/asciidoc.conf +610 -455
- data/asciidoc/asciidoc.py +1965 -1061
- data/asciidoc/asciidocapi.py +257 -0
- data/asciidoc/common.aap +2 -2
- data/asciidoc/configure +1170 -1023
- data/asciidoc/configure.ac +1 -1
- data/asciidoc/dblatex/asciidoc-dblatex.xsl +42 -0
- data/asciidoc/doc/a2x.1 +559 -102
- data/asciidoc/doc/a2x.1.txt +233 -91
- data/asciidoc/doc/article-docinfo.xml +87 -0
- data/asciidoc/doc/article.pdf +0 -0
- data/asciidoc/doc/article.txt +139 -122
- data/asciidoc/doc/asciidoc.1 +157 -46
- data/asciidoc/doc/asciidoc.1.txt +171 -118
- data/asciidoc/doc/asciidoc.conf +7 -8
- data/asciidoc/doc/asciidoc.dict +960 -635
- data/asciidoc/doc/asciidoc.txt +2335 -1464
- data/asciidoc/doc/asciidocapi.txt +189 -0
- data/asciidoc/doc/asciimathml.txt +14 -17
- data/asciidoc/doc/book-multi.txt +181 -155
- data/asciidoc/doc/book.epub +0 -0
- data/asciidoc/doc/book.txt +156 -131
- data/asciidoc/doc/customers.csv +18 -18
- data/asciidoc/doc/epub-notes.txt +210 -0
- data/asciidoc/doc/faq.txt +1122 -547
- data/asciidoc/doc/latex-backend.txt +192 -191
- data/asciidoc/doc/latex-bugs.txt +134 -0
- data/asciidoc/doc/latex-filter.pdf +0 -0
- data/asciidoc/doc/latex-filter.txt +196 -0
- data/asciidoc/doc/latexmath.txt +13 -136
- data/asciidoc/doc/latexmathml.txt +2 -2
- data/asciidoc/doc/main.aap +233 -297
- data/asciidoc/doc/music-filter.pdf +0 -0
- data/asciidoc/doc/music-filter.txt +55 -65
- data/asciidoc/doc/publishing-ebooks-with-asciidoc.txt +398 -0
- data/asciidoc/doc/slidy-example.txt +167 -0
- data/asciidoc/doc/slidy.txt +113 -0
- data/asciidoc/doc/source-highlight-filter.pdf +0 -0
- data/asciidoc/doc/source-highlight-filter.txt +45 -20
- data/asciidoc/doc/testasciidoc.txt +231 -0
- data/asciidoc/docbook-xsl/asciidoc-docbook-xsl.txt +30 -8
- data/asciidoc/docbook-xsl/chunked.xsl +17 -19
- data/asciidoc/docbook-xsl/common.xsl +106 -67
- data/asciidoc/docbook-xsl/epub.xsl +35 -0
- data/asciidoc/docbook-xsl/fo.xsl +3 -0
- data/asciidoc/docbook-xsl/htmlhelp.xsl +16 -17
- data/asciidoc/docbook-xsl/manpage.xsl +31 -31
- data/asciidoc/docbook-xsl/text.xsl +6 -1
- data/asciidoc/docbook-xsl/xhtml.xsl +14 -14
- data/asciidoc/docbook45.conf +759 -0
- data/asciidoc/filters/code/code-filter-readme.txt +37 -37
- data/asciidoc/filters/code/code-filter-test.txt +15 -15
- data/asciidoc/filters/code/code-filter.conf +8 -8
- data/asciidoc/filters/graphviz/asciidoc-graphviz-sample.txt +104 -64
- data/asciidoc/filters/graphviz/graphviz-filter.conf +20 -16
- data/asciidoc/filters/graphviz/graphviz2png.py +54 -39
- data/asciidoc/filters/latex/latex-filter.conf +18 -0
- data/asciidoc/filters/latex/latex2png.py +216 -0
- data/asciidoc/filters/music/music-filter.conf +8 -17
- data/asciidoc/filters/music/music2png.py +40 -32
- data/asciidoc/filters/source/source-highlight-filter.conf +40 -34
- data/asciidoc/help.conf +261 -96
- data/asciidoc/html4.conf +505 -460
- data/asciidoc/html5.conf +686 -0
- data/asciidoc/images/highlighter.png +0 -0
- data/asciidoc/images/icons/caution.png +0 -0
- data/asciidoc/images/icons/example.png +0 -0
- data/asciidoc/images/icons/important.png +0 -0
- data/asciidoc/images/icons/note.png +0 -0
- data/asciidoc/images/icons/tip.png +0 -0
- data/asciidoc/images/icons/warning.png +0 -0
- data/asciidoc/images/smallnew.png +0 -0
- data/asciidoc/javascripts/asciidoc.js +189 -0
- data/asciidoc/javascripts/slidy.js +2845 -0
- data/asciidoc/javascripts/toc.js +8 -0
- data/asciidoc/lang-de.conf +57 -0
- data/asciidoc/lang-en.conf +54 -0
- data/asciidoc/lang-es.conf +49 -9
- data/asciidoc/lang-fr.conf +59 -0
- data/asciidoc/lang-hu.conf +55 -0
- data/asciidoc/lang-it.conf +55 -0
- data/asciidoc/lang-nl.conf +57 -0
- data/asciidoc/lang-pt-BR.conf +56 -0
- data/asciidoc/lang-ru.conf +60 -0
- data/asciidoc/lang-uk.conf +60 -0
- data/asciidoc/latex.conf +700 -663
- data/asciidoc/main.aap +77 -0
- data/asciidoc/slidy.conf +136 -0
- data/asciidoc/{examples/website/xhtml11-manpage.css → stylesheets/asciidoc-manpage.css} +1 -1
- data/asciidoc/stylesheets/asciidoc.css +508 -0
- data/asciidoc/stylesheets/docbook-xsl.css +322 -272
- data/asciidoc/stylesheets/flask-manpage.css +1 -0
- data/asciidoc/stylesheets/flask.css +584 -0
- data/asciidoc/stylesheets/pygments.css +66 -0
- data/asciidoc/stylesheets/slidy.css +445 -0
- data/asciidoc/stylesheets/toc2.css +33 -0
- data/asciidoc/stylesheets/volnitsky-manpage.css +1 -0
- data/asciidoc/stylesheets/volnitsky.css +435 -0
- data/asciidoc/stylesheets/xhtml11-quirks.css +5 -3
- data/asciidoc/tests/asciidocapi.py +257 -0
- data/asciidoc/tests/data/deprecated-quotes.txt +12 -0
- data/asciidoc/tests/data/filters-test.txt +90 -0
- data/asciidoc/tests/data/lang-de-test.txt +106 -0
- data/asciidoc/tests/data/lang-en-test.txt +114 -0
- data/asciidoc/tests/data/lang-es-test.txt +106 -0
- data/asciidoc/tests/data/lang-fr-test.txt +106 -0
- data/asciidoc/tests/data/lang-hu-test.txt +106 -0
- data/asciidoc/tests/data/lang-nl-test.txt +94 -0
- data/asciidoc/tests/data/lang-pt-BR-test.txt +106 -0
- data/asciidoc/tests/data/lang-ru-test.txt +106 -0
- data/asciidoc/tests/data/lang-uk-test.txt +106 -0
- data/asciidoc/tests/data/oldtables.txt +64 -0
- data/asciidoc/tests/data/rcs-id-marker-test.txt +6 -0
- data/asciidoc/tests/data/testcases.conf +2 -0
- data/asciidoc/tests/data/testcases.txt +740 -0
- data/asciidoc/tests/data/utf8-bom-test.txt +9 -0
- data/asciidoc/tests/data/utf8-examples.txt +217 -0
- data/asciidoc/tests/testasciidoc.conf +520 -0
- data/asciidoc/tests/testasciidoc.py +411 -0
- data/asciidoc/text.conf +16 -16
- data/asciidoc/vim/syntax/asciidoc.vim +99 -91
- data/asciidoc/wordpress.conf +43 -3
- data/asciidoc/xhtml11-quirks.conf +61 -57
- data/asciidoc/xhtml11.conf +684 -645
- data/lib/mizuho.rb +2 -0
- data/lib/mizuho/generator.rb +2 -2
- data/test/generator_spec.rb +1 -1
- data/test/parser_spec.rb +1 -1
- data/test/spec_helper.rb +3 -4
- metadata +87 -88
- data/asciidoc/a2x +0 -674
- data/asciidoc/doc/article.css-embedded.html +0 -602
- data/asciidoc/doc/article.html +0 -46
- data/asciidoc/doc/asciidoc-revhistory.xml +0 -27
- data/asciidoc/doc/asciidoc.1.css-embedded.html +0 -598
- data/asciidoc/doc/asciidoc.1.css.html +0 -212
- data/asciidoc/doc/asciidoc.1.html +0 -190
- data/asciidoc/doc/asciidoc.css-embedded.html +0 -7853
- data/asciidoc/doc/asciidoc.css.html +0 -7416
- data/asciidoc/doc/asciidoc.html +0 -3339
- data/asciidoc/doc/book-multi.css-embedded.html +0 -575
- data/asciidoc/doc/book-multi.html +0 -55
- data/asciidoc/doc/book.css-embedded.html +0 -607
- data/asciidoc/doc/book.html +0 -43
- data/asciidoc/doc/docbook-xsl.css +0 -272
- data/asciidoc/doc/latex-backend.html +0 -117
- data/asciidoc/doc/music-filter.html +0 -566
- data/asciidoc/doc/source-highlight-filter.html +0 -214
- data/asciidoc/docbook.conf +0 -721
- data/asciidoc/examples/website/ASCIIMathML.js +0 -938
- data/asciidoc/examples/website/CHANGELOG.html +0 -4389
- data/asciidoc/examples/website/CHANGELOG.txt +0 -1810
- data/asciidoc/examples/website/INSTALL.html +0 -161
- data/asciidoc/examples/website/INSTALL.txt +0 -71
- data/asciidoc/examples/website/LaTeXMathML.js +0 -1223
- data/asciidoc/examples/website/README-website.html +0 -118
- data/asciidoc/examples/website/README-website.txt +0 -29
- data/asciidoc/examples/website/README.html +0 -125
- data/asciidoc/examples/website/README.txt +0 -36
- data/asciidoc/examples/website/a2x.1.html +0 -419
- data/asciidoc/examples/website/a2x.1.txt +0 -204
- data/asciidoc/examples/website/asciidoc-docbook-xsl.html +0 -130
- data/asciidoc/examples/website/asciidoc-docbook-xsl.txt +0 -43
- data/asciidoc/examples/website/asciidoc-graphviz-sample.txt +0 -130
- data/asciidoc/examples/website/asciimathml.txt +0 -64
- data/asciidoc/examples/website/build-website.sh +0 -25
- data/asciidoc/examples/website/customers.csv +0 -18
- data/asciidoc/examples/website/downloads.html +0 -257
- data/asciidoc/examples/website/downloads.txt +0 -121
- data/asciidoc/examples/website/faq.html +0 -673
- data/asciidoc/examples/website/faq.txt +0 -547
- data/asciidoc/examples/website/index.html +0 -419
- data/asciidoc/examples/website/index.txt +0 -245
- data/asciidoc/examples/website/latex-backend.html +0 -535
- data/asciidoc/examples/website/latex-backend.txt +0 -191
- data/asciidoc/examples/website/latexmathml.txt +0 -41
- data/asciidoc/examples/website/layout1.conf +0 -161
- data/asciidoc/examples/website/layout1.css +0 -65
- data/asciidoc/examples/website/layout2.conf +0 -158
- data/asciidoc/examples/website/layout2.css +0 -93
- data/asciidoc/examples/website/manpage.html +0 -266
- data/asciidoc/examples/website/manpage.txt +0 -118
- data/asciidoc/examples/website/music-filter.html +0 -242
- data/asciidoc/examples/website/music-filter.txt +0 -158
- data/asciidoc/examples/website/music1.abc +0 -12
- data/asciidoc/examples/website/music1.png +0 -0
- data/asciidoc/examples/website/music2.ly +0 -9
- data/asciidoc/examples/website/music2.png +0 -0
- data/asciidoc/examples/website/newlists.txt +0 -40
- data/asciidoc/examples/website/newtables.txt +0 -397
- data/asciidoc/examples/website/sample1.png +0 -0
- data/asciidoc/examples/website/sample3.png +0 -0
- data/asciidoc/examples/website/sample4.png +0 -0
- data/asciidoc/examples/website/source-highlight-filter.html +0 -286
- data/asciidoc/examples/website/source-highlight-filter.txt +0 -203
- data/asciidoc/examples/website/support.html +0 -78
- data/asciidoc/examples/website/support.txt +0 -5
- data/asciidoc/examples/website/toc.js +0 -69
- data/asciidoc/examples/website/userguide.html +0 -7460
- data/asciidoc/examples/website/userguide.txt +0 -4979
- data/asciidoc/examples/website/version83.txt +0 -37
- data/asciidoc/examples/website/version9.html +0 -143
- data/asciidoc/examples/website/version9.txt +0 -48
- data/asciidoc/examples/website/xhtml11-quirks.css +0 -41
- data/asciidoc/examples/website/xhtml11.css +0 -328
- data/asciidoc/stylesheets/xhtml11-manpage.css +0 -18
- data/asciidoc/stylesheets/xhtml11.css +0 -328
@@ -1,37 +1,37 @@
|
|
1
|
-
AsciiDoc Code Filter
|
2
|
-
====================
|
3
|
-
|
4
|
-
This simple minded filter highlights source code keywords and
|
5
|
-
comments.
|
6
|
-
|
7
|
-
NOTE: The filter is to demonstrate how to write a filter -- it's much
|
8
|
-
to simplistic to be passed off as a code syntax highlighter. If you
|
9
|
-
want a full featured highlighter use the 'source highlighter filter.
|
10
|
-
|
11
|
-
|
12
|
-
Files
|
13
|
-
-----
|
14
|
-
code-filter.py::
|
15
|
-
The filter Python script.
|
16
|
-
code-filter.conf::
|
17
|
-
The AsciiDoc filter configuration file.
|
18
|
-
code-filter-test.txt::
|
19
|
-
Short AsciiDoc document to test the filter.
|
20
|
-
|
21
|
-
|
22
|
-
Installation
|
23
|
-
------------
|
24
|
-
The code filter is installed in the distribution `filters` directory
|
25
|
-
as part of the standard AsciiDoc install.
|
26
|
-
|
27
|
-
Test it on the `code-filter-test.txt` file:
|
28
|
-
|
29
|
-
$ asciidoc -v code-filter-test.txt
|
30
|
-
$ firefox code-filter-test.txt &
|
31
|
-
|
32
|
-
|
33
|
-
Help
|
34
|
-
----
|
35
|
-
Execute the filter with the help option:
|
36
|
-
|
37
|
-
$ ./code-filter.py --help
|
1
|
+
AsciiDoc Code Filter
|
2
|
+
====================
|
3
|
+
|
4
|
+
This simple minded filter highlights source code keywords and
|
5
|
+
comments.
|
6
|
+
|
7
|
+
NOTE: The filter is to demonstrate how to write a filter -- it's much
|
8
|
+
to simplistic to be passed off as a code syntax highlighter. If you
|
9
|
+
want a full featured highlighter use the 'source highlighter filter.
|
10
|
+
|
11
|
+
|
12
|
+
Files
|
13
|
+
-----
|
14
|
+
code-filter.py::
|
15
|
+
The filter Python script.
|
16
|
+
code-filter.conf::
|
17
|
+
The AsciiDoc filter configuration file.
|
18
|
+
code-filter-test.txt::
|
19
|
+
Short AsciiDoc document to test the filter.
|
20
|
+
|
21
|
+
|
22
|
+
Installation
|
23
|
+
------------
|
24
|
+
The code filter is installed in the distribution `filters` directory
|
25
|
+
as part of the standard AsciiDoc install.
|
26
|
+
|
27
|
+
Test it on the `code-filter-test.txt` file:
|
28
|
+
|
29
|
+
$ asciidoc -v code-filter-test.txt
|
30
|
+
$ firefox code-filter-test.txt &
|
31
|
+
|
32
|
+
|
33
|
+
Help
|
34
|
+
----
|
35
|
+
Execute the filter with the help option:
|
36
|
+
|
37
|
+
$ ./code-filter.py --help
|
@@ -1,15 +1,15 @@
|
|
1
|
-
Code Filter Test
|
2
|
-
================
|
3
|
-
|
4
|
-
[python]
|
5
|
-
code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
6
|
-
''' A multi-line
|
7
|
-
comment.'''
|
8
|
-
def sub_word(mo):
|
9
|
-
''' Single line comment.'''
|
10
|
-
word = mo.group('word') # Inline comment
|
11
|
-
if word in keywords[language]:
|
12
|
-
return quote + word + quote
|
13
|
-
else:
|
14
|
-
return word
|
15
|
-
code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
1
|
+
Code Filter Test
|
2
|
+
================
|
3
|
+
|
4
|
+
[python]
|
5
|
+
code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
6
|
+
''' A multi-line
|
7
|
+
comment.'''
|
8
|
+
def sub_word(mo):
|
9
|
+
''' Single line comment.'''
|
10
|
+
word = mo.group('word') # Inline comment
|
11
|
+
if word in keywords[language]:
|
12
|
+
return quote + word + quote
|
13
|
+
else:
|
14
|
+
return word
|
15
|
+
code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
2
|
-
# AsciiDoc code filter configuration file.
|
3
|
-
#
|
4
|
-
# Documented in code-filter-readme.txt
|
5
|
-
#
|
6
|
-
|
7
|
-
[blockdef-listing]
|
8
|
-
code-style=template="listingblock",presubs=(),postsubs=("callouts",),posattrs=("style","language"),filter="code-filter.py -b {basebackend} -l {language}"
|
1
|
+
#
|
2
|
+
# AsciiDoc code filter configuration file.
|
3
|
+
#
|
4
|
+
# Documented in code-filter-readme.txt
|
5
|
+
#
|
6
|
+
|
7
|
+
[blockdef-listing]
|
8
|
+
code-style=template="listingblock",presubs=(),postsubs=("callouts",),posattrs=("style","language"),filter="code-filter.py -b {basebackend} -l {language}"
|
@@ -2,51 +2,64 @@
|
|
2
2
|
|
3
3
|
Author: Gouichi Iisaka
|
4
4
|
|
5
|
-
Version: 1.
|
5
|
+
Version: 1.1.3
|
6
6
|
|
7
7
|
== Introduction ==
|
8
8
|
|
9
|
-
|
9
|
+
The Graphviz(link:http://www.graphviz.org[]) is a way of representing structural information
|
10
10
|
as diagrams of abstract graphs and networks.
|
11
11
|
|
12
|
+
|
13
|
+
Automatic graph drawing has many important applications
|
14
|
+
in software engineering, database and web design, networking,
|
15
|
+
and in visual interfaces for many other domains.
|
16
|
+
|
17
|
+
Graphviz take descriptions of graphs in a simple text language,
|
18
|
+
And has many useful features for concrete diagrams,
|
19
|
+
such as options for colors, fonts, tabular node layouts,
|
20
|
+
line styles, hyperlinks, and custom shapes.
|
21
|
+
|
12
22
|
AsciiDoc can external shell commands used to process Paragraph and
|
13
23
|
DelimitedBlock content by Filter.
|
14
24
|
|
25
|
+
So now, AsciiDoc can draw graphs via graphviz filter.
|
15
26
|
|
16
|
-
==
|
27
|
+
== Examples ==
|
17
28
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
29
|
+
=== Simple ===
|
30
|
+
.....................................................................
|
31
|
+
[graphviz]
|
32
|
+
---------------------------------------------------------------------
|
33
|
+
digraph G { rankdir=LR; Graphviz->AsciiDoc->HTML}
|
34
|
+
---------------------------------------------------------------------
|
35
|
+
.....................................................................
|
24
36
|
|
25
|
-
[
|
37
|
+
[graphviz]
|
26
38
|
---------------------------------------------------------------------
|
27
39
|
digraph G { rankdir=LR; Graphviz->AsciiDoc->HTML}
|
28
40
|
---------------------------------------------------------------------
|
29
41
|
|
42
|
+
=== Using options ===
|
43
|
+
.....................................................................
|
44
|
+
["graphviz", "sample2.png"]
|
30
45
|
---------------------------------------------------------------------
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
"Machine: a" [ shape = plaintext ];
|
45
|
-
}
|
46
|
-
---------------------------------------------------------------------
|
46
|
+
digraph automata_0 {
|
47
|
+
size ="8.5, 11";
|
48
|
+
node [shape = circle];
|
49
|
+
0 [ style = filled, color=lightgrey ];
|
50
|
+
2 [ shape = doublecircle ];
|
51
|
+
0 -> 2 [ label = "a " ];
|
52
|
+
0 -> 1 [ label = "other " ];
|
53
|
+
1 -> 2 [ label = "a " ];
|
54
|
+
1 -> 1 [ label = "other " ];
|
55
|
+
2 -> 2 [ label = "a " ];
|
56
|
+
2 -> 1 [ label = "other " ];
|
57
|
+
"Machine: a" [ shape = plaintext ];
|
58
|
+
}
|
47
59
|
---------------------------------------------------------------------
|
60
|
+
.....................................................................
|
48
61
|
|
49
|
-
["graphviz", "
|
62
|
+
["graphviz", "sample2.png"]
|
50
63
|
---------------------------------------------------------------------
|
51
64
|
digraph automata_0 {
|
52
65
|
size ="8.5, 11";
|
@@ -63,35 +76,35 @@ digraph automata_0 {
|
|
63
76
|
}
|
64
77
|
---------------------------------------------------------------------
|
65
78
|
|
79
|
+
=== Using Layout ===
|
66
80
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
81
|
+
.....................................................................
|
82
|
+
["graphviz", "sample3.png", "dot"]
|
83
|
+
---------------------------------------------------------------------
|
84
|
+
digraph finite_state_machine {
|
85
|
+
rankdir=LR;
|
86
|
+
size="8,5"
|
87
|
+
node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
|
88
|
+
node [shape = circle];
|
89
|
+
LR_0 -> LR_2 [ label = "SS(B)" ];
|
90
|
+
LR_0 -> LR_1 [ label = "SS(S)" ];
|
91
|
+
LR_1 -> LR_3 [ label = "S($end)" ];
|
92
|
+
LR_2 -> LR_6 [ label = "SS(b)" ];
|
93
|
+
LR_2 -> LR_5 [ label = "SS(a)" ];
|
94
|
+
LR_2 -> LR_4 [ label = "S(A)" ];
|
95
|
+
LR_5 -> LR_7 [ label = "S(b)" ];
|
96
|
+
LR_5 -> LR_5 [ label = "S(a)" ];
|
97
|
+
LR_6 -> LR_6 [ label = "S(b)" ];
|
98
|
+
LR_6 -> LR_5 [ label = "S(a)" ];
|
99
|
+
LR_7 -> LR_8 [ label = "S(b)" ];
|
100
|
+
LR_7 -> LR_5 [ label = "S(a)" ];
|
101
|
+
LR_8 -> LR_6 [ label = "S(b)" ];
|
102
|
+
LR_8 -> LR_5 [ label = "S(a)" ];
|
103
|
+
}
|
104
|
+
---------------------------------------------------------------------
|
105
|
+
.....................................................................
|
92
106
|
|
93
|
-
.
|
94
|
-
["graphviz", "sample4.png", "dot"]
|
107
|
+
["graphviz", "sample3.png", "dot"]
|
95
108
|
---------------------------------------------------------------------
|
96
109
|
digraph finite_state_machine {
|
97
110
|
rankdir=LR;
|
@@ -118,13 +131,40 @@ digraph finite_state_machine {
|
|
118
131
|
|
119
132
|
== Layout ==
|
120
133
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
134
|
+
Layout for graphviz as follows. The default is `dot'.
|
135
|
+
|
136
|
+
*dot;;
|
137
|
+
'dot' draws directed graphs.
|
138
|
+
It works well on DAGs and other graphs that can be drawn as hierarchies.
|
139
|
+
It reads attributed graph files and writes drawings.
|
140
|
+
|
141
|
+
*neato;;
|
142
|
+
'neato' draws undirected graphs using ‘‘spring'' models (see Kamada and
|
143
|
+
Kawai, Information Processing Letters 31:1, April 1989).
|
144
|
+
Input files must be formatted in the dot attributed graph language.
|
145
|
+
|
146
|
+
*twopi;;
|
147
|
+
'twopi' draws graphs using a radial layout (see G. Wills, Symposium on
|
148
|
+
Graph Drawing GD'97, September, 1997).
|
149
|
+
Basically, one node is chosen as the center and put at the origin.
|
150
|
+
The remaining nodes are placed on a sequence of concentric circles
|
151
|
+
centered about the origin, each a fixed radial distance from
|
152
|
+
the previous circle.
|
153
|
+
|
154
|
+
*circro;;
|
155
|
+
'circo' draws graphs using a circular layout (see Six and Tollis, GD '99
|
156
|
+
and ALENEX '99, and Kaufmann and Wiese, GD '02.)
|
157
|
+
The tool identifies biconnected components and draws the nodes
|
158
|
+
of the component on a circle.
|
159
|
+
The block‐cutpoint tree is then laid out using a recursive radial
|
160
|
+
algorithm.
|
161
|
+
Edge crossings within a circle are minimized by placing as
|
162
|
+
many edges on the circle's perimeter as possible.
|
163
|
+
In particular, if the component is outerplanar,
|
164
|
+
the component will have a planar layout.
|
165
|
+
|
166
|
+
*fdp;;
|
167
|
+
'fdp' draws undirected graphs using a ‘‘spring'' model.
|
168
|
+
It relies on a force‐directed approach in the spirit of Fruchterman
|
169
|
+
and Reingold
|
170
|
+
(cf. Software‐Practice & Experience 21(11), 1991, pp. 1129‐1164).
|
@@ -4,26 +4,30 @@
|
|
4
4
|
# Version: 1.0
|
5
5
|
# Gouici Iisaka <iisaka51 at gmail dot com>
|
6
6
|
|
7
|
+
[graphviz-filter-style]
|
8
|
+
graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -L {layout=dot} -F {format=png} -'
|
9
|
+
|
7
10
|
[blockdef-listing]
|
8
|
-
|
11
|
+
template::[graphviz-filter-style]
|
9
12
|
|
10
|
-
|
11
|
-
[graphviz-
|
12
|
-
<div class="graphvizblock">
|
13
|
-
<a id="{id}"></a>
|
14
|
-
<div class="title">{title}</div>
|
15
|
-
<div class="content">
|
16
|
-
<a href="{link}">
|
17
|
-
<img style="border-width: 0;" src="{target}" alt="{target}"{width? width="{width}"}{height? height="{height}"} />
|
18
|
-
{link#}</a>
|
19
|
-
</div></div>
|
20
|
-
endif::basebackend-html[]
|
13
|
+
[paradef-default]
|
14
|
+
template::[graphviz-filter-style]
|
21
15
|
|
22
|
-
ifdef::basebackend-docbook[]
|
23
16
|
[graphviz-block]
|
24
|
-
template::[image-blockmacro]
|
25
|
-
endif::basebackend-docbook[]
|
17
|
+
template::[filter-image-blockmacro]
|
26
18
|
|
19
|
+
# EXPERIMENTAL: xhtml11 backend SVG image block.
|
20
|
+
ifdef::basebackend-xhtml11[]
|
21
|
+
[graphviz-svg-block]
|
22
|
+
<div class="imageblock"{id? id="{id}"}{align? style="text-align:{align};"}{float? style="float:{float};"}>
|
23
|
+
<div class="content">
|
24
|
+
<a class="image" href="{link}">
|
25
|
+
<object data="{imagesdir=}{imagesdir?/}{target}" type="image/svg+xml" />
|
26
|
+
{link#}</a>
|
27
|
+
</div>
|
28
|
+
<div class="title">{caption={figure-caption} {counter:figure-number}. }{title}</div>
|
29
|
+
</div>
|
30
|
+
endif::basebackend-xhtml11[]
|
27
31
|
|
28
32
|
#
|
29
33
|
# DEPRECATED: Pre 8.2.7 filter definition.
|
@@ -32,7 +36,7 @@ endif::basebackend-docbook[]
|
|
32
36
|
delimiter=^graphviz~{4,}$
|
33
37
|
template=graphviz-block
|
34
38
|
presubs=none
|
35
|
-
filter=graphviz2png.py {verbose?-v} -o "{outdir}/{target} -L {layout=dot}
|
39
|
+
filter=graphviz2png.py {verbose?-v} -o "{outdir={indir}}/{target}" -L {layout=dot} -
|
36
40
|
posattrs=target,format
|
37
41
|
#
|
38
42
|
# DEPRECATED: End
|
@@ -1,18 +1,15 @@
|
|
1
1
|
#!/usr/bin/env python
|
2
|
-
|
2
|
+
|
3
|
+
import os, sys, subprocess
|
3
4
|
from optparse import *
|
4
5
|
|
5
6
|
__AUTHOR__ = "Gouichi Iisaka <iisaka51@gmail.com>"
|
6
|
-
__VERSION__ = '1.1'
|
7
|
+
__VERSION__ = '1.1.4'
|
7
8
|
|
8
9
|
class EApp(Exception):
|
9
10
|
'''Application specific exception.'''
|
10
11
|
pass
|
11
12
|
|
12
|
-
class Struct:
|
13
|
-
'''variable contenor as C `struct'.'''
|
14
|
-
pass
|
15
|
-
|
16
13
|
class Application():
|
17
14
|
'''
|
18
15
|
NAME
|
@@ -27,17 +24,26 @@ DESCRIPTION
|
|
27
24
|
|
28
25
|
|
29
26
|
OPTIONS
|
30
|
-
-o OUTFILE
|
27
|
+
-o OUTFILE, --outfile=OUTFILE
|
31
28
|
The file name of the output file. If not specified the output file is
|
32
29
|
named like INFILE but with a .png file name extension.
|
33
30
|
|
34
|
-
-
|
31
|
+
-L LAYOUT, --layout=LAYOUT
|
32
|
+
Graphviz layout: dot, neato, twopi, circo, fdp
|
33
|
+
Default is 'dot'.
|
34
|
+
|
35
|
+
-F FORMAT, --format=FORMAT
|
36
|
+
Graphviz output format: png, svg, or any other format Graphviz
|
37
|
+
supports. Run dot -T? to get the full list.
|
38
|
+
Default is 'png'.
|
39
|
+
|
40
|
+
-v, --verbose
|
35
41
|
Verbosely print processing information to stderr.
|
36
42
|
|
37
|
-
--help
|
43
|
+
-h, --help
|
38
44
|
Print this documentation.
|
39
45
|
|
40
|
-
--version
|
46
|
+
-V, --version
|
41
47
|
Print program version number.
|
42
48
|
|
43
49
|
SEE ALSO
|
@@ -45,52 +51,56 @@ SEE ALSO
|
|
45
51
|
|
46
52
|
AUTHOR
|
47
53
|
Written by Gouichi Iisaka, <iisaka51@gmail.com>
|
54
|
+
Format support added by Elmo Todurov, <todurov@gmail.com>
|
48
55
|
|
49
56
|
THANKS
|
50
57
|
Stuart Rackham, <srackham@gmail.com>
|
51
58
|
This script was inspired by his music2png.py and AsciiDoc
|
52
59
|
|
53
60
|
LICENSE
|
54
|
-
Copyright (C) 2008 Gouichi Iisaka.
|
61
|
+
Copyright (C) 2008-2009 Gouichi Iisaka.
|
55
62
|
Free use of this software is granted under the terms of
|
56
63
|
the GNU General Public License (GPL).
|
57
64
|
'''
|
58
65
|
|
59
66
|
def __init__(self, argv=None):
|
67
|
+
# Run dot, get the list of supported formats. It's prefixed by some junk.
|
68
|
+
format_output = subprocess.Popen(["dot", "-T?"], stderr=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[1]
|
69
|
+
# The junk contains : and ends with :. So we split it, then strip the final endline, then split the list for future usage.
|
70
|
+
supported_formats = format_output.split(": ")[2][:-1].split(" ")
|
71
|
+
|
60
72
|
if not argv:
|
61
73
|
argv = sys.argv
|
62
|
-
|
63
|
-
self.
|
64
|
-
self.
|
65
|
-
self.
|
74
|
+
|
75
|
+
self.usage = '%prog [options] inputfile'
|
76
|
+
self.version = 'Version: %s\n' % __VERSION__
|
77
|
+
self.version += 'Copyright(c) 2008-2009: %s\n' % __AUTHOR__
|
66
78
|
|
67
79
|
self.option_list = [
|
68
80
|
Option("-o", "--outfile", action="store",
|
69
|
-
|
70
|
-
|
81
|
+
dest="outfile",
|
82
|
+
help="Output file"),
|
71
83
|
Option("-L", "--layout", action="store",
|
72
|
-
|
73
|
-
|
84
|
+
dest="layout", default="dot", type="choice",
|
85
|
+
choices=['dot','neato','twopi','circo','fdp'],
|
86
|
+
help="Layout type. LAYOUT=<dot|neato|twopi|circo|fdp>"),
|
87
|
+
Option("-F", "--format", action="store",
|
88
|
+
dest="format", default="png", type="choice",
|
89
|
+
choices=supported_formats,
|
90
|
+
help="Format type. FORMAT=<" + "|".join(supported_formats) + ">"),
|
74
91
|
Option("--debug", action="store_true",
|
75
|
-
|
76
|
-
|
92
|
+
dest="do_debug",
|
93
|
+
help=SUPPRESS_HELP),
|
77
94
|
Option("-v", "--verbose", action="store_true",
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
dest="do_version",
|
82
|
-
help="Print version"),
|
83
|
-
]
|
84
|
-
|
85
|
-
self.parser = OptionParser(option_list=self.option_list)
|
86
|
-
self.parser.set_usage(self.usage_msg)
|
87
|
-
(self.options, self.args) = self.parser.parse_args()
|
95
|
+
dest="do_verbose", default=False,
|
96
|
+
help="verbose output"),
|
97
|
+
]
|
88
98
|
|
89
|
-
|
90
|
-
|
91
|
-
|
99
|
+
self.parser = OptionParser( usage=self.usage, version=self.version,
|
100
|
+
option_list=self.option_list)
|
101
|
+
(self.options, self.args) = self.parser.parse_args()
|
92
102
|
|
93
|
-
|
103
|
+
if len(self.args) != 1:
|
94
104
|
self.parser.print_help()
|
95
105
|
sys.exit(1)
|
96
106
|
|
@@ -101,7 +111,7 @@ LICENSE
|
|
101
111
|
msg = 'Execute: %s' % cmd
|
102
112
|
sys.stderr.write(msg + os.linesep)
|
103
113
|
else:
|
104
|
-
cmd += ' 2
|
114
|
+
cmd += ' 2>%s' % os.devnull
|
105
115
|
if os.system(cmd):
|
106
116
|
raise EApp, 'failed command: %s' % cmd
|
107
117
|
|
@@ -119,14 +129,19 @@ LICENSE
|
|
119
129
|
saved_cwd = os.getcwd()
|
120
130
|
os.chdir(outdir)
|
121
131
|
try:
|
122
|
-
cmd = '%s -
|
123
|
-
|
132
|
+
cmd = '%s -T%s "%s" > "%s"' % (
|
133
|
+
self.options.layout, self.options.format, infile, outfile)
|
124
134
|
self.systemcmd(cmd)
|
125
|
-
os.unlink(infile)
|
126
135
|
finally:
|
127
136
|
os.chdir(saved_cwd)
|
128
137
|
|
138
|
+
if not self.options.do_debug:
|
139
|
+
os.unlink(infile)
|
140
|
+
|
129
141
|
def run(self):
|
142
|
+
if self.options.format == '':
|
143
|
+
self.options.format = 'png'
|
144
|
+
|
130
145
|
if self.options.infile == '-':
|
131
146
|
if self.options.outfile is None:
|
132
147
|
sys.stderr.write('OUTFILE must be specified')
|