mizuho 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +20 -0
- data/README.markdown +61 -0
- data/Rakefile +41 -0
- data/asciidoc/BUGS +39 -0
- data/asciidoc/BUGS.txt +32 -0
- data/asciidoc/CHANGELOG +1796 -0
- data/asciidoc/CHANGELOG.txt +1810 -0
- data/asciidoc/COPYING +339 -0
- data/asciidoc/COPYRIGHT +18 -0
- data/asciidoc/INSTALL +76 -0
- data/asciidoc/INSTALL.txt +71 -0
- data/asciidoc/Makefile.in +161 -0
- data/asciidoc/README +46 -0
- data/asciidoc/README.txt +36 -0
- data/asciidoc/a2x +674 -0
- data/asciidoc/asciidoc.conf +455 -0
- data/asciidoc/asciidoc.py +4998 -0
- data/asciidoc/common.aap +9 -0
- data/asciidoc/configure +2840 -0
- data/asciidoc/configure.ac +11 -0
- data/asciidoc/dblatex/asciidoc-dblatex.sty +20 -0
- data/asciidoc/dblatex/asciidoc-dblatex.xsl +32 -0
- data/asciidoc/dblatex/dblatex-readme.txt +39 -0
- data/asciidoc/doc/a2x.1 +257 -0
- data/asciidoc/doc/a2x.1.txt +204 -0
- data/asciidoc/doc/article.css-embedded.html +602 -0
- data/asciidoc/doc/article.html +46 -0
- data/asciidoc/doc/article.pdf +0 -0
- data/asciidoc/doc/article.txt +122 -0
- data/asciidoc/doc/asciidoc-revhistory.xml +27 -0
- data/asciidoc/doc/asciidoc.1 +155 -0
- data/asciidoc/doc/asciidoc.1.css-embedded.html +598 -0
- data/asciidoc/doc/asciidoc.1.css.html +212 -0
- data/asciidoc/doc/asciidoc.1.html +190 -0
- data/asciidoc/doc/asciidoc.1.txt +118 -0
- data/asciidoc/doc/asciidoc.conf +8 -0
- data/asciidoc/doc/asciidoc.css-embedded.html +7853 -0
- data/asciidoc/doc/asciidoc.css.html +7416 -0
- data/asciidoc/doc/asciidoc.dict +733 -0
- data/asciidoc/doc/asciidoc.html +3339 -0
- data/asciidoc/doc/asciidoc.txt +4979 -0
- data/asciidoc/doc/asciimathml.txt +64 -0
- data/asciidoc/doc/book-multi.css-embedded.html +575 -0
- data/asciidoc/doc/book-multi.html +55 -0
- data/asciidoc/doc/book-multi.txt +155 -0
- data/asciidoc/doc/book.css-embedded.html +607 -0
- data/asciidoc/doc/book.html +43 -0
- data/asciidoc/doc/book.txt +131 -0
- data/asciidoc/doc/customers.csv +18 -0
- data/asciidoc/doc/docbook-xsl.css +272 -0
- data/asciidoc/doc/faq.txt +547 -0
- data/asciidoc/doc/latex-backend.html +117 -0
- data/asciidoc/doc/latex-backend.txt +191 -0
- data/asciidoc/doc/latexmath.txt +244 -0
- data/asciidoc/doc/latexmathml.txt +41 -0
- data/asciidoc/doc/main.aap +297 -0
- data/asciidoc/doc/music-filter.html +566 -0
- data/asciidoc/doc/music-filter.pdf +0 -0
- data/asciidoc/doc/music-filter.txt +158 -0
- data/asciidoc/doc/source-highlight-filter.html +214 -0
- data/asciidoc/doc/source-highlight-filter.pdf +0 -0
- data/asciidoc/doc/source-highlight-filter.txt +203 -0
- data/asciidoc/docbook-xsl/asciidoc-docbook-xsl.txt +43 -0
- data/asciidoc/docbook-xsl/chunked.xsl +19 -0
- data/asciidoc/docbook-xsl/common.xsl +67 -0
- data/asciidoc/docbook-xsl/fo.xsl +149 -0
- data/asciidoc/docbook-xsl/htmlhelp.xsl +17 -0
- data/asciidoc/docbook-xsl/manpage.xsl +31 -0
- data/asciidoc/docbook-xsl/text.xsl +50 -0
- data/asciidoc/docbook-xsl/xhtml.xsl +14 -0
- data/asciidoc/docbook.conf +721 -0
- data/asciidoc/examples/website/ASCIIMathML.js +938 -0
- data/asciidoc/examples/website/CHANGELOG.html +4389 -0
- data/asciidoc/examples/website/CHANGELOG.txt +1810 -0
- data/asciidoc/examples/website/INSTALL.html +161 -0
- data/asciidoc/examples/website/INSTALL.txt +71 -0
- data/asciidoc/examples/website/LaTeXMathML.js +1223 -0
- data/asciidoc/examples/website/README-website.html +118 -0
- data/asciidoc/examples/website/README-website.txt +29 -0
- data/asciidoc/examples/website/README.html +125 -0
- data/asciidoc/examples/website/README.txt +36 -0
- data/asciidoc/examples/website/a2x.1.html +419 -0
- data/asciidoc/examples/website/a2x.1.txt +204 -0
- data/asciidoc/examples/website/asciidoc-docbook-xsl.html +130 -0
- data/asciidoc/examples/website/asciidoc-docbook-xsl.txt +43 -0
- data/asciidoc/examples/website/asciidoc-graphviz-sample.txt +130 -0
- data/asciidoc/examples/website/asciimathml.txt +64 -0
- data/asciidoc/examples/website/build-website.sh +25 -0
- data/asciidoc/examples/website/customers.csv +18 -0
- data/asciidoc/examples/website/downloads.html +257 -0
- data/asciidoc/examples/website/downloads.txt +121 -0
- data/asciidoc/examples/website/faq.html +673 -0
- data/asciidoc/examples/website/faq.txt +547 -0
- data/asciidoc/examples/website/index.html +419 -0
- data/asciidoc/examples/website/index.txt +245 -0
- data/asciidoc/examples/website/latex-backend.html +535 -0
- data/asciidoc/examples/website/latex-backend.txt +191 -0
- data/asciidoc/examples/website/latexmathml.txt +41 -0
- data/asciidoc/examples/website/layout1.conf +161 -0
- data/asciidoc/examples/website/layout1.css +65 -0
- data/asciidoc/examples/website/layout2.conf +158 -0
- data/asciidoc/examples/website/layout2.css +93 -0
- data/asciidoc/examples/website/manpage.html +266 -0
- data/asciidoc/examples/website/manpage.txt +118 -0
- data/asciidoc/examples/website/music-filter.html +242 -0
- data/asciidoc/examples/website/music-filter.txt +158 -0
- data/asciidoc/examples/website/music1.abc +12 -0
- data/asciidoc/examples/website/music1.png +0 -0
- data/asciidoc/examples/website/music2.ly +9 -0
- data/asciidoc/examples/website/music2.png +0 -0
- data/asciidoc/examples/website/newlists.txt +40 -0
- data/asciidoc/examples/website/newtables.txt +397 -0
- 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 +286 -0
- data/asciidoc/examples/website/source-highlight-filter.txt +203 -0
- data/asciidoc/examples/website/support.html +78 -0
- data/asciidoc/examples/website/support.txt +5 -0
- data/asciidoc/examples/website/toc.js +69 -0
- data/asciidoc/examples/website/userguide.html +7460 -0
- data/asciidoc/examples/website/userguide.txt +4979 -0
- data/asciidoc/examples/website/version83.txt +37 -0
- data/asciidoc/examples/website/version9.html +143 -0
- data/asciidoc/examples/website/version9.txt +48 -0
- data/asciidoc/examples/website/xhtml11-manpage.css +18 -0
- data/asciidoc/examples/website/xhtml11-quirks.css +41 -0
- data/asciidoc/examples/website/xhtml11.css +328 -0
- data/asciidoc/filters/code/code-filter-readme.txt +37 -0
- data/asciidoc/filters/code/code-filter-test.txt +15 -0
- data/asciidoc/filters/code/code-filter.conf +8 -0
- data/asciidoc/filters/code/code-filter.py +239 -0
- data/asciidoc/filters/graphviz/asciidoc-graphviz-sample.txt +130 -0
- data/asciidoc/filters/graphviz/graphviz-filter.conf +39 -0
- data/asciidoc/filters/graphviz/graphviz2png.py +154 -0
- data/asciidoc/filters/music/music-filter-test.txt +40 -0
- data/asciidoc/filters/music/music-filter.conf +40 -0
- data/asciidoc/filters/music/music2png.py +189 -0
- data/asciidoc/filters/source/source-highlight-filter-test.txt +19 -0
- data/asciidoc/filters/source/source-highlight-filter.conf +108 -0
- data/asciidoc/help.conf +213 -0
- data/asciidoc/html4.conf +460 -0
- data/asciidoc/images/highlighter.png +0 -0
- data/asciidoc/images/icons/README +5 -0
- data/asciidoc/images/icons/callouts/1.png +0 -0
- data/asciidoc/images/icons/callouts/10.png +0 -0
- data/asciidoc/images/icons/callouts/11.png +0 -0
- data/asciidoc/images/icons/callouts/12.png +0 -0
- data/asciidoc/images/icons/callouts/13.png +0 -0
- data/asciidoc/images/icons/callouts/14.png +0 -0
- data/asciidoc/images/icons/callouts/15.png +0 -0
- data/asciidoc/images/icons/callouts/2.png +0 -0
- data/asciidoc/images/icons/callouts/3.png +0 -0
- data/asciidoc/images/icons/callouts/4.png +0 -0
- data/asciidoc/images/icons/callouts/5.png +0 -0
- data/asciidoc/images/icons/callouts/6.png +0 -0
- data/asciidoc/images/icons/callouts/7.png +0 -0
- data/asciidoc/images/icons/callouts/8.png +0 -0
- data/asciidoc/images/icons/callouts/9.png +0 -0
- data/asciidoc/images/icons/caution.png +0 -0
- data/asciidoc/images/icons/example.png +0 -0
- data/asciidoc/images/icons/home.png +0 -0
- data/asciidoc/images/icons/important.png +0 -0
- data/asciidoc/images/icons/next.png +0 -0
- data/asciidoc/images/icons/note.png +0 -0
- data/asciidoc/images/icons/prev.png +0 -0
- data/asciidoc/images/icons/tip.png +0 -0
- data/asciidoc/images/icons/up.png +0 -0
- data/asciidoc/images/icons/warning.png +0 -0
- data/asciidoc/images/smallnew.png +0 -0
- data/asciidoc/images/tiger.png +0 -0
- data/asciidoc/install-sh +201 -0
- data/asciidoc/javascripts/ASCIIMathML.js +938 -0
- data/asciidoc/javascripts/LaTeXMathML.js +1223 -0
- data/asciidoc/javascripts/toc.js +69 -0
- data/asciidoc/lang-es.conf +15 -0
- data/asciidoc/latex.conf +663 -0
- data/asciidoc/stylesheets/docbook-xsl.css +272 -0
- data/asciidoc/stylesheets/xhtml11-manpage.css +18 -0
- data/asciidoc/stylesheets/xhtml11-quirks.css +41 -0
- data/asciidoc/stylesheets/xhtml11.css +328 -0
- data/asciidoc/text.conf +16 -0
- data/asciidoc/vim/ftdetect/asciidoc_filetype.vim +53 -0
- data/asciidoc/vim/syntax/asciidoc.vim +165 -0
- data/asciidoc/wordpress.conf +48 -0
- data/asciidoc/xhtml11-quirks.conf +57 -0
- data/asciidoc/xhtml11.conf +645 -0
- data/bin/mizuho +47 -0
- data/bin/mizuho-asciidoc +4 -0
- data/lib/mizuho.rb +10 -0
- data/lib/mizuho/chapter.rb +54 -0
- data/lib/mizuho/generator.rb +134 -0
- data/lib/mizuho/heading.rb +46 -0
- data/lib/mizuho/parser.rb +103 -0
- data/lib/mizuho/source_highlight.rb +2 -0
- data/lib/mizuho/template.rb +50 -0
- data/source-highlight/ada.lang +38 -0
- data/source-highlight/bib.lang +6 -0
- data/source-highlight/bison.lang +3 -0
- data/source-highlight/c.lang +41 -0
- data/source-highlight/c_comment.lang +27 -0
- data/source-highlight/c_string.lang +9 -0
- data/source-highlight/caml.lang +16 -0
- data/source-highlight/changelog.lang +8 -0
- data/source-highlight/clike_vardeclaration.lang +4 -0
- data/source-highlight/cpp.lang +15 -0
- data/source-highlight/csharp.lang +36 -0
- data/source-highlight/css.lang +14 -0
- data/source-highlight/css_common.outlang +26 -0
- data/source-highlight/darwin/source-highlight +0 -0
- data/source-highlight/default.css +51 -0
- data/source-highlight/default.lang +8 -0
- data/source-highlight/default.style +57 -0
- data/source-highlight/desktop.lang +7 -0
- data/source-highlight/diff.lang +32 -0
- data/source-highlight/docbook.outlang +36 -0
- data/source-highlight/esc.outlang +46 -0
- data/source-highlight/esc.style +35 -0
- data/source-highlight/extreme_comment.lang +5 -0
- data/source-highlight/extreme_comment2.lang +5 -0
- data/source-highlight/extreme_comment3.lang +15 -0
- data/source-highlight/fixed-fortran.lang +5 -0
- data/source-highlight/flex.lang +37 -0
- data/source-highlight/fortran.lang +57 -0
- data/source-highlight/function.lang +2 -0
- data/source-highlight/glsl.lang +86 -0
- data/source-highlight/haxe.lang +7 -0
- data/source-highlight/html.lang +7 -0
- data/source-highlight/html.outlang +25 -0
- data/source-highlight/html_common.outlang +35 -0
- data/source-highlight/html_notfixed.outlang +22 -0
- data/source-highlight/html_ref.outlang +6 -0
- data/source-highlight/htmlcss.outlang +28 -0
- data/source-highlight/htmltable.outlang +14 -0
- data/source-highlight/htmltablelinenum.outlang +26 -0
- data/source-highlight/java.lang +26 -0
- data/source-highlight/javadoc.outlang +24 -0
- data/source-highlight/javascript.lang +27 -0
- data/source-highlight/key_string.lang +4 -0
- data/source-highlight/lang.map +108 -0
- data/source-highlight/langdef.lang +21 -0
- data/source-highlight/latex.lang +52 -0
- data/source-highlight/latex.outlang +59 -0
- data/source-highlight/latexcolor.outlang +44 -0
- data/source-highlight/ldap.lang +10 -0
- data/source-highlight/log.lang +53 -0
- data/source-highlight/logtalk.lang +85 -0
- data/source-highlight/lsm.lang +7 -0
- data/source-highlight/lua.lang +27 -0
- data/source-highlight/m4.lang +27 -0
- data/source-highlight/makefile.lang +42 -0
- data/source-highlight/nohilite.lang +2 -0
- data/source-highlight/number.lang +3 -0
- data/source-highlight/outlang.lang +16 -0
- data/source-highlight/outlang.map +12 -0
- data/source-highlight/pascal.lang +20 -0
- data/source-highlight/perl.lang +134 -0
- data/source-highlight/php.lang +25 -0
- data/source-highlight/postscript.lang +42 -0
- data/source-highlight/prolog.lang +37 -0
- data/source-highlight/properties.lang +7 -0
- data/source-highlight/python.lang +26 -0
- data/source-highlight/ruby.lang +32 -0
- data/source-highlight/scala.lang +31 -0
- data/source-highlight/script_comment.lang +3 -0
- data/source-highlight/sh.lang +38 -0
- data/source-highlight/slang.lang +25 -0
- data/source-highlight/sml.lang +5 -0
- data/source-highlight/source-highlight +24 -0
- data/source-highlight/spec.lang +12 -0
- data/source-highlight/sql.lang +46 -0
- data/source-highlight/style.defaults +15 -0
- data/source-highlight/style.lang +16 -0
- data/source-highlight/style2.style +10 -0
- data/source-highlight/style3.style +10 -0
- data/source-highlight/symbols.lang +2 -0
- data/source-highlight/tcl.lang +35 -0
- data/source-highlight/texinfo.outlang +34 -0
- data/source-highlight/texinfo.style +20 -0
- data/source-highlight/url.lang +3 -0
- data/source-highlight/xhtml.outlang +25 -0
- data/source-highlight/xhtml_common.outlang +8 -0
- data/source-highlight/xhtml_notfixed.outlang +16 -0
- data/source-highlight/xhtmlcss.outlang +19 -0
- data/source-highlight/xhtmltable.outlang +7 -0
- data/source-highlight/xml.lang +17 -0
- data/source-highlight/xorg.lang +10 -0
- data/templates/asciidoc.css +358 -0
- data/templates/asciidoc.html.erb +86 -0
- data/templates/manualsonrails.css +165 -0
- data/templates/manualsonrails.html.erb +97 -0
- data/test/generator_spec.rb +60 -0
- data/test/parser_spec.rb +239 -0
- data/test/spec_helper.rb +51 -0
- metadata +358 -0
@@ -0,0 +1,161 @@
|
|
1
|
+
#
|
2
|
+
# Make file to install/uninstall AsciiDoc
|
3
|
+
#
|
4
|
+
|
5
|
+
.NOTPARALLEL:
|
6
|
+
|
7
|
+
INSTALL = @INSTALL@
|
8
|
+
INSTALL_PROG = @INSTALL_PROGRAM@
|
9
|
+
INSTALL_DATA = @INSTALL_DATA@
|
10
|
+
|
11
|
+
SED = @SED@
|
12
|
+
|
13
|
+
prefix = @prefix@
|
14
|
+
exec_prefix = @exec_prefix@
|
15
|
+
bindir = @bindir@
|
16
|
+
datadir = @datadir@
|
17
|
+
sysconfdir = @sysconfdir@
|
18
|
+
datarootdir = @datarootdir@
|
19
|
+
mandir=@mandir@
|
20
|
+
srcdir = @srcdir@
|
21
|
+
|
22
|
+
VPATH = @srcdir@
|
23
|
+
|
24
|
+
ASCIIDOCCONF = $(sysconfdir)/asciidoc
|
25
|
+
|
26
|
+
prog = asciidoc.py a2x
|
27
|
+
progdir = $(bindir)
|
28
|
+
|
29
|
+
vimdir = @sysconfdir@/vim
|
30
|
+
|
31
|
+
manp = $(wildcard doc/*.1)
|
32
|
+
manpdir = $(mandir)/man1
|
33
|
+
|
34
|
+
conf = $(wildcard *.conf)
|
35
|
+
confdir = $(ASCIIDOCCONF)
|
36
|
+
|
37
|
+
filtersdir = $(ASCIIDOCCONF)/filters
|
38
|
+
|
39
|
+
codefilter = filters/code/code-filter.py
|
40
|
+
codefilterdir = $(filtersdir)/code
|
41
|
+
codefilterconf = filters/code/code-filter.conf
|
42
|
+
codefilterconfdir = $(filtersdir)/code
|
43
|
+
|
44
|
+
graphvizfilter = filters/graphviz/graphviz2png.py
|
45
|
+
graphvizfilterdir = $(filtersdir)/graphviz
|
46
|
+
graphvizfilterconf = filters/graphviz/graphviz-filter.conf
|
47
|
+
graphvizfilterconfdir = $(filtersdir)/graphviz
|
48
|
+
|
49
|
+
musicfilter = filters/music/music2png.py
|
50
|
+
musicfilterdir = $(filtersdir)/music
|
51
|
+
musicfilterconf = filters/music/music-filter.conf
|
52
|
+
musicfilterconfdir = $(filtersdir)/music
|
53
|
+
|
54
|
+
sourcefilterconf = filters/source/source-highlight-filter.conf
|
55
|
+
sourcefilterconfdir = $(filtersdir)/source
|
56
|
+
|
57
|
+
docbook = $(wildcard docbook-xsl/*.xsl)
|
58
|
+
docbookdir = $(ASCIIDOCCONF)/docbook-xsl
|
59
|
+
|
60
|
+
dblatex = $(wildcard dblatex/*.xsl) $(wildcard dblatex/*.sty)
|
61
|
+
dblatexdir = $(ASCIIDOCCONF)/dblatex
|
62
|
+
|
63
|
+
css = $(wildcard stylesheets/*.css)
|
64
|
+
cssdir = $(ASCIIDOCCONF)/stylesheets
|
65
|
+
|
66
|
+
js = $(wildcard javascripts/*.js)
|
67
|
+
jsdir = $(ASCIIDOCCONF)/javascripts
|
68
|
+
|
69
|
+
callouts = $(wildcard images/icons/callouts/*)
|
70
|
+
calloutsdir = $(ASCIIDOCCONF)/images/icons/callouts
|
71
|
+
|
72
|
+
icons = $(wildcard images/icons/*.png) images/icons/README
|
73
|
+
iconsdir = $(ASCIIDOCCONF)/images/icons
|
74
|
+
|
75
|
+
doc = $(wildcard README*) $(wildcard BUGS*) $(wildcard INSTALL*) $(wildcard CHANGELOG*)
|
76
|
+
docdir = $(datadir)/doc/asciidoc
|
77
|
+
|
78
|
+
DATATARGETS = manp conf docbook dblatex css js callouts icons codefilterconf musicfilterconf sourcefilterconf graphvizfilterconf
|
79
|
+
PROGTARGETS = prog codefilter musicfilter graphvizfilter
|
80
|
+
TARGETS = $(DATATARGETS) $(PROGTARGETS) doc
|
81
|
+
|
82
|
+
INSTDIRS = $(TARGETS:%=%dir)
|
83
|
+
|
84
|
+
.PHONY: $(TARGETS)
|
85
|
+
|
86
|
+
all: build
|
87
|
+
|
88
|
+
# create directories used during the install
|
89
|
+
$(INSTDIRS):
|
90
|
+
$(INSTALL) -d $(DESTDIR)/$($@)
|
91
|
+
|
92
|
+
$(PROGTARGETS): % : %dir
|
93
|
+
$(INSTALL_PROG) $($@) $(DESTDIR)/$($<)/
|
94
|
+
|
95
|
+
$(DATATARGETS): % : %dir
|
96
|
+
$(INSTALL_DATA) $($@) $(DESTDIR)/$($<)/
|
97
|
+
|
98
|
+
docs:
|
99
|
+
$(INSTALL) -d $(DESTDIR)/$(docdir)
|
100
|
+
$(INSTALL_DATA) $(doc) $(DESTDIR)/$(docdir)
|
101
|
+
$(INSTALL) -d $(DESTDIR)/$(docdir)/docbook-xsl
|
102
|
+
$(INSTALL_DATA) docbook-xsl/asciidoc-docbook-xsl.txt $(DESTDIR)/$(docdir)/docbook-xsl
|
103
|
+
$(INSTALL) -d $(DESTDIR)/$(docdir)/dblatex
|
104
|
+
$(INSTALL_DATA) dblatex/dblatex-readme.txt $(DESTDIR)/$(docdir)/dblatex
|
105
|
+
$(INSTALL) -d $(DESTDIR)/$(docdir)/stylesheets
|
106
|
+
$(INSTALL_DATA) $(css) $(DESTDIR)/$(docdir)/stylesheets
|
107
|
+
$(INSTALL) -d $(DESTDIR)/$(docdir)/javascripts
|
108
|
+
$(INSTALL_DATA) $(js) $(DESTDIR)/$(docdir)/javascripts
|
109
|
+
$(INSTALL) -d $(DESTDIR)/$(docdir)/images
|
110
|
+
( cd images && \
|
111
|
+
cp -R * $(DESTDIR)/$(docdir)/images )
|
112
|
+
$(INSTALL) -d $(DESTDIR)/$(docdir)/doc
|
113
|
+
( cd doc && \
|
114
|
+
cp -R * $(DESTDIR)/$(docdir)/doc )
|
115
|
+
$(INSTALL) -d $(DESTDIR)/$(docdir)/examples/website
|
116
|
+
( cd examples/website && \
|
117
|
+
cp -R * $(DESTDIR)/$(docdir)/examples/website )
|
118
|
+
|
119
|
+
renameprog:
|
120
|
+
(cd $(DESTDIR)/$(progdir); mv asciidoc.py asciidoc)
|
121
|
+
|
122
|
+
fixconfpath:
|
123
|
+
@for f in $(prog); do \
|
124
|
+
echo "Fixing CONF_DIR in $$f"; \
|
125
|
+
$(SED) "s#^CONF_DIR = '.*'#CONF_DIR = '$(ASCIIDOCCONF)'#; s#^CONF_DIR=.*#CONF_DIR=$(ASCIIDOCCONF)#" $$f > $$f.out; \
|
126
|
+
mv $$f.out $$f; \
|
127
|
+
done
|
128
|
+
|
129
|
+
install-vim:
|
130
|
+
@for d in $(DESTDIR)/$(vimdir) /etc/vim; do \
|
131
|
+
if ! test -d $$d; then continue; fi ; \
|
132
|
+
echo "installing Vim files in $$d" ; \
|
133
|
+
$(INSTALL) -d $$d/syntax ; \
|
134
|
+
$(INSTALL_DATA) vim/syntax/asciidoc.vim $$d/syntax ; \
|
135
|
+
$(INSTALL) -d $$d/ftdetect ; \
|
136
|
+
$(INSTALL_DATA) vim/ftdetect/asciidoc_filetype.vim $$d/ftdetect ; \
|
137
|
+
done
|
138
|
+
|
139
|
+
uninstall-vim:
|
140
|
+
@for d in $(DESTDIR)/$(vimdir) /etc/vim; do \
|
141
|
+
if ! test -d $$d; then continue; fi ; \
|
142
|
+
echo "uninstalling Vim files in $$d" ; \
|
143
|
+
rm -f $$d/syntax/asciidoc.vim ; \
|
144
|
+
rm -f $$d/ftdetect/asciidoc_filetype.vim ; \
|
145
|
+
done
|
146
|
+
|
147
|
+
|
148
|
+
build: fixconfpath
|
149
|
+
|
150
|
+
install: $(PROGTARGETS) $(DATATARGETS) renameprog install-vim
|
151
|
+
|
152
|
+
uninstall: uninstall-vim
|
153
|
+
rm -f $(DESTDIR)/$(progdir)/asciidoc
|
154
|
+
rm -f $(DESTDIR)/$(progdir)/a2x
|
155
|
+
rm -f $(DESTDIR)/$(mandir)/asciidoc.1
|
156
|
+
rm -f $(DESTDIR)/$(mandir)/a2x.1
|
157
|
+
rm -rf $(DESTDIR)/$(confdir)
|
158
|
+
rm -rf $(DESTDIR)/$(docdir)
|
159
|
+
|
160
|
+
test:
|
161
|
+
@echo "Nothing to see here...Move along."
|
data/asciidoc/README
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
AsciiDoc README File
|
2
|
+
|
3
|
+
version 8.3.3, 2 January 2009
|
4
|
+
__________________________________________________________________
|
5
|
+
|
6
|
+
1. Prerequisites
|
7
|
+
|
8
|
+
AsciiDoc is written in Python so you need a Python interpreter (version
|
9
|
+
2.4 or later) to execute asciidoc(1). Python is installed by default in
|
10
|
+
most Linux distributions. You can download Python from the official
|
11
|
+
Python website [1]http://www.python.org.
|
12
|
+
__________________________________________________________________
|
13
|
+
|
14
|
+
2. Obtaining AsciiDoc
|
15
|
+
|
16
|
+
The latest AsciiDoc version and online documentation can be found at
|
17
|
+
[2]http://www.methods.co.nz/asciidoc/ and at the SourceForge
|
18
|
+
[3]http://sourceforge.net/projects/asciidoc/.
|
19
|
+
__________________________________________________________________
|
20
|
+
|
21
|
+
3. Tools
|
22
|
+
|
23
|
+
Current AsciiDoc version tested on Xubuntu Linux 8.04 with:
|
24
|
+
* Python 2.5.2
|
25
|
+
* bash 3.2.39
|
26
|
+
* DocBook XSL Stylesheets 1.73.2
|
27
|
+
* xsltproc (libxml 20631, libxslt 10122 and libexslt 813).
|
28
|
+
* w3m 0.5.1
|
29
|
+
* dblatex 0.2.9
|
30
|
+
* FOP 0.95
|
31
|
+
__________________________________________________________________
|
32
|
+
|
33
|
+
4. COPYING
|
34
|
+
|
35
|
+
Copyright � 2002-2008 Stuart Rackham. Free use of this software is
|
36
|
+
granted under the terms of the GNU General Public License (GPL).
|
37
|
+
__________________________________________________________________
|
38
|
+
|
39
|
+
Version 8.3.3
|
40
|
+
Last updated 2009-01-02 12:45:18 NZDT
|
41
|
+
|
42
|
+
References
|
43
|
+
|
44
|
+
1. http://www.python.org/
|
45
|
+
2. http://www.methods.co.nz/asciidoc/
|
46
|
+
3. http://sourceforge.net/projects/asciidoc/
|
data/asciidoc/README.txt
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
AsciiDoc README File
|
2
|
+
====================
|
3
|
+
|
4
|
+
Prerequisites
|
5
|
+
-------------
|
6
|
+
AsciiDoc is written in Python so you need a Python interpreter
|
7
|
+
(version 2.4 or later) to execute asciidoc(1). Python is installed by
|
8
|
+
default in most Linux distributions. You can download Python from the
|
9
|
+
official Python website http://www.python.org.
|
10
|
+
|
11
|
+
|
12
|
+
Obtaining AsciiDoc
|
13
|
+
------------------
|
14
|
+
The latest AsciiDoc version and online documentation can be found at
|
15
|
+
http://www.methods.co.nz/asciidoc/ and at the SourceForge
|
16
|
+
http://sourceforge.net/projects/asciidoc/.
|
17
|
+
|
18
|
+
|
19
|
+
Tools
|
20
|
+
-----
|
21
|
+
Current AsciiDoc version tested on Xubuntu Linux 8.04 with:
|
22
|
+
|
23
|
+
- Python 2.5.2
|
24
|
+
- bash 3.2.39
|
25
|
+
- DocBook XSL Stylesheets 1.73.2
|
26
|
+
- xsltproc (libxml 20631, libxslt 10122 and libexslt 813).
|
27
|
+
- w3m 0.5.1
|
28
|
+
- dblatex 0.2.9
|
29
|
+
- FOP 0.95
|
30
|
+
|
31
|
+
|
32
|
+
COPYING
|
33
|
+
-------
|
34
|
+
Copyright (C) 2002-2008 Stuart Rackham. Free use of this software
|
35
|
+
is granted under the terms of the GNU General Public License (GPL).
|
36
|
+
|
data/asciidoc/a2x
ADDED
@@ -0,0 +1,674 @@
|
|
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
|
+
#--------------------------------------------------------------------
|