mizuho 0.9.6 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. data/README.markdown +4 -2
  2. data/Rakefile +0 -37
  3. data/asciidoc/BUGS +9 -18
  4. data/asciidoc/BUGS.txt +5 -14
  5. data/asciidoc/CHANGELOG +1433 -266
  6. data/asciidoc/CHANGELOG.txt +2821 -1810
  7. data/asciidoc/COPYING +339 -339
  8. data/asciidoc/COPYRIGHT +18 -18
  9. data/asciidoc/INSTALL +189 -30
  10. data/asciidoc/INSTALL.txt +175 -19
  11. data/asciidoc/MANIFEST +88 -0
  12. data/asciidoc/Makefile.in +29 -13
  13. data/asciidoc/README +16 -17
  14. data/asciidoc/README.txt +35 -36
  15. data/asciidoc/a2x.py +902 -0
  16. data/asciidoc/asciidoc.conf +610 -455
  17. data/asciidoc/asciidoc.py +1965 -1061
  18. data/asciidoc/asciidocapi.py +257 -0
  19. data/asciidoc/common.aap +2 -2
  20. data/asciidoc/configure +1170 -1023
  21. data/asciidoc/configure.ac +1 -1
  22. data/asciidoc/dblatex/asciidoc-dblatex.xsl +42 -0
  23. data/asciidoc/doc/a2x.1 +559 -102
  24. data/asciidoc/doc/a2x.1.txt +233 -91
  25. data/asciidoc/doc/article-docinfo.xml +87 -0
  26. data/asciidoc/doc/article.pdf +0 -0
  27. data/asciidoc/doc/article.txt +139 -122
  28. data/asciidoc/doc/asciidoc.1 +157 -46
  29. data/asciidoc/doc/asciidoc.1.txt +171 -118
  30. data/asciidoc/doc/asciidoc.conf +7 -8
  31. data/asciidoc/doc/asciidoc.dict +960 -635
  32. data/asciidoc/doc/asciidoc.txt +2335 -1464
  33. data/asciidoc/doc/asciidocapi.txt +189 -0
  34. data/asciidoc/doc/asciimathml.txt +14 -17
  35. data/asciidoc/doc/book-multi.txt +181 -155
  36. data/asciidoc/doc/book.epub +0 -0
  37. data/asciidoc/doc/book.txt +156 -131
  38. data/asciidoc/doc/customers.csv +18 -18
  39. data/asciidoc/doc/epub-notes.txt +210 -0
  40. data/asciidoc/doc/faq.txt +1122 -547
  41. data/asciidoc/doc/latex-backend.txt +192 -191
  42. data/asciidoc/doc/latex-bugs.txt +134 -0
  43. data/asciidoc/doc/latex-filter.pdf +0 -0
  44. data/asciidoc/doc/latex-filter.txt +196 -0
  45. data/asciidoc/doc/latexmath.txt +13 -136
  46. data/asciidoc/doc/latexmathml.txt +2 -2
  47. data/asciidoc/doc/main.aap +233 -297
  48. data/asciidoc/doc/music-filter.pdf +0 -0
  49. data/asciidoc/doc/music-filter.txt +55 -65
  50. data/asciidoc/doc/publishing-ebooks-with-asciidoc.txt +398 -0
  51. data/asciidoc/doc/slidy-example.txt +167 -0
  52. data/asciidoc/doc/slidy.txt +113 -0
  53. data/asciidoc/doc/source-highlight-filter.pdf +0 -0
  54. data/asciidoc/doc/source-highlight-filter.txt +45 -20
  55. data/asciidoc/doc/testasciidoc.txt +231 -0
  56. data/asciidoc/docbook-xsl/asciidoc-docbook-xsl.txt +30 -8
  57. data/asciidoc/docbook-xsl/chunked.xsl +17 -19
  58. data/asciidoc/docbook-xsl/common.xsl +106 -67
  59. data/asciidoc/docbook-xsl/epub.xsl +35 -0
  60. data/asciidoc/docbook-xsl/fo.xsl +3 -0
  61. data/asciidoc/docbook-xsl/htmlhelp.xsl +16 -17
  62. data/asciidoc/docbook-xsl/manpage.xsl +31 -31
  63. data/asciidoc/docbook-xsl/text.xsl +6 -1
  64. data/asciidoc/docbook-xsl/xhtml.xsl +14 -14
  65. data/asciidoc/docbook45.conf +759 -0
  66. data/asciidoc/filters/code/code-filter-readme.txt +37 -37
  67. data/asciidoc/filters/code/code-filter-test.txt +15 -15
  68. data/asciidoc/filters/code/code-filter.conf +8 -8
  69. data/asciidoc/filters/graphviz/asciidoc-graphviz-sample.txt +104 -64
  70. data/asciidoc/filters/graphviz/graphviz-filter.conf +20 -16
  71. data/asciidoc/filters/graphviz/graphviz2png.py +54 -39
  72. data/asciidoc/filters/latex/latex-filter.conf +18 -0
  73. data/asciidoc/filters/latex/latex2png.py +216 -0
  74. data/asciidoc/filters/music/music-filter.conf +8 -17
  75. data/asciidoc/filters/music/music2png.py +40 -32
  76. data/asciidoc/filters/source/source-highlight-filter.conf +40 -34
  77. data/asciidoc/help.conf +261 -96
  78. data/asciidoc/html4.conf +505 -460
  79. data/asciidoc/html5.conf +686 -0
  80. data/asciidoc/images/highlighter.png +0 -0
  81. data/asciidoc/images/icons/caution.png +0 -0
  82. data/asciidoc/images/icons/example.png +0 -0
  83. data/asciidoc/images/icons/important.png +0 -0
  84. data/asciidoc/images/icons/note.png +0 -0
  85. data/asciidoc/images/icons/tip.png +0 -0
  86. data/asciidoc/images/icons/warning.png +0 -0
  87. data/asciidoc/images/smallnew.png +0 -0
  88. data/asciidoc/javascripts/asciidoc.js +189 -0
  89. data/asciidoc/javascripts/slidy.js +2845 -0
  90. data/asciidoc/javascripts/toc.js +8 -0
  91. data/asciidoc/lang-de.conf +57 -0
  92. data/asciidoc/lang-en.conf +54 -0
  93. data/asciidoc/lang-es.conf +49 -9
  94. data/asciidoc/lang-fr.conf +59 -0
  95. data/asciidoc/lang-hu.conf +55 -0
  96. data/asciidoc/lang-it.conf +55 -0
  97. data/asciidoc/lang-nl.conf +57 -0
  98. data/asciidoc/lang-pt-BR.conf +56 -0
  99. data/asciidoc/lang-ru.conf +60 -0
  100. data/asciidoc/lang-uk.conf +60 -0
  101. data/asciidoc/latex.conf +700 -663
  102. data/asciidoc/main.aap +77 -0
  103. data/asciidoc/slidy.conf +136 -0
  104. data/asciidoc/{examples/website/xhtml11-manpage.css → stylesheets/asciidoc-manpage.css} +1 -1
  105. data/asciidoc/stylesheets/asciidoc.css +508 -0
  106. data/asciidoc/stylesheets/docbook-xsl.css +322 -272
  107. data/asciidoc/stylesheets/flask-manpage.css +1 -0
  108. data/asciidoc/stylesheets/flask.css +584 -0
  109. data/asciidoc/stylesheets/pygments.css +66 -0
  110. data/asciidoc/stylesheets/slidy.css +445 -0
  111. data/asciidoc/stylesheets/toc2.css +33 -0
  112. data/asciidoc/stylesheets/volnitsky-manpage.css +1 -0
  113. data/asciidoc/stylesheets/volnitsky.css +435 -0
  114. data/asciidoc/stylesheets/xhtml11-quirks.css +5 -3
  115. data/asciidoc/tests/asciidocapi.py +257 -0
  116. data/asciidoc/tests/data/deprecated-quotes.txt +12 -0
  117. data/asciidoc/tests/data/filters-test.txt +90 -0
  118. data/asciidoc/tests/data/lang-de-test.txt +106 -0
  119. data/asciidoc/tests/data/lang-en-test.txt +114 -0
  120. data/asciidoc/tests/data/lang-es-test.txt +106 -0
  121. data/asciidoc/tests/data/lang-fr-test.txt +106 -0
  122. data/asciidoc/tests/data/lang-hu-test.txt +106 -0
  123. data/asciidoc/tests/data/lang-nl-test.txt +94 -0
  124. data/asciidoc/tests/data/lang-pt-BR-test.txt +106 -0
  125. data/asciidoc/tests/data/lang-ru-test.txt +106 -0
  126. data/asciidoc/tests/data/lang-uk-test.txt +106 -0
  127. data/asciidoc/tests/data/oldtables.txt +64 -0
  128. data/asciidoc/tests/data/rcs-id-marker-test.txt +6 -0
  129. data/asciidoc/tests/data/testcases.conf +2 -0
  130. data/asciidoc/tests/data/testcases.txt +740 -0
  131. data/asciidoc/tests/data/utf8-bom-test.txt +9 -0
  132. data/asciidoc/tests/data/utf8-examples.txt +217 -0
  133. data/asciidoc/tests/testasciidoc.conf +520 -0
  134. data/asciidoc/tests/testasciidoc.py +411 -0
  135. data/asciidoc/text.conf +16 -16
  136. data/asciidoc/vim/syntax/asciidoc.vim +99 -91
  137. data/asciidoc/wordpress.conf +43 -3
  138. data/asciidoc/xhtml11-quirks.conf +61 -57
  139. data/asciidoc/xhtml11.conf +684 -645
  140. data/lib/mizuho.rb +2 -0
  141. data/lib/mizuho/generator.rb +2 -2
  142. data/test/generator_spec.rb +1 -1
  143. data/test/parser_spec.rb +1 -1
  144. data/test/spec_helper.rb +3 -4
  145. metadata +87 -88
  146. data/asciidoc/a2x +0 -674
  147. data/asciidoc/doc/article.css-embedded.html +0 -602
  148. data/asciidoc/doc/article.html +0 -46
  149. data/asciidoc/doc/asciidoc-revhistory.xml +0 -27
  150. data/asciidoc/doc/asciidoc.1.css-embedded.html +0 -598
  151. data/asciidoc/doc/asciidoc.1.css.html +0 -212
  152. data/asciidoc/doc/asciidoc.1.html +0 -190
  153. data/asciidoc/doc/asciidoc.css-embedded.html +0 -7853
  154. data/asciidoc/doc/asciidoc.css.html +0 -7416
  155. data/asciidoc/doc/asciidoc.html +0 -3339
  156. data/asciidoc/doc/book-multi.css-embedded.html +0 -575
  157. data/asciidoc/doc/book-multi.html +0 -55
  158. data/asciidoc/doc/book.css-embedded.html +0 -607
  159. data/asciidoc/doc/book.html +0 -43
  160. data/asciidoc/doc/docbook-xsl.css +0 -272
  161. data/asciidoc/doc/latex-backend.html +0 -117
  162. data/asciidoc/doc/music-filter.html +0 -566
  163. data/asciidoc/doc/source-highlight-filter.html +0 -214
  164. data/asciidoc/docbook.conf +0 -721
  165. data/asciidoc/examples/website/ASCIIMathML.js +0 -938
  166. data/asciidoc/examples/website/CHANGELOG.html +0 -4389
  167. data/asciidoc/examples/website/CHANGELOG.txt +0 -1810
  168. data/asciidoc/examples/website/INSTALL.html +0 -161
  169. data/asciidoc/examples/website/INSTALL.txt +0 -71
  170. data/asciidoc/examples/website/LaTeXMathML.js +0 -1223
  171. data/asciidoc/examples/website/README-website.html +0 -118
  172. data/asciidoc/examples/website/README-website.txt +0 -29
  173. data/asciidoc/examples/website/README.html +0 -125
  174. data/asciidoc/examples/website/README.txt +0 -36
  175. data/asciidoc/examples/website/a2x.1.html +0 -419
  176. data/asciidoc/examples/website/a2x.1.txt +0 -204
  177. data/asciidoc/examples/website/asciidoc-docbook-xsl.html +0 -130
  178. data/asciidoc/examples/website/asciidoc-docbook-xsl.txt +0 -43
  179. data/asciidoc/examples/website/asciidoc-graphviz-sample.txt +0 -130
  180. data/asciidoc/examples/website/asciimathml.txt +0 -64
  181. data/asciidoc/examples/website/build-website.sh +0 -25
  182. data/asciidoc/examples/website/customers.csv +0 -18
  183. data/asciidoc/examples/website/downloads.html +0 -257
  184. data/asciidoc/examples/website/downloads.txt +0 -121
  185. data/asciidoc/examples/website/faq.html +0 -673
  186. data/asciidoc/examples/website/faq.txt +0 -547
  187. data/asciidoc/examples/website/index.html +0 -419
  188. data/asciidoc/examples/website/index.txt +0 -245
  189. data/asciidoc/examples/website/latex-backend.html +0 -535
  190. data/asciidoc/examples/website/latex-backend.txt +0 -191
  191. data/asciidoc/examples/website/latexmathml.txt +0 -41
  192. data/asciidoc/examples/website/layout1.conf +0 -161
  193. data/asciidoc/examples/website/layout1.css +0 -65
  194. data/asciidoc/examples/website/layout2.conf +0 -158
  195. data/asciidoc/examples/website/layout2.css +0 -93
  196. data/asciidoc/examples/website/manpage.html +0 -266
  197. data/asciidoc/examples/website/manpage.txt +0 -118
  198. data/asciidoc/examples/website/music-filter.html +0 -242
  199. data/asciidoc/examples/website/music-filter.txt +0 -158
  200. data/asciidoc/examples/website/music1.abc +0 -12
  201. data/asciidoc/examples/website/music1.png +0 -0
  202. data/asciidoc/examples/website/music2.ly +0 -9
  203. data/asciidoc/examples/website/music2.png +0 -0
  204. data/asciidoc/examples/website/newlists.txt +0 -40
  205. data/asciidoc/examples/website/newtables.txt +0 -397
  206. data/asciidoc/examples/website/sample1.png +0 -0
  207. data/asciidoc/examples/website/sample3.png +0 -0
  208. data/asciidoc/examples/website/sample4.png +0 -0
  209. data/asciidoc/examples/website/source-highlight-filter.html +0 -286
  210. data/asciidoc/examples/website/source-highlight-filter.txt +0 -203
  211. data/asciidoc/examples/website/support.html +0 -78
  212. data/asciidoc/examples/website/support.txt +0 -5
  213. data/asciidoc/examples/website/toc.js +0 -69
  214. data/asciidoc/examples/website/userguide.html +0 -7460
  215. data/asciidoc/examples/website/userguide.txt +0 -4979
  216. data/asciidoc/examples/website/version83.txt +0 -37
  217. data/asciidoc/examples/website/version9.html +0 -143
  218. data/asciidoc/examples/website/version9.txt +0 -48
  219. data/asciidoc/examples/website/xhtml11-quirks.css +0 -41
  220. data/asciidoc/examples/website/xhtml11.css +0 -328
  221. data/asciidoc/stylesheets/xhtml11-manpage.css +0 -18
  222. 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.0
5
+ Version: 1.1.3
6
6
 
7
7
  == Introduction ==
8
8
 
9
- Graph visualization is a way of representing structural information
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
- == Simple Example ==
27
+ == Examples ==
17
28
 
18
- --------------------------------------------------------------------
19
- ["graphviz", "sample1.png"]
20
- ---------------------------------------------------------------------
21
- digraph G { rankdir=LR; Graphviz->AsciiDoc->HTML}
22
- ---------------------------------------------------------------------
23
- --------------------------------------------------------------------
29
+ === Simple ===
30
+ .....................................................................
31
+ [graphviz]
32
+ ---------------------------------------------------------------------
33
+ digraph G { rankdir=LR; Graphviz->AsciiDoc->HTML}
34
+ ---------------------------------------------------------------------
35
+ .....................................................................
24
36
 
25
- ["graphviz", "sample1.png"]
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
- ["graphviz", "sample2.png"]
32
- ---------------------------------------------------------------------
33
- digraph automata_0 {
34
- size ="8.5, 11";
35
- node [shape = circle];
36
- 0 [ style = filled, color=lightgrey ];
37
- 2 [ shape = doublecircle ];
38
- 0 -> 2 [ label = "a " ];
39
- 0 -> 1 [ label = "other " ];
40
- 1 -> 2 [ label = "a " ];
41
- 1 -> 1 [ label = "other " ];
42
- 2 -> 2 [ label = "a " ];
43
- 2 -> 1 [ label = "other " ];
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", "sample3.png"]
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
- ["graphviz", "sample4.png", "dot"]
69
- ---------------------------------------------------------------------
70
- digraph finite_state_machine {
71
- rankdir=LR;
72
- size="8,5"
73
- node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
74
- node [shape = circle];
75
- LR_0 -> LR_2 [ label = "SS(B)" ];
76
- LR_0 -> LR_1 [ label = "SS(S)" ];
77
- LR_1 -> LR_3 [ label = "S($end)" ];
78
- LR_2 -> LR_6 [ label = "SS(b)" ];
79
- LR_2 -> LR_5 [ label = "SS(a)" ];
80
- LR_2 -> LR_4 [ label = "S(A)" ];
81
- LR_5 -> LR_7 [ label = "S(b)" ];
82
- LR_5 -> LR_5 [ label = "S(a)" ];
83
- LR_6 -> LR_6 [ label = "S(b)" ];
84
- LR_6 -> LR_5 [ label = "S(a)" ];
85
- LR_7 -> LR_8 [ label = "S(b)" ];
86
- LR_7 -> LR_5 [ label = "S(a)" ];
87
- LR_8 -> LR_6 [ label = "S(b)" ];
88
- LR_8 -> LR_5 [ label = "S(a)" ];
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
- .Example for `dot':
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
- layout for graphviz as follows.
122
-
123
- * dot:: filter for drawing directed graphs
124
- * neato:: filter for drawing undirected graphs
125
- * twopi:: filter for radial layouts of graphs
126
- * circo:: filter for circular layout of graphs
127
- * fdp:: filter for drawing undirected graphs
128
-
129
- default is `dot'.
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
- graphviz-style=template="graphviz-block",subs=(),posattrs=("style","target","layout"),filter='graphviz2png.py {verbose?-v} -o "{outdir}/{target}" -L {layout=dot} -'
11
+ template::[graphviz-filter-style]
9
12
 
10
- ifdef::basebackend-html[]
11
- [graphviz-block]
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
- import os, sys
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
- -v
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, -h
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
- self.attrs = Struct()
63
- self.usage_msg = '%prog [options] inputfile\n'
64
- self.usage_msg += 'Version: %s\n' % __VERSION__
65
- self.usage_msg += 'Copyright(c) 2008: %s' % __AUTHOR__
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
- dest="outfile",
70
- help="Output file"),
81
+ dest="outfile",
82
+ help="Output file"),
71
83
  Option("-L", "--layout", action="store",
72
- dest="layout", default="dot",
73
- help="Output file"),
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
- dest="do_debug",
76
- help=SUPPRESS_HELP),
92
+ dest="do_debug",
93
+ help=SUPPRESS_HELP),
77
94
  Option("-v", "--verbose", action="store_true",
78
- dest="do_verbose", default=False,
79
- help="verbose output"),
80
- Option("-V", "--version", action="store_true",
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
- if self.options.do_version:
90
- self.parser.print_usage()
91
- sys.exit(1)
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
- if len(self.args) != 1:
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>/dev/null'
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 -Tpng "%s" > "%s"' % (
123
- self.options.layout, infile, outfile)
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')