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
data/lib/mizuho.rb
CHANGED
data/lib/mizuho/generator.rb
CHANGED
@@ -50,12 +50,12 @@ class Generator
|
|
50
50
|
private
|
51
51
|
def locate_template_file(template_name)
|
52
52
|
if template_name.nil?
|
53
|
-
return "#{
|
53
|
+
return "#{SOURCE_ROOT}/templates/asciidoc.html.erb"
|
54
54
|
elsif template_name =~ %r{[/.]}
|
55
55
|
# Looks like a filename.
|
56
56
|
return template_name
|
57
57
|
else
|
58
|
-
return "#{
|
58
|
+
return "#{SOURCE_ROOT}/templates/#{template_name}.html.erb"
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
data/test/generator_spec.rb
CHANGED
data/test/parser_spec.rb
CHANGED
data/test/spec_helper.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
|
-
$LOAD_PATH << "#{ROOT_DIR}/lib"
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../lib/mizuho")
|
3
2
|
require 'digest/md5'
|
4
3
|
require 'mizuho/generator'
|
5
4
|
|
6
|
-
CACHE_DIR = "#{
|
5
|
+
CACHE_DIR = "#{Mizuho::SOURCE_ROOT}/test/cache"
|
7
6
|
|
8
7
|
def generate_and_parse(text)
|
9
8
|
Dir.mkdir(CACHE_DIR) if !File.exist?(CACHE_DIR)
|
@@ -46,6 +45,6 @@ def generate_and_parse(text)
|
|
46
45
|
end
|
47
46
|
|
48
47
|
def asciidoc_newer_than?(filename)
|
49
|
-
asciidoc_mtime = File.stat("#{
|
48
|
+
asciidoc_mtime = File.stat("#{Mizuho::SOURCE_ROOT}/asciidoc/asciidoc.py").mtime
|
50
49
|
return asciidoc_mtime > File.stat(filename).mtime
|
51
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mizuho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 43
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 9
|
9
|
+
- 8
|
10
|
+
version: 0.9.8
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Hongli Lai
|
@@ -9,19 +15,23 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2011-06-02 00:00:00 +02:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: hpricot
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
23
32
|
version: "0"
|
24
|
-
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
25
35
|
description: A documentation formatting tool. Mizuho converts Asciidoc input files into nicely outputted HTML, possibly one file per chapter. Multiple templates are supported, so you can write your own.
|
26
36
|
email: hongli@phusion.nl
|
27
37
|
executables:
|
@@ -51,9 +61,10 @@ files:
|
|
51
61
|
- templates/asciidoc.html.erb
|
52
62
|
- templates/manualsonrails.css
|
53
63
|
- templates/manualsonrails.html.erb
|
54
|
-
- asciidoc/a2x
|
64
|
+
- asciidoc/a2x.py
|
55
65
|
- asciidoc/asciidoc.conf
|
56
66
|
- asciidoc/asciidoc.py
|
67
|
+
- asciidoc/asciidocapi.py
|
57
68
|
- asciidoc/BUGS
|
58
69
|
- asciidoc/BUGS.txt
|
59
70
|
- asciidoc/CHANGELOG
|
@@ -68,109 +79,47 @@ files:
|
|
68
79
|
- asciidoc/dblatex/dblatex-readme.txt
|
69
80
|
- asciidoc/doc/a2x.1
|
70
81
|
- asciidoc/doc/a2x.1.txt
|
71
|
-
- asciidoc/doc/article
|
72
|
-
- asciidoc/doc/article.html
|
82
|
+
- asciidoc/doc/article-docinfo.xml
|
73
83
|
- asciidoc/doc/article.pdf
|
74
84
|
- asciidoc/doc/article.txt
|
75
|
-
- asciidoc/doc/asciidoc-revhistory.xml
|
76
85
|
- asciidoc/doc/asciidoc.1
|
77
|
-
- asciidoc/doc/asciidoc.1.css-embedded.html
|
78
|
-
- asciidoc/doc/asciidoc.1.css.html
|
79
|
-
- asciidoc/doc/asciidoc.1.html
|
80
86
|
- asciidoc/doc/asciidoc.1.txt
|
81
87
|
- asciidoc/doc/asciidoc.conf
|
82
|
-
- asciidoc/doc/asciidoc.css-embedded.html
|
83
|
-
- asciidoc/doc/asciidoc.css.html
|
84
88
|
- asciidoc/doc/asciidoc.dict
|
85
|
-
- asciidoc/doc/asciidoc.html
|
86
89
|
- asciidoc/doc/asciidoc.txt
|
90
|
+
- asciidoc/doc/asciidocapi.txt
|
87
91
|
- asciidoc/doc/asciimathml.txt
|
88
|
-
- asciidoc/doc/book-multi.css-embedded.html
|
89
|
-
- asciidoc/doc/book-multi.html
|
90
92
|
- asciidoc/doc/book-multi.txt
|
91
|
-
- asciidoc/doc/book.
|
92
|
-
- asciidoc/doc/book.html
|
93
|
+
- asciidoc/doc/book.epub
|
93
94
|
- asciidoc/doc/book.txt
|
94
95
|
- asciidoc/doc/customers.csv
|
95
|
-
- asciidoc/doc/
|
96
|
+
- asciidoc/doc/epub-notes.txt
|
96
97
|
- asciidoc/doc/faq.txt
|
97
|
-
- asciidoc/doc/latex-backend.html
|
98
98
|
- asciidoc/doc/latex-backend.txt
|
99
|
+
- asciidoc/doc/latex-bugs.txt
|
100
|
+
- asciidoc/doc/latex-filter.pdf
|
101
|
+
- asciidoc/doc/latex-filter.txt
|
99
102
|
- asciidoc/doc/latexmath.txt
|
100
103
|
- asciidoc/doc/latexmathml.txt
|
101
104
|
- asciidoc/doc/main.aap
|
102
|
-
- asciidoc/doc/music-filter.html
|
103
105
|
- asciidoc/doc/music-filter.pdf
|
104
106
|
- asciidoc/doc/music-filter.txt
|
105
|
-
- asciidoc/doc/
|
107
|
+
- asciidoc/doc/publishing-ebooks-with-asciidoc.txt
|
108
|
+
- asciidoc/doc/slidy-example.txt
|
109
|
+
- asciidoc/doc/slidy.txt
|
106
110
|
- asciidoc/doc/source-highlight-filter.pdf
|
107
111
|
- asciidoc/doc/source-highlight-filter.txt
|
112
|
+
- asciidoc/doc/testasciidoc.txt
|
108
113
|
- asciidoc/docbook-xsl/asciidoc-docbook-xsl.txt
|
109
114
|
- asciidoc/docbook-xsl/chunked.xsl
|
110
115
|
- asciidoc/docbook-xsl/common.xsl
|
116
|
+
- asciidoc/docbook-xsl/epub.xsl
|
111
117
|
- asciidoc/docbook-xsl/fo.xsl
|
112
118
|
- asciidoc/docbook-xsl/htmlhelp.xsl
|
113
119
|
- asciidoc/docbook-xsl/manpage.xsl
|
114
120
|
- asciidoc/docbook-xsl/text.xsl
|
115
121
|
- asciidoc/docbook-xsl/xhtml.xsl
|
116
|
-
- asciidoc/
|
117
|
-
- asciidoc/examples/website/a2x.1.html
|
118
|
-
- asciidoc/examples/website/a2x.1.txt
|
119
|
-
- asciidoc/examples/website/asciidoc-docbook-xsl.html
|
120
|
-
- asciidoc/examples/website/asciidoc-docbook-xsl.txt
|
121
|
-
- asciidoc/examples/website/asciidoc-graphviz-sample.txt
|
122
|
-
- asciidoc/examples/website/ASCIIMathML.js
|
123
|
-
- asciidoc/examples/website/asciimathml.txt
|
124
|
-
- asciidoc/examples/website/build-website.sh
|
125
|
-
- asciidoc/examples/website/CHANGELOG.html
|
126
|
-
- asciidoc/examples/website/CHANGELOG.txt
|
127
|
-
- asciidoc/examples/website/customers.csv
|
128
|
-
- asciidoc/examples/website/downloads.html
|
129
|
-
- asciidoc/examples/website/downloads.txt
|
130
|
-
- asciidoc/examples/website/faq.html
|
131
|
-
- asciidoc/examples/website/faq.txt
|
132
|
-
- asciidoc/examples/website/index.html
|
133
|
-
- asciidoc/examples/website/index.txt
|
134
|
-
- asciidoc/examples/website/INSTALL.html
|
135
|
-
- asciidoc/examples/website/INSTALL.txt
|
136
|
-
- asciidoc/examples/website/latex-backend.html
|
137
|
-
- asciidoc/examples/website/latex-backend.txt
|
138
|
-
- asciidoc/examples/website/LaTeXMathML.js
|
139
|
-
- asciidoc/examples/website/latexmathml.txt
|
140
|
-
- asciidoc/examples/website/layout1.conf
|
141
|
-
- asciidoc/examples/website/layout1.css
|
142
|
-
- asciidoc/examples/website/layout2.conf
|
143
|
-
- asciidoc/examples/website/layout2.css
|
144
|
-
- asciidoc/examples/website/manpage.html
|
145
|
-
- asciidoc/examples/website/manpage.txt
|
146
|
-
- asciidoc/examples/website/music-filter.html
|
147
|
-
- asciidoc/examples/website/music-filter.txt
|
148
|
-
- asciidoc/examples/website/music1.abc
|
149
|
-
- asciidoc/examples/website/music1.png
|
150
|
-
- asciidoc/examples/website/music2.ly
|
151
|
-
- asciidoc/examples/website/music2.png
|
152
|
-
- asciidoc/examples/website/newlists.txt
|
153
|
-
- asciidoc/examples/website/newtables.txt
|
154
|
-
- asciidoc/examples/website/README-website.html
|
155
|
-
- asciidoc/examples/website/README-website.txt
|
156
|
-
- asciidoc/examples/website/README.html
|
157
|
-
- asciidoc/examples/website/README.txt
|
158
|
-
- asciidoc/examples/website/sample1.png
|
159
|
-
- asciidoc/examples/website/sample3.png
|
160
|
-
- asciidoc/examples/website/sample4.png
|
161
|
-
- asciidoc/examples/website/source-highlight-filter.html
|
162
|
-
- asciidoc/examples/website/source-highlight-filter.txt
|
163
|
-
- asciidoc/examples/website/support.html
|
164
|
-
- asciidoc/examples/website/support.txt
|
165
|
-
- asciidoc/examples/website/toc.js
|
166
|
-
- asciidoc/examples/website/userguide.html
|
167
|
-
- asciidoc/examples/website/userguide.txt
|
168
|
-
- asciidoc/examples/website/version83.txt
|
169
|
-
- asciidoc/examples/website/version9.html
|
170
|
-
- asciidoc/examples/website/version9.txt
|
171
|
-
- asciidoc/examples/website/xhtml11-manpage.css
|
172
|
-
- asciidoc/examples/website/xhtml11-quirks.css
|
173
|
-
- asciidoc/examples/website/xhtml11.css
|
122
|
+
- asciidoc/docbook45.conf
|
174
123
|
- asciidoc/filters/code/code-filter-readme.txt
|
175
124
|
- asciidoc/filters/code/code-filter-test.txt
|
176
125
|
- asciidoc/filters/code/code-filter.conf
|
@@ -178,6 +127,8 @@ files:
|
|
178
127
|
- asciidoc/filters/graphviz/asciidoc-graphviz-sample.txt
|
179
128
|
- asciidoc/filters/graphviz/graphviz-filter.conf
|
180
129
|
- asciidoc/filters/graphviz/graphviz2png.py
|
130
|
+
- asciidoc/filters/latex/latex-filter.conf
|
131
|
+
- asciidoc/filters/latex/latex2png.py
|
181
132
|
- asciidoc/filters/music/music-filter-test.txt
|
182
133
|
- asciidoc/filters/music/music-filter.conf
|
183
134
|
- asciidoc/filters/music/music2png.py
|
@@ -185,6 +136,7 @@ files:
|
|
185
136
|
- asciidoc/filters/source/source-highlight-filter.conf
|
186
137
|
- asciidoc/help.conf
|
187
138
|
- asciidoc/html4.conf
|
139
|
+
- asciidoc/html5.conf
|
188
140
|
- asciidoc/images/highlighter.png
|
189
141
|
- asciidoc/images/icons/callouts/1.png
|
190
142
|
- asciidoc/images/icons/callouts/10.png
|
@@ -217,18 +169,59 @@ files:
|
|
217
169
|
- asciidoc/INSTALL
|
218
170
|
- asciidoc/install-sh
|
219
171
|
- asciidoc/INSTALL.txt
|
172
|
+
- asciidoc/javascripts/asciidoc.js
|
220
173
|
- asciidoc/javascripts/ASCIIMathML.js
|
221
174
|
- asciidoc/javascripts/LaTeXMathML.js
|
175
|
+
- asciidoc/javascripts/slidy.js
|
222
176
|
- asciidoc/javascripts/toc.js
|
177
|
+
- asciidoc/lang-de.conf
|
178
|
+
- asciidoc/lang-en.conf
|
223
179
|
- asciidoc/lang-es.conf
|
180
|
+
- asciidoc/lang-fr.conf
|
181
|
+
- asciidoc/lang-hu.conf
|
182
|
+
- asciidoc/lang-it.conf
|
183
|
+
- asciidoc/lang-nl.conf
|
184
|
+
- asciidoc/lang-pt-BR.conf
|
185
|
+
- asciidoc/lang-ru.conf
|
186
|
+
- asciidoc/lang-uk.conf
|
224
187
|
- asciidoc/latex.conf
|
188
|
+
- asciidoc/main.aap
|
225
189
|
- asciidoc/Makefile.in
|
190
|
+
- asciidoc/MANIFEST
|
226
191
|
- asciidoc/README
|
227
192
|
- asciidoc/README.txt
|
193
|
+
- asciidoc/slidy.conf
|
194
|
+
- asciidoc/stylesheets/asciidoc-manpage.css
|
195
|
+
- asciidoc/stylesheets/asciidoc.css
|
228
196
|
- asciidoc/stylesheets/docbook-xsl.css
|
229
|
-
- asciidoc/stylesheets/
|
197
|
+
- asciidoc/stylesheets/flask-manpage.css
|
198
|
+
- asciidoc/stylesheets/flask.css
|
199
|
+
- asciidoc/stylesheets/pygments.css
|
200
|
+
- asciidoc/stylesheets/slidy.css
|
201
|
+
- asciidoc/stylesheets/toc2.css
|
202
|
+
- asciidoc/stylesheets/volnitsky-manpage.css
|
203
|
+
- asciidoc/stylesheets/volnitsky.css
|
230
204
|
- asciidoc/stylesheets/xhtml11-quirks.css
|
231
|
-
- asciidoc/
|
205
|
+
- asciidoc/tests/asciidocapi.py
|
206
|
+
- asciidoc/tests/data/deprecated-quotes.txt
|
207
|
+
- asciidoc/tests/data/filters-test.txt
|
208
|
+
- asciidoc/tests/data/lang-de-test.txt
|
209
|
+
- asciidoc/tests/data/lang-en-test.txt
|
210
|
+
- asciidoc/tests/data/lang-es-test.txt
|
211
|
+
- asciidoc/tests/data/lang-fr-test.txt
|
212
|
+
- asciidoc/tests/data/lang-hu-test.txt
|
213
|
+
- asciidoc/tests/data/lang-nl-test.txt
|
214
|
+
- asciidoc/tests/data/lang-pt-BR-test.txt
|
215
|
+
- asciidoc/tests/data/lang-ru-test.txt
|
216
|
+
- asciidoc/tests/data/lang-uk-test.txt
|
217
|
+
- asciidoc/tests/data/oldtables.txt
|
218
|
+
- asciidoc/tests/data/rcs-id-marker-test.txt
|
219
|
+
- asciidoc/tests/data/testcases.conf
|
220
|
+
- asciidoc/tests/data/testcases.txt
|
221
|
+
- asciidoc/tests/data/utf8-bom-test.txt
|
222
|
+
- asciidoc/tests/data/utf8-examples.txt
|
223
|
+
- asciidoc/tests/testasciidoc.conf
|
224
|
+
- asciidoc/tests/testasciidoc.py
|
232
225
|
- asciidoc/text.conf
|
233
226
|
- asciidoc/vim/ftdetect/asciidoc_filetype.vim
|
234
227
|
- asciidoc/vim/syntax/asciidoc.vim
|
@@ -327,7 +320,7 @@ files:
|
|
327
320
|
- source-highlight/xml.lang
|
328
321
|
- source-highlight/xorg.lang
|
329
322
|
has_rdoc: true
|
330
|
-
homepage:
|
323
|
+
homepage: https://github.com/FooBarWidget/mizuho
|
331
324
|
licenses: []
|
332
325
|
|
333
326
|
post_install_message:
|
@@ -336,21 +329,27 @@ rdoc_options: []
|
|
336
329
|
require_paths:
|
337
330
|
- lib
|
338
331
|
required_ruby_version: !ruby/object:Gem::Requirement
|
332
|
+
none: false
|
339
333
|
requirements:
|
340
334
|
- - ">="
|
341
335
|
- !ruby/object:Gem::Version
|
336
|
+
hash: 3
|
337
|
+
segments:
|
338
|
+
- 0
|
342
339
|
version: "0"
|
343
|
-
version:
|
344
340
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
341
|
+
none: false
|
345
342
|
requirements:
|
346
343
|
- - ">="
|
347
344
|
- !ruby/object:Gem::Version
|
345
|
+
hash: 3
|
346
|
+
segments:
|
347
|
+
- 0
|
348
348
|
version: "0"
|
349
|
-
version:
|
350
349
|
requirements: []
|
351
350
|
|
352
351
|
rubyforge_project:
|
353
|
-
rubygems_version: 1.
|
352
|
+
rubygems_version: 1.5.2
|
354
353
|
signing_key:
|
355
354
|
specification_version: 3
|
356
355
|
summary: Mizuho documentation formatting tool
|
data/asciidoc/a2x
DELETED
@@ -1,674 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
#
|
3
|
-
# a2x - convert Asciidoc text file to PDF, XHTML, HTML Help, manpage
|
4
|
-
# or plain text
|
5
|
-
#
|
6
|
-
# Copyright (C) 2007 Stuart Rackham. Free use of this software is granted
|
7
|
-
# under the terms of the GNU General Public License (GPL).
|
8
|
-
#
|
9
|
-
|
10
|
-
VERSION=1.0.0
|
11
|
-
BASENAME=$(basename "$0")
|
12
|
-
REALNAME="$0"
|
13
|
-
if [ ! -e "$REALNAME" ]; then
|
14
|
-
REALNAME=$(which "$REALNAME")
|
15
|
-
fi
|
16
|
-
REALNAME="$(readlink -f "$REALNAME")"
|
17
|
-
CONF_DIR=/etc/asciidoc
|
18
|
-
FOP_COMMAND="fop.sh" # FOP executable.
|
19
|
-
|
20
|
-
#--------------------------------------------------------------------
|
21
|
-
# Constants.
|
22
|
-
#--------------------------------------------------------------------
|
23
|
-
|
24
|
-
# These are mostly related to command options and are set by parse_options().
|
25
|
-
ASCIIDOC_OPTS=
|
26
|
-
COPY=no
|
27
|
-
DESTINATION_DIR=
|
28
|
-
DOCTYPE=
|
29
|
-
DRY_RUN=no
|
30
|
-
FORMAT=xhtml
|
31
|
-
ICONS=no
|
32
|
-
ICONS_DIR=./images/icons
|
33
|
-
SKIP_ASCIIDOC=no
|
34
|
-
SRC_DIR=
|
35
|
-
SRC_FILE=
|
36
|
-
SRC_NAME= # Source file name sans path and file name extension.
|
37
|
-
STYLESHEET=./docbook-xsl.css
|
38
|
-
VERBOSE_2=no
|
39
|
-
VERBOSE=no
|
40
|
-
XSLTPROC_OPTS=
|
41
|
-
DBLATEX_OPTS=
|
42
|
-
FOP_OPTS=
|
43
|
-
FOP=no
|
44
|
-
XMLLINT=yes
|
45
|
-
|
46
|
-
#--------------------------------------------------------------------
|
47
|
-
# General purpose functions
|
48
|
-
#--------------------------------------------------------------------
|
49
|
-
|
50
|
-
# Write $1 to stderr with backslash-escaped characters and no trailing newline.
|
51
|
-
function write_console()
|
52
|
-
{
|
53
|
-
echo -ne "$1" >&2
|
54
|
-
}
|
55
|
-
|
56
|
-
# Write newline to stderr.
|
57
|
-
function newline()
|
58
|
-
{
|
59
|
-
echo >&2
|
60
|
-
}
|
61
|
-
|
62
|
-
# Write $1 message to stderr.
|
63
|
-
function console_msg()
|
64
|
-
{
|
65
|
-
echo "$BASENAME: $1" >&2
|
66
|
-
}
|
67
|
-
|
68
|
-
# Write $1 to stderr if verbose or dry-run options set.
|
69
|
-
function verbose_msg()
|
70
|
-
{
|
71
|
-
if isyes "$VERBOSE" || isyes "$DRY_RUN"; then
|
72
|
-
console_msg "$1"
|
73
|
-
fi
|
74
|
-
}
|
75
|
-
|
76
|
-
# Return 0 if $1 is interpreted as an affirmative string.
|
77
|
-
function isyes()
|
78
|
-
{
|
79
|
-
case "$1" in
|
80
|
-
y|Y|yes|YES|Yes|true|TRUE|True) return 0;;
|
81
|
-
esac
|
82
|
-
return 1
|
83
|
-
}
|
84
|
-
|
85
|
-
# Log message $1 and exit with status $2 (default 1).
|
86
|
-
function quit()
|
87
|
-
{
|
88
|
-
local err tmp
|
89
|
-
err=${2:-1}
|
90
|
-
if [ $err -ne 0 ]; then
|
91
|
-
tmp="$VERBOSE"
|
92
|
-
VERBOSE=yes # Force console error exit message.
|
93
|
-
console_msg "failed: $1"
|
94
|
-
VERBOSE="$tmp"
|
95
|
-
else
|
96
|
-
console_msg "$1"
|
97
|
-
fi
|
98
|
-
cleanup
|
99
|
-
exit $err
|
100
|
-
}
|
101
|
-
|
102
|
-
# Execute the $1 command in the current shell subject to VERBOSE, DRY_RUN shell
|
103
|
-
# variables.
|
104
|
-
function execute_command()
|
105
|
-
{
|
106
|
-
if isyes "$VERBOSE" || isyes "$DRY_RUN"; then
|
107
|
-
console_msg "eval: $1"
|
108
|
-
fi
|
109
|
-
if isyes "$DRY_RUN"; then
|
110
|
-
return 0
|
111
|
-
else
|
112
|
-
eval $1
|
113
|
-
return $?
|
114
|
-
fi
|
115
|
-
}
|
116
|
-
|
117
|
-
# Same as execute_command() but if error occurs prints optional $2 message and
|
118
|
-
# exits program.
|
119
|
-
function execute_command_2()
|
120
|
-
{
|
121
|
-
local msg
|
122
|
-
execute_command "$1"
|
123
|
-
if [ $? -ne 0 ]; then
|
124
|
-
if [ -n "$2" ]; then
|
125
|
-
msg="$2"
|
126
|
-
else
|
127
|
-
msg="$1"
|
128
|
-
fi
|
129
|
-
quit "$msg"
|
130
|
-
fi
|
131
|
-
}
|
132
|
-
|
133
|
-
# Return 0 if $1 command can be executed.
|
134
|
-
function is_executable()
|
135
|
-
{
|
136
|
-
if which "$1" >/dev/null 2>&1; then
|
137
|
-
return 0
|
138
|
-
else
|
139
|
-
return 1
|
140
|
-
fi
|
141
|
-
}
|
142
|
-
|
143
|
-
# Return 127 if $1 is not in search path else return 0.
|
144
|
-
function require()
|
145
|
-
{
|
146
|
-
if ! is_executable "$1"; then
|
147
|
-
quit "cannot find required program: $1" 127
|
148
|
-
fi
|
149
|
-
}
|
150
|
-
|
151
|
-
# Join path $1 to path $2.
|
152
|
-
function join()
|
153
|
-
{
|
154
|
-
if [ -n "$1" ]; then
|
155
|
-
echo "$1/$2"
|
156
|
-
else
|
157
|
-
echo "$2"
|
158
|
-
fi
|
159
|
-
}
|
160
|
-
|
161
|
-
# Echo the total size in bytes of file name arguments.
|
162
|
-
function file_size()
|
163
|
-
{
|
164
|
-
echo $(du -cb "$@" | tail -1 | awk '{print $1}')
|
165
|
-
}
|
166
|
-
|
167
|
-
#--------------------------------------------------------------------
|
168
|
-
# Application specific functions
|
169
|
-
#--------------------------------------------------------------------
|
170
|
-
|
171
|
-
# Trap interrupts.
|
172
|
-
function set_trap()
|
173
|
-
{
|
174
|
-
# By convention exit code is 128 + signal number.
|
175
|
-
trap "newline; quit 'exiting: SIGINT' 130" SIGINT
|
176
|
-
trap "newline; quit 'exiting: SIGQUIT' 131" SIGQUIT
|
177
|
-
trap "quit 'exiting: SIGHUP' 129" SIGHUP
|
178
|
-
trap "quit 'exiting: SIGTERM' 143" SIGTERM
|
179
|
-
}
|
180
|
-
|
181
|
-
# Called at program exit.
|
182
|
-
function cleanup()
|
183
|
-
{
|
184
|
-
if [ "$(pwd)" != "$PWD" ]; then
|
185
|
-
execute_command "cd \"$PWD\""
|
186
|
-
fi
|
187
|
-
}
|
188
|
-
|
189
|
-
# Print help summary.
|
190
|
-
function help()
|
191
|
-
{
|
192
|
-
cat <<EOF
|
193
|
-
synopsis:
|
194
|
-
|
195
|
-
$BASENAME [OPTIONS] FILE
|
196
|
-
|
197
|
-
options:
|
198
|
-
-a, --attribute=ATTRIBUTE set asciidoc attribute value
|
199
|
-
--asciidoc-opts=ASCIIDOC_OPTS asciidoc options
|
200
|
-
--copy copy icons or HTML stylesheet
|
201
|
-
-D, --destination-dir=PATH output directory (defaults to FILE directory)
|
202
|
-
-d, --doctype=DOCTYPE article, manpage, book
|
203
|
-
-f, --format=FORMAT chunked,htmlhelp,manpage,pdf,text,xhtml,dvi,ps,tex
|
204
|
-
-h, --help print command syntax summary
|
205
|
-
--icons use admonition, callout and navigation icons
|
206
|
-
--icons-dir=PATH admonition and navigation icon directory
|
207
|
-
-L, --no-xmllint don't check asciidoc output with xmllint(1)
|
208
|
-
-n, --dry-run don't do anything just print the commands
|
209
|
-
-s, --skip-asciidoc skip asciidoc execution
|
210
|
-
--stylesheet=PATH target HTML CSS stylesheet file name
|
211
|
-
--version print program version to stdout
|
212
|
-
-v, --verbose print operational details to stderr
|
213
|
-
--dblatex-opts=DBLATEX_OPTS dblatex options
|
214
|
-
--fop use FOP to generate PDF files
|
215
|
-
--fop-opts=FOP_OPTS options for FOP pdf generation
|
216
|
-
--xsltproc-opts=XSLTPROC_OPTS xsltproc options
|
217
|
-
EOF
|
218
|
-
}
|
219
|
-
|
220
|
-
# Print full path name of file $1 searching first in the directory containing
|
221
|
-
# the asciidoc executable and then in the global configuration directory.
|
222
|
-
function conf_file()
|
223
|
-
{
|
224
|
-
local result dir
|
225
|
-
# First look in same directory as asciidoc executable.
|
226
|
-
dir="$(dirname "$REALNAME")"
|
227
|
-
if [ ! -f "$dir/$1" -a -d $CONF_DIR ]; then
|
228
|
-
dir=$CONF_DIR
|
229
|
-
fi
|
230
|
-
result="$dir/$1"
|
231
|
-
echo $result
|
232
|
-
}
|
233
|
-
|
234
|
-
#--------------------------------------------------------------------
|
235
|
-
# Process command-line arguments $@
|
236
|
-
#--------------------------------------------------------------------
|
237
|
-
function parse_options()
|
238
|
-
{
|
239
|
-
if [ -z "$*" ]; then
|
240
|
-
help; exit 0
|
241
|
-
fi
|
242
|
-
require "getopt"
|
243
|
-
getopt -T >/dev/null
|
244
|
-
if [ $? -ne 4 ]; then
|
245
|
-
quit "enhanced getopt(1) required"
|
246
|
-
fi
|
247
|
-
short_opts="a:d:D:f:hLnsv"
|
248
|
-
long_opts="attribute:,asciidoc-opts:,destination-dir:,doctype:,help,icons-dir:,dry-run,format:,copy,icons,skip-asciidoc,stylesheet:,version,verbose,xsltproc-opts:,dblatex-opts:,fop,fop-opts:,no-xmllint"
|
249
|
-
args=$(getopt -o $short_opts -l $long_opts -n $BASENAME -- "$@" 2>/dev/null)
|
250
|
-
if [ $? -ne 0 ]; then
|
251
|
-
quit "invalid command options, run: a2x --help"
|
252
|
-
fi
|
253
|
-
eval set -- "$args" # Set positional variables.
|
254
|
-
while true ; do
|
255
|
-
case "$1" in
|
256
|
-
-a|--attribute)
|
257
|
-
ASCIIDOC_OPTS="$ASCIIDOC_OPTS -a \"$2\""
|
258
|
-
shift 2 ;;
|
259
|
-
--asciidoc-opts)
|
260
|
-
ASCIIDOC_OPTS="$ASCIIDOC_OPTS $2"
|
261
|
-
shift 2 ;;
|
262
|
-
--copy)
|
263
|
-
COPY=yes;
|
264
|
-
shift ;;
|
265
|
-
-d|--doctype)
|
266
|
-
DOCTYPE=$2
|
267
|
-
shift 2 ;;
|
268
|
-
-D|--destination-dir)
|
269
|
-
DESTINATION_DIR=$2
|
270
|
-
shift 2 ;;
|
271
|
-
-f|--format)
|
272
|
-
FORMAT=$2
|
273
|
-
shift 2 ;;
|
274
|
-
-h|--help)
|
275
|
-
help; exit 0 ;;
|
276
|
-
--icons)
|
277
|
-
ICONS=yes
|
278
|
-
shift ;;
|
279
|
-
--icons-dir)
|
280
|
-
ICONS_DIR=$2
|
281
|
-
shift 2 ;;
|
282
|
-
-n|--dry-run)
|
283
|
-
DRY_RUN=yes;
|
284
|
-
shift ;;
|
285
|
-
-s|--skip-asciidoc)
|
286
|
-
SKIP_ASCIIDOC=yes;
|
287
|
-
shift ;;
|
288
|
-
--stylesheet)
|
289
|
-
STYLESHEET=$2
|
290
|
-
shift 2 ;;
|
291
|
-
--version)
|
292
|
-
echo "$BASENAME $VERSION" ; exit 0 ;;
|
293
|
-
-v|--verbose)
|
294
|
-
if isyes "$VERBOSE"; then
|
295
|
-
VERBOSE_2=yes
|
296
|
-
else
|
297
|
-
VERBOSE=yes
|
298
|
-
fi
|
299
|
-
shift ;;
|
300
|
-
-L|--no-xmllint)
|
301
|
-
XMLLINT=no;
|
302
|
-
shift ;;
|
303
|
-
--xsltproc-opts)
|
304
|
-
XSLTPROC_OPTS="$XSLTPROC_OPTS $2"
|
305
|
-
shift 2 ;;
|
306
|
-
--fop)
|
307
|
-
FOP=yes;
|
308
|
-
shift ;;
|
309
|
-
--fop-opts)
|
310
|
-
FOP_OPTS="$FOP_OPTS $2"
|
311
|
-
FOP=yes
|
312
|
-
shift 2 ;;
|
313
|
-
--dblatex-opts)
|
314
|
-
DBLATEX_OPTS="$DBLATEX_OPTS $2"
|
315
|
-
shift 2 ;;
|
316
|
-
--)
|
317
|
-
shift; break ;;
|
318
|
-
*)
|
319
|
-
quit "unrecognized option: $1" ;;
|
320
|
-
esac
|
321
|
-
done
|
322
|
-
|
323
|
-
if isyes "$DRY_RUN"; then
|
324
|
-
VERBOSE=yes
|
325
|
-
fi
|
326
|
-
|
327
|
-
if [ $# -eq 0 ]; then
|
328
|
-
quit "source file not specified"
|
329
|
-
fi
|
330
|
-
if [ $# -ne 1 ]; then
|
331
|
-
quit "only one source file allowed"
|
332
|
-
fi
|
333
|
-
if [ ! -r "$1" ]; then
|
334
|
-
quit "source file not found: $1"
|
335
|
-
fi
|
336
|
-
SRC_FILE=$1
|
337
|
-
SRC_DIR=$(dirname "$1")
|
338
|
-
SRC_NAME=$1
|
339
|
-
SRC_NAME=${SRC_NAME##*/} # Strip path.
|
340
|
-
SRC_NAME=${SRC_NAME%.*} # Strip extension.
|
341
|
-
# Use FOP if there is no dblatex.
|
342
|
-
if ! is_executable dblatex && is_executable "$FOP_COMMAND"; then
|
343
|
-
FOP=yes
|
344
|
-
fi
|
345
|
-
}
|
346
|
-
|
347
|
-
#--------------------------------------------------------------------
|
348
|
-
# Validate program options.
|
349
|
-
#--------------------------------------------------------------------
|
350
|
-
function validate_options()
|
351
|
-
{
|
352
|
-
case "$FORMAT" in
|
353
|
-
chunked|dvi|htmlhelp|manpage|odt|pdf|ps|tex|text|xhtml) ;;
|
354
|
-
*) quit "illegal format: $FORMAT" ;;
|
355
|
-
esac
|
356
|
-
|
357
|
-
if [ -z "$DOCTYPE" ]; then
|
358
|
-
if [ "$FORMAT" = "manpage" ]; then
|
359
|
-
DOCTYPE=manpage
|
360
|
-
else
|
361
|
-
DOCTYPE=article
|
362
|
-
fi
|
363
|
-
fi
|
364
|
-
case "$DOCTYPE" in
|
365
|
-
article|book|manpage) ;;
|
366
|
-
*) quit "illegal doctype: $DOCTYPE" ;;
|
367
|
-
esac
|
368
|
-
|
369
|
-
if [ -z "$ICONS_DIR" ]; then
|
370
|
-
quit "icons directory not specified"
|
371
|
-
fi
|
372
|
-
if [[ "$ICONS_DIR" == /* ]]; then
|
373
|
-
quit "icons directory must be relative: $ICONS_DIR"
|
374
|
-
fi
|
375
|
-
ICONS_DIR=${ICONS_DIR%*/} # Strip trailing backslash.
|
376
|
-
|
377
|
-
if [ ! -z "$DESTINATION_DIR" ]; then
|
378
|
-
if [ ! -d "$DESTINATION_DIR" ]; then
|
379
|
-
quit "destination directory not found: $DESTINATION_DIR"
|
380
|
-
fi
|
381
|
-
else
|
382
|
-
DESTINATION_DIR="$SRC_DIR"
|
383
|
-
fi
|
384
|
-
|
385
|
-
if [ -z "$STYLESHEET" ]; then
|
386
|
-
quit "stylesheet cannot be blank"
|
387
|
-
fi
|
388
|
-
if [[ "$STYLESHEET" == /* ]]; then
|
389
|
-
quit "stylesheet path must be relative: $STYLESHEET"
|
390
|
-
fi
|
391
|
-
}
|
392
|
-
|
393
|
-
# Conditionally copy distribution stylesheet and admonition and navigation
|
394
|
-
# icons to destination directory $1.
|
395
|
-
function copy_stylesheet_and_icons()
|
396
|
-
{
|
397
|
-
if isyes $COPY; then
|
398
|
-
copy_stylesheet "$1"
|
399
|
-
if isyes $ICONS; then
|
400
|
-
copy_icons "$1/$ICONS_DIR"
|
401
|
-
fi
|
402
|
-
fi
|
403
|
-
}
|
404
|
-
|
405
|
-
# Copy distribution stylesheet to destination directory $1.
|
406
|
-
function copy_stylesheet()
|
407
|
-
{
|
408
|
-
local src dst
|
409
|
-
src=$(conf_file stylesheets/docbook-xsl.css)
|
410
|
-
if [ ! -r "$src" ]; then
|
411
|
-
quit "file not found: $src"
|
412
|
-
fi
|
413
|
-
dst="$1/$STYLESHEET"
|
414
|
-
# Check we're not trying to copy the file onto itself.
|
415
|
-
if [[ "$src" -ef "$dst" ]]; then
|
416
|
-
return
|
417
|
-
fi
|
418
|
-
execute_command_2 "cp -u \"$src\" \"$dst\""
|
419
|
-
}
|
420
|
-
|
421
|
-
# Copy distribution admonition and navigation icons to destination directory
|
422
|
-
# $1.
|
423
|
-
function copy_icons()
|
424
|
-
{
|
425
|
-
local src dst
|
426
|
-
dst="$1"
|
427
|
-
# Set source icons directory.
|
428
|
-
src=$(conf_file images/icons/home.png)
|
429
|
-
if [ ! -r "$src" ]; then
|
430
|
-
quit "file not found: $src"
|
431
|
-
fi
|
432
|
-
src=$(dirname "$src")
|
433
|
-
# Check we're not trying to copy the file onto itself.
|
434
|
-
if [[ "$src" -ef "$dst" ]]; then
|
435
|
-
return
|
436
|
-
fi
|
437
|
-
if [ -e "$dst" ]; then
|
438
|
-
if [ ! -d "$dst" ]; then
|
439
|
-
quit "icon destination must be a directory: $dst"
|
440
|
-
fi
|
441
|
-
else
|
442
|
-
execute_command_2 "mkdir -p \"$dst\""
|
443
|
-
fi
|
444
|
-
execute_command_2 "cp -rfu \"$src/\"* \"$dst\""
|
445
|
-
}
|
446
|
-
|
447
|
-
# Run xmllint(1) checking of $1 file if xmllint checking is enabled.
|
448
|
-
function execute_xmllint()
|
449
|
-
{
|
450
|
-
if isyes "$XMLLINT"; then
|
451
|
-
if ! is_executable "xmllint"; then
|
452
|
-
console_msg "xmllint not found: skipping validity checking"
|
453
|
-
else
|
454
|
-
execute_command_2 "xmllint --nonet --noout --valid \"$1\""
|
455
|
-
fi
|
456
|
-
fi
|
457
|
-
}
|
458
|
-
|
459
|
-
#--------------------------------------------------------------------
|
460
|
-
# Format conversion functions.
|
461
|
-
#--------------------------------------------------------------------
|
462
|
-
|
463
|
-
# Convert AsciiDoc $SRC_FILE to DocBook XML if it is newer than the
|
464
|
-
# XML output file. $1 has additional asciidoc(1) options.
|
465
|
-
function to_docbook()
|
466
|
-
{
|
467
|
-
local xml
|
468
|
-
xml="$SRC_DIR/$SRC_NAME.xml"
|
469
|
-
if isyes $SKIP_ASCIIDOC; then
|
470
|
-
if [ ! -r "$xml" ]; then
|
471
|
-
quit "file not found: $xml"
|
472
|
-
fi
|
473
|
-
return
|
474
|
-
fi
|
475
|
-
require "asciidoc"
|
476
|
-
execute_command_2 "asciidoc $ASCIIDOC_OPTS $1 -b docbook \"$SRC_FILE\""
|
477
|
-
execute_xmllint "$xml"
|
478
|
-
}
|
479
|
-
|
480
|
-
function to_xhtml()
|
481
|
-
{
|
482
|
-
require "xsltproc"
|
483
|
-
local xsl xml html
|
484
|
-
xsl=$(conf_file docbook-xsl/xhtml.xsl)
|
485
|
-
if [ ! -r "$xsl" ]; then
|
486
|
-
quit "file not found: $xsl"
|
487
|
-
fi
|
488
|
-
to_docbook
|
489
|
-
xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
|
490
|
-
html="$SRC_NAME.html"
|
491
|
-
copy_stylesheet_and_icons "$DESTINATION_DIR"
|
492
|
-
execute_command_2 "cd \"$DESTINATION_DIR\""
|
493
|
-
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
|
494
|
-
\"$xsl\" \"$xml\" >\"$html\""
|
495
|
-
execute_command_2 "cd - >/dev/null"
|
496
|
-
}
|
497
|
-
|
498
|
-
function to_chunked()
|
499
|
-
{
|
500
|
-
require "xsltproc"
|
501
|
-
local chunkdir xsl xml hhp chm
|
502
|
-
case "$FORMAT" in
|
503
|
-
chunked)
|
504
|
-
chunkdir="$DESTINATION_DIR/$SRC_NAME.chunked"
|
505
|
-
xsl=chunked.xsl
|
506
|
-
;;
|
507
|
-
htmlhelp)
|
508
|
-
chunkdir="$DESTINATION_DIR/$SRC_NAME.htmlhelp"
|
509
|
-
hhp="$SRC_NAME.hhp"
|
510
|
-
chm="$SRC_NAME.chm"
|
511
|
-
XSLTPROC_OPTS="$XSLTPROC_OPTS \
|
512
|
-
--stringparam htmlhelp.hhp \"$hhp\"
|
513
|
-
--stringparam htmlhelp.chm \"$chm\""
|
514
|
-
xsl=htmlhelp.xsl
|
515
|
-
;;
|
516
|
-
esac
|
517
|
-
xsl=$(conf_file docbook-xsl/$xsl)
|
518
|
-
if [ ! -r "$xsl" ]; then
|
519
|
-
quit "file not found: $xsl"
|
520
|
-
fi
|
521
|
-
to_docbook
|
522
|
-
xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
|
523
|
-
if [ ! -d "$chunkdir" ]; then
|
524
|
-
execute_command_2 "mkdir \"$chunkdir\""
|
525
|
-
fi
|
526
|
-
execute_command_2 "rm -f \"$chunkdir/*.html\""
|
527
|
-
copy_stylesheet_and_icons "$chunkdir"
|
528
|
-
execute_command_2 "cd \"$DESTINATION_DIR\""
|
529
|
-
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
|
530
|
-
--stringparam base.dir \"$(basename "$chunkdir")/\" \
|
531
|
-
\"$xsl\" \"$xml\""
|
532
|
-
execute_command_2 "cd - >/dev/null"
|
533
|
-
}
|
534
|
-
|
535
|
-
function to_manpage()
|
536
|
-
{
|
537
|
-
require "xsltproc"
|
538
|
-
local xsl xml
|
539
|
-
xsl=$(conf_file docbook-xsl/manpage.xsl)
|
540
|
-
if [ ! -r "$xsl" ]; then
|
541
|
-
quit "file not found: $xsl"
|
542
|
-
fi
|
543
|
-
to_docbook "-d manpage"
|
544
|
-
xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
|
545
|
-
execute_command_2 "cd \"$DESTINATION_DIR\""
|
546
|
-
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
|
547
|
-
\"$xsl\" \"$xml\""
|
548
|
-
execute_command_2 "cd - >/dev/null"
|
549
|
-
}
|
550
|
-
|
551
|
-
function run_dblatex()
|
552
|
-
{
|
553
|
-
require "dblatex"
|
554
|
-
local xsl xml sty
|
555
|
-
to_docbook
|
556
|
-
xml="$SRC_DIR/$SRC_NAME.xml"
|
557
|
-
xsl=$(conf_file dblatex/asciidoc-dblatex.xsl)
|
558
|
-
sty=$(conf_file dblatex/asciidoc-dblatex.sty)
|
559
|
-
execute_command_2 "dblatex -t $FORMAT -p \"$xsl\" -s \"$sty\" $DBLATEX_OPTS \"$xml\""
|
560
|
-
}
|
561
|
-
|
562
|
-
function run_fop()
|
563
|
-
{
|
564
|
-
local xsl xml fo pdf
|
565
|
-
xml="$SRC_DIR/$SRC_NAME.xml"
|
566
|
-
pdf="$DESTINATION_DIR/$SRC_NAME.pdf"
|
567
|
-
require "xsltproc"
|
568
|
-
require "$FOP_COMMAND"
|
569
|
-
xsl=$(conf_file docbook-xsl/fo.xsl)
|
570
|
-
if [ ! -r "$xsl" ]; then
|
571
|
-
quit "file not found: $xsl"
|
572
|
-
fi
|
573
|
-
fo="$SRC_DIR/$SRC_NAME.fo"
|
574
|
-
to_docbook
|
575
|
-
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
|
576
|
-
\"$xsl\" \"$xml\" >\"$fo\""
|
577
|
-
execute_command_2 "\"$FOP_COMMAND\" $FOP_OPTS -fo \"$fo\" -pdf \"$pdf\""
|
578
|
-
}
|
579
|
-
|
580
|
-
function to_pdf()
|
581
|
-
{
|
582
|
-
if isyes $FOP; then
|
583
|
-
run_fop
|
584
|
-
else
|
585
|
-
run_dblatex
|
586
|
-
fi
|
587
|
-
}
|
588
|
-
|
589
|
-
function to_odt()
|
590
|
-
{
|
591
|
-
require "docbook2odf"
|
592
|
-
local xml odt opts
|
593
|
-
xml="$SRC_DIR/$SRC_NAME.xml"
|
594
|
-
odt="$DESTINATION_DIR/$SRC_NAME.odt"
|
595
|
-
opts="--force"
|
596
|
-
if ! isyes $VERBOSE; then
|
597
|
-
opts="$opts --quiet"
|
598
|
-
fi
|
599
|
-
to_docbook
|
600
|
-
execute_command_2 "docbook2odf $opts \"$xml\" --output-file \"$odt\""
|
601
|
-
}
|
602
|
-
|
603
|
-
function to_text()
|
604
|
-
{
|
605
|
-
require "asciidoc"
|
606
|
-
local html text conf xsl
|
607
|
-
html="$SRC_DIR/$SRC_NAME.html"
|
608
|
-
text="$DESTINATION_DIR/$SRC_NAME.text"
|
609
|
-
conf=$(conf_file text.conf)
|
610
|
-
# Use lynx if there is no w3m.
|
611
|
-
if ! is_executable w3m && is_executable lynx; then
|
612
|
-
execute_command_2 "asciidoc $ASCIIDOC_OPTS -f "$conf" -b html4 \
|
613
|
-
-o - \"$SRC_FILE\" | lynx -dump -stdin >\"$text\""
|
614
|
-
else
|
615
|
-
require "w3m"
|
616
|
-
require "xsltproc"
|
617
|
-
xsl=$(conf_file docbook-xsl/text.xsl)
|
618
|
-
execute_command_2 "asciidoc $ASCIIDOC_OPTS -f \"$conf\" -b docbook \
|
619
|
-
-o - \"$SRC_FILE\" \
|
620
|
-
| xsltproc --nonet --xinclude \"$xsl\" - \
|
621
|
-
| w3m -cols 70 -dump -T text/html -no-graph >\"$text\""
|
622
|
-
|
623
|
-
fi
|
624
|
-
}
|
625
|
-
|
626
|
-
#--------------------------------------------------------------------
|
627
|
-
# Main
|
628
|
-
#--------------------------------------------------------------------
|
629
|
-
|
630
|
-
PWD=`pwd`
|
631
|
-
set_trap
|
632
|
-
parse_options "$@"
|
633
|
-
validate_options
|
634
|
-
ASCIIDOC_OPTS="--doctype=$DOCTYPE $ASCIIDOC_OPTS"
|
635
|
-
if isyes $VERBOSE_2; then
|
636
|
-
ASCIIDOC_OPTS="$ASCIIDOC_OPTS --verbose"
|
637
|
-
XSLTPROC_OPTS="$XSLTPROC_OPTS --verbose"
|
638
|
-
fi
|
639
|
-
case "$FORMAT" in
|
640
|
-
xhtml|chunked|htmlhelp)
|
641
|
-
XSLTPROC_OPTS="$XSLTPROC_OPTS \
|
642
|
-
--stringparam html.stylesheet \"$STYLESHEET\""
|
643
|
-
;;
|
644
|
-
esac
|
645
|
-
if isyes $ICONS; then
|
646
|
-
XSLTPROC_OPTS="$XSLTPROC_OPTS --stringparam callout.graphics 1 \
|
647
|
-
--stringparam navig.graphics 0 \
|
648
|
-
--stringparam admon.textlabel 0 \
|
649
|
-
--stringparam admon.graphics 1 \
|
650
|
-
--stringparam admon.graphics.path \"$ICONS_DIR/\" \
|
651
|
-
--stringparam callout.graphics.path \"$ICONS_DIR/callouts/\" \
|
652
|
-
--stringparam navig.graphics.path \"$ICONS_DIR/\""
|
653
|
-
else
|
654
|
-
XSLTPROC_OPTS="$XSLTPROC_OPTS --stringparam callout.graphics 0 \
|
655
|
-
--stringparam navig.graphics 0 \
|
656
|
-
--stringparam admon.textlabel 1 \
|
657
|
-
--stringparam admon.graphics 0"
|
658
|
-
fi
|
659
|
-
case "$FORMAT" in
|
660
|
-
chunked|htmlhelp) to_chunked;;
|
661
|
-
manpage) to_manpage;;
|
662
|
-
odt) to_odt;;
|
663
|
-
pdf) to_pdf;;
|
664
|
-
text) to_text;;
|
665
|
-
xhtml) to_xhtml;;
|
666
|
-
dvi) run_dblatex;;
|
667
|
-
ps) run_dblatex;;
|
668
|
-
tex) run_dblatex;;
|
669
|
-
esac
|
670
|
-
cleanup
|
671
|
-
|
672
|
-
#--------------------------------------------------------------------
|
673
|
-
# vim: set et ts=4 sw=4 sts=4:
|
674
|
-
#--------------------------------------------------------------------
|