sb: RSB backport changes to support mailing list posting of builds.

This requires moving to markdown for HTML and so asciidoc can be removed.

Close 3289
This commit is contained in:
Chris Johns 2018-02-05 15:32:57 +11:00
parent 892b41666e
commit de9ca906d3
312 changed files with 6436 additions and 70481 deletions

View File

@ -18,5 +18,10 @@
# #
%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN} %define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN}
#
# Disable emailing reports of this building for RTEMS.
#
%define mail_disable
4.11/rtems-autotools-internal 4.11/rtems-autotools-internal
4.11/rtems-autotools-base 4.11/rtems-autotools-base

View File

@ -1,27 +0,0 @@
Bugs and Known Problems
version 8.6.8, 17 July 2012
__________________________________________________________________
1. AsciiDoc
* A benign warning with will become a reserved keyword in Python 2.6
sometimes occurs when using Python 2.5 — its harmless and will
disappear with Python 3.
* Reported line numbers in diagnostic messages are sometimes wrong.
* Attribute references in macro attribute lists cant be unescaped
(with the exception of attribute list entry {0}).
* Section numbering is incorrect when outputting HTML from a
multi-part book type document. This is not a biggy since multi-part
books are generally processed to DocBook.
* A row of apostrophes in an inline context throws AsciiDoc into an
endless loop. The problem seems to be in the input file Reader.
__________________________________________________________________
2. dblatex
See ./dblatex/dblatex-readme.txt.
__________________________________________________________________
Version 8.6.8
Last updated 2011-11-10 09:23:10 NZDT

View File

@ -1,20 +0,0 @@
Bugs and Known Problems
=======================
AsciiDoc
--------
- A benign warning 'with will become a reserved keyword
in Python 2.6' sometimes occurs when using Python 2.5 -- it's
harmless and will disappear with Python 3.
- Reported line numbers in diagnostic messages are sometimes wrong.
- Attribute references in macro attribute lists can't be unescaped
(with the exception of attribute list entry `{0}`).
- Section numbering is incorrect when outputting HTML from a
multi-part book type document. This is not a biggy since multi-part
books are generally processed to DocBook.
- A row of apostrophes in an inline context throws AsciiDoc into an
endless loop. The problem seems to be in the input file 'Reader'.
dblatex
-------
See `./dblatex/dblatex-readme.txt`.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@ -1,18 +0,0 @@
Copyright (C) 2000-2007 Stuart Rackham
Email: srackham@gmail.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.

View File

@ -1,235 +0,0 @@
AsciiDoc Installation
version 8.6.8, 17 July 2012
Note
The current version of AsciiDoc requires Python 2.4 or newer to run. If
you dont already have an up-to-date version of Python installed it can
be downloaded from the official Python website
[1]http://www.python.org/.
__________________________________________________________________
1. Prerequisites
See the [2]README page.
__________________________________________________________________
2. Installing from the Mercurial repository
The AsciiDoc [3]Mercurial repository is hosted by [4]Google Code. To
browse the repository go to
[5]http://code.google.com/p/asciidoc/source/browse/. You can install
AsciiDoc from the repository if you dont have an up to date packaged
version or want to get the latest version from the trunk:
* Make sure you have [6]Mercurial installed, you can check with:
$ hg --version
* Go to the directory you want to install AsciiDoc into and download
the repository. This example gets the 8.6.8 tagged release:
$ cd ~/bin
$ hg clone -r 8.6.8 https://asciidoc.googlecode.com/hg/ asciidoc-8.6.8
You now have two choices: you can run asciidoc locally from your
repository or you can use autoconf(1) and make(1) to perform a
system-wide install.
2.1. Running asciidoc from your local copy
Create a symlink to the AsciiDoc script in a search PATH directory so
its easy to execute asciidoc from the command-line, for example:
$ ln -s ~/bin/asciidoc-8.6.8/asciidoc.py ~/bin/asciidoc
$ ln -s ~/bin/asciidoc-8.6.8/a2x.py ~/bin/a2x
Use the Mercurial pull command to update your local AsciiDoc
repository.
2.2. Installing asciidoc for all users
Create configure using autoconf(1); use configure to create the
Makefile; run make(1); build the man pages; install:
$ autoconf
$ ./configure
$ make
$ sudo make install
To uninstall:
$ sudo make uninstall
__________________________________________________________________
3. Distribution tarball installation
The distribution source tarballs can be downloaded from the SourceForge
[7]http://sourceforge.net/projects/asciidoc/.
Note
Unless you are [8]installing on Microsoft Windows you should use the
tarball and not the zip file to install the the distribution (the
tarball contains symlinks).
If your flavor or UNIX or Linux does not have a packaged AsciiDoc
distribution or if you prefer to install the latest AsciiDoc version
from source use the configure shell script in the tarball root
directory.
The autoconf(1) generated configure script creates a make file that is
tailored for your system. To install:
$ tar -xzf asciidoc-8.6.8.tar.gz
$ cd asciidoc-8.6.8
$ ./configure
$ sudo make install
To install the documentation:
$ sudo make docs
To uninstall AsciiDoc:
$ sudo make uninstall
If Vim is installed on your system the AsciiDoc Vim syntax highlighter
and filetype detection scripts will be install in the global Vim
configuration file directory (asciidoc.vim in the syntax directory and
asciidoc_filetype.vim in the ftdetect directory).
__________________________________________________________________
4. Microsoft Windows installation
AsciiDoc is developed and tested on Linux but there seem to be quite a
few people using it on Windows. To install AsciiDoc on Windows unzip
the distribution Zip file contents:
$ unzip asciidoc-8.6.8.zip
This will create the folder asciidoc-8.6.8 containing the asciidoc.py
and a2x.py executables along with configuration files and
documentation.
To generate DocBook based outputs (e.g. PDFs) you will also need a
working DocBook toolchain. Installing and configuring a DocBook
toolchain on Windows can be a challenge — this blog post explains
[9]How to Create Handsome PDF Documents Without Frustration using
[10]Cygwin, [11]dblatex and AsciiDoc.
__________________________________________________________________
5. Testing your installation
Test out asciidoc by changing to the AsciiDoc application directory and
convert the User Guide document (./doc/asciidoc.txt) to XHTML
(./doc/asciidoc.html):
$ python asciidoc.py doc/asciidoc.txt
[12]testasciidoc offers a more extensive set of conformance tests,
though you do need to create the test data before running the tests
(this in itself is a good post-install test):
$ python ./tests/testasciidoc.py update
Now you can run the tests by executing this command:
$ python ./tests/testasciidoc.py run
A full battery of tests can be run from the main.aap script in the
distribution root directory:
$ aap test
__________________________________________________________________
6. Building the distribution
The AsciiDoc distribution is built using [13]A-A-P (a software build
system written by Bram Moolenaar). The AsciiDoc A-A-P scripts are:
./main.aap
Builds the distribution tarball and zip files, documentation and
example website.
./doc/main.aap
Builds distribution documentation.
./examples/website/main.aap
Builds AsciiDoc website.
./common.aap
Included in all scripts.
To build the distribution tarball and zip files, documentation and
example website run A-A-P from the distribution root directory:
$ aap
__________________________________________________________________
7. Prepackaged AsciiDoc installation
The following platform specific AsciiDoc packages are available:
Debian GNU/Linux
If you use Debian or a Debian based distribution theres an
[14]AsciiDoc Debian package available. Thanks to [15]Fredrik
Steen who built and maintains the Debian AsciiDoc package.
Gentoo Linux
If you use Gentoo Linux theres a [16]Gentoo AsciiDoc package
available. Thanks to [17]Brandon Philips for writing the ebuild.
Fedora Linux
With help from Terje Røsten, Chris Wright added asciidoc to
Fedora Extras which is available in the default installation. To
install asciidoc execute the following command:
$ yum install asciidoc
Slackware Linux
John Calixto has created a Slackware package for AsciiDoc which
can be downloaded from [18]http://linuxpackages.net/.
Ark Linux
[19]Bernhard Rosenkraenzer added AsciiDoc to Ark Linux — the
package is available from the Ark Linux repository at
[20]http://arklinux.osuosl.org/dockyard-devel/, so Ark Linux
users should just run apt-get install asciidoc.
T2 Linux
[21]Christian Wiese added AsciiDoc to the [22]T2 Linux
repository at
[23]http://svn.exactcode.de/t2/trunk/package/textproc/asciidoc/.
To build and install the package on a T2 system, run
./scripts/Emerge-Pkg asciidoc from within your T2 source
directory (default: /usr/src/t2-src).
Red Hat Enterprise Linux, Fedora and CentOS packages
Dag Wieers has built AsciiDoc RPMs for a number of Red Hat based
distributions, they can be downloaded from
[24]http://dag.wieers.com/rpm/packages/asciidoc/.
CSW Package for Sun Solaris
Ben Walton has created a CSW package for AsciiDoc, you can find
it here: [25]http://opencsw.org/packages/asciidoc.
See also [26]Packager Notes in the AsciiDoc User Guide.
__________________________________________________________________
Version 8.6.8
Last updated 2010-11-15 08:44:54 NZDT
References
1. http://www.python.org/
2. file://localhost/tmp/lynxXXXXr4pa6e/README.html
3. http://www.selenic.com/mercurial/
4. http://code.google.com/
5. http://code.google.com/p/asciidoc/source/browse/
6. http://www.selenic.com/mercurial/
7. http://sourceforge.net/projects/asciidoc/
8. file://localhost/tmp/lynxXXXXr4pa6e/L12440-2561TMP.html#X3
9. http://blog.rainwebs.net/2010/02/25/how-to-create-handsome-pdf-documents-without-frustration/
10. http://www.cygwin.com/
11. http://dblatex.sourceforge.net/
12. file://localhost/tmp/lynxXXXXr4pa6e/testasciidoc.html
13. http://www.a-a-p.org/
14. http://packages.debian.org/asciidoc
15. mailto:stone@debian.org
16. http://packages.gentoo.org/package/app-text/asciidoc
17. mailto:brandon@ifup.org
18. http://linuxpackages.net/
19. mailto:bero@arklinux.org
20. http://arklinux.osuosl.org/dockyard-devel/
21. mailto:cw@ixplanet.de
22. http://www.t2-project.org/
23. http://svn.exactcode.de/t2/trunk/package/textproc/asciidoc/
24. http://dag.wieers.com/rpm/packages/asciidoc/
25. http://opencsw.org/packages/asciidoc
26. file://localhost/tmp/lynxXXXXr4pa6e/userguide.html#X38

View File

@ -1,227 +0,0 @@
AsciiDoc Installation
=====================
NOTE: The current version of AsciiDoc requires *Python 2.4 or newer*
to run. If you don't already have an up-to-date version of Python
installed it can be downloaded from the official Python website
http://www.python.org/.
Prerequisites
-------------
See the link:README.html[README] page.
Installing from the Mercurial repository
----------------------------------------
The AsciiDoc http://www.selenic.com/mercurial/[Mercurial] repository
is hosted by http://code.google.com/[Google Code].
To browse the repository go to
http://code.google.com/p/asciidoc/source/browse/.
You can install AsciiDoc from the repository if you don't have an up to
date packaged version or want to get the latest version from the trunk:
- Make sure you have http://www.selenic.com/mercurial/[Mercurial]
installed, you can check with:
$ hg --version
- Go to the directory you want to install AsciiDoc into and download
the repository. This example gets the {revnumber} tagged release:
[subs="attributes"]
$ cd ~/bin
$ hg clone -r {revnumber} https://asciidoc.googlecode.com/hg/ asciidoc-{revnumber}
You now have two choices: you can run asciidoc locally from your
repository or you can use 'autoconf(1)' and 'make(1)' to perform a
system-wide install.
Running asciidoc from your local copy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a symlink to the AsciiDoc script in a search `PATH` directory
so it's easy to execute `asciidoc` from the command-line, for example:
[subs="attributes"]
$ ln -s ~/bin/asciidoc-{revnumber}/asciidoc.py ~/bin/asciidoc
$ ln -s ~/bin/asciidoc-{revnumber}/a2x.py ~/bin/a2x
Use the Mercurial `pull` command to update your local AsciiDoc repository.
Installing asciidoc for all users
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create `configure` using 'autoconf(1)'; use `configure` to create the
`Makefile`; run 'make(1)'; build the man pages; install:
---------------------------------------------
$ autoconf
$ ./configure
$ make
$ sudo make install
---------------------------------------------
To uninstall:
---------------------------------------------
$ sudo make uninstall
---------------------------------------------
[[X1]]
Distribution tarball installation
---------------------------------
The distribution source tarballs can be downloaded from the
SourceForge http://sourceforge.net/projects/asciidoc/.
NOTE: Unless you are <<X3,installing on Microsoft Windows>> you should
use the tarball and not the zip file to install the the distribution
(the tarball contains symlinks).
If your flavor or UNIX or Linux does not have a packaged AsciiDoc
distribution or if you prefer to install the latest AsciiDoc version
from source use the `configure` shell script in the tarball root
directory.
The `autoconf(1)` generated `configure` script creates a make file
that is tailored for your system. To install:
[subs="attributes"]
$ tar -xzf asciidoc-{revnumber}.tar.gz
$ cd asciidoc-{revnumber}
$ ./configure
$ sudo make install
To install the documentation:
$ sudo make docs
To uninstall AsciiDoc:
$ sudo make uninstall
If Vim is installed on your system the AsciiDoc Vim syntax highlighter
and filetype detection scripts will be install in the global Vim
configuration file directory (`asciidoc.vim` in the `syntax` directory
and `asciidoc_filetype.vim` in the `ftdetect` directory).
[[X3]]
Microsoft Windows installation
------------------------------
AsciiDoc is developed and tested on Linux but there seem to be quite a
few people using it on Windows. To install AsciiDoc on Windows unzip
the distribution Zip file contents:
[subs="attributes"]
$ unzip asciidoc-{revnumber}.zip
This will create the folder +asciidoc-{revnumber}+ containing the
`asciidoc.py` and `a2x.py` executables along with configuration files
and documentation.
To generate DocBook based outputs (e.g. PDFs) you will also need a
working DocBook toolchain. Installing and configuring a DocBook
toolchain on Windows can be a challenge -- this blog post explains
http://blog.rainwebs.net/2010/02/25/how-to-create-handsome-pdf-documents-without-frustration/[How
to Create Handsome PDF Documents Without Frustration] using
http://www.cygwin.com/[Cygwin],
http://dblatex.sourceforge.net/[dblatex] and AsciiDoc.
Testing your installation
-------------------------
Test out asciidoc by changing to the AsciiDoc application directory
and convert the User Guide document (`./doc/asciidoc.txt`) to XHTML
(`./doc/asciidoc.html`):
$ python asciidoc.py doc/asciidoc.txt
link:testasciidoc.html[testasciidoc] offers a more extensive set of
conformance tests, though you do need to create the test data before
running the tests (this in itself is a good post-install test):
$ python ./tests/testasciidoc.py update
Now you can run the tests by executing this command:
$ python ./tests/testasciidoc.py run
A full battery of tests can be run from the `main.aap` script in the
distribution root directory:
$ aap test
Building the distribution
-------------------------
The AsciiDoc distribution is built using http://www.a-a-p.org/[A-A-P]
(a software build system written by Bram Moolenaar). The AsciiDoc
A-A-P scripts are:
`./main.aap`:: Builds the distribution tarball and zip files,
documentation and example website.
`./doc/main.aap`:: Builds distribution documentation.
`./examples/website/main.aap`:: Builds AsciiDoc website.
`./common.aap`:: Included in all scripts.
To build the distribution tarball and zip files, documentation and
example website run A-A-P from the distribution root directory:
$ aap
[[X2]]
Prepackaged AsciiDoc installation
---------------------------------
The following platform specific AsciiDoc packages are available:
*Debian GNU/Linux*::
If you use Debian or a Debian based distribution there's an
http://packages.debian.org/asciidoc[AsciiDoc Debian package]
available. Thanks to mailto:stone@debian.org[Fredrik Steen] who
built and maintains the Debian AsciiDoc package.
*Gentoo Linux*::
If you use Gentoo Linux there's a
http://packages.gentoo.org/package/app-text/asciidoc[Gentoo AsciiDoc
package] available. Thanks to mailto:brandon@ifup.org[Brandon
Philips] for writing the ebuild.
*Fedora Linux*::
With help from Terje Røsten, Chris Wright added asciidoc to Fedora
Extras which is available in the default installation. To install
asciidoc execute the following command:
$ yum install asciidoc
*Slackware Linux*::
John Calixto has created a Slackware package for AsciiDoc which can
be downloaded from http://linuxpackages.net/.
*Ark Linux*::
mailto:bero@arklinux.org[Bernhard Rosenkraenzer] added AsciiDoc to
Ark Linux -- the package is available from the Ark Linux repository
at http://arklinux.osuosl.org/dockyard-devel/, so Ark Linux users
should just run `apt-get install asciidoc`.
*T2 Linux*::
mailto:cw@ixplanet.de[Christian Wiese] added AsciiDoc to the
http://www.t2-project.org/[T2 Linux] repository at
http://svn.exactcode.de/t2/trunk/package/textproc/asciidoc/. To
build and install the package on a T2 system, run
`./scripts/Emerge-Pkg asciidoc` from within your T2 source directory
(default: `/usr/src/t2-src`).
*Red Hat Enterprise Linux, Fedora and CentOS packages*::
Dag Wieers has built AsciiDoc RPMs for a number of Red Hat based
distributions, they can be downloaded from
http://dag.wieers.com/rpm/packages/asciidoc/.
*CSW Package for Sun Solaris*::
Ben Walton has created a CSW package for AsciiDoc, you can find it
here: http://opencsw.org/packages/asciidoc.
See also link:userguide.html#X38[Packager Notes] in the 'AsciiDoc User
Guide'.

View File

@ -1,90 +0,0 @@
a2x.py
asciidoc.py
asciidocapi.py
BUGS
BUGS.txt
MANIFEST
main.aap
common.aap
CHANGELOG
CHANGELOG.txt
asciidoc.conf
docbook45.conf
help.conf
html4.conf
html5.conf
lang-*.conf
latex.conf
slidy.conf
text.conf
wordpress.conf
xhtml11.conf
xhtml11-quirks.conf
COPYING
COPYRIGHT
dblatex/asciidoc-dblatex.sty
dblatex/asciidoc-dblatex.xsl
dblatex/dblatex-readme.txt
doc/a2x.1
doc/book.epub
doc/asciidoc.1
doc/asciidoc.conf
doc/article-docinfo.xml
doc/customers.csv
doc/images/
doc/main.aap
doc/article.pdf
doc/latex-filter.pdf
doc/music-filter.pdf
doc/source-highlight-filter.pdf
doc/*.txt
doc/asciidoc.dict
docbook-xsl/*.txt
docbook-xsl/*.xsl
examples/website/main.aap
examples/website/build-website.sh
examples/website/*.css
examples/website/*.js
examples/website/customers.csv
examples/website/images/
examples/website/layout?.conf
examples/website/*.txt
filters/code/code-filter.conf
filters/code/code-filter.py
filters/code/code-filter-readme.txt
filters/code/code-filter-test.txt
filters/latex/latex2png.py
filters/latex/latex-filter.conf
filters/music/music-filter.conf
filters/music/music2png.py
filters/music/music-filter-test.txt
filters/source/source-highlight-filter.conf
filters/source/source-highlight-filter-test.txt
filters/graphviz/graphviz-filter.conf
filters/graphviz/graphviz2png.py
filters/graphviz/asciidoc-graphviz-sample.txt
images/icons/callouts/*.png
images/icons/*.png
images/icons/README
images/smallnew.png
images/tiger.png
images/highlighter.png
INSTALL
INSTALL.txt
configure
configure.ac
Makefile.in
install-sh
javascripts/*.js
README
README.txt
stylesheets/*.css
tests/testasciidoc.py
tests/testasciidoc.conf
tests/asciidocapi.py
tests/data/*.conf
tests/data/*.txt
themes/flask/*.css
themes/volnitsky/*.css
vim/syntax/asciidoc.vim
vim/ftdetect/asciidoc_filetype.vim

View File

@ -1,185 +0,0 @@
#
# Make file to install/uninstall AsciiDoc
#
.NOTPARALLEL:
INSTALL = @INSTALL@
INSTALL_PROG = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
SED = @SED@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datadir = @datadir@
docdir = @docdir@
sysconfdir = @sysconfdir@
datarootdir = @datarootdir@
mandir=@mandir@
srcdir = @srcdir@
VPATH = @srcdir@
ASCIIDOCCONF = $(sysconfdir)/asciidoc
prog = asciidoc.py a2x.py
progdir = $(bindir)
vimdir = @sysconfdir@/vim
manp = $(patsubst %1.txt,%1,$(wildcard doc/*.1.txt))
manpdir = $(mandir)/man1
conf = $(wildcard *.conf)
confdir = $(ASCIIDOCCONF)
filtersdir = $(ASCIIDOCCONF)/filters
codefilter = filters/code/code-filter.py
codefilterdir = $(filtersdir)/code
codefilterconf = filters/code/code-filter.conf
codefilterconfdir = $(filtersdir)/code
graphvizfilter = filters/graphviz/graphviz2png.py
graphvizfilterdir = $(filtersdir)/graphviz
graphvizfilterconf = filters/graphviz/graphviz-filter.conf
graphvizfilterconfdir = $(filtersdir)/graphviz
musicfilter = filters/music/music2png.py
musicfilterdir = $(filtersdir)/music
musicfilterconf = filters/music/music-filter.conf
musicfilterconfdir = $(filtersdir)/music
sourcefilterconf = filters/source/source-highlight-filter.conf
sourcefilterconfdir = $(filtersdir)/source
latexfilter = filters/latex/latex2png.py
latexfilterdir = $(filtersdir)/latex
latexfilterconf = filters/latex/latex-filter.conf
latexfilterconfdir = $(filtersdir)/latex
themesdir = $(ASCIIDOCCONF)/themes
flasktheme = themes/flask/flask.css
flaskthemedir = $(themesdir)/flask
volnitskytheme = themes/volnitsky/volnitsky.css
volnitskythemedir = $(themesdir)/volnitsky
docbook = $(wildcard docbook-xsl/*.xsl)
docbookdir = $(ASCIIDOCCONF)/docbook-xsl
dblatex = $(wildcard dblatex/*.xsl) $(wildcard dblatex/*.sty)
dblatexdir = $(ASCIIDOCCONF)/dblatex
css = $(wildcard stylesheets/*.css)
cssdir = $(ASCIIDOCCONF)/stylesheets
js = $(wildcard javascripts/*.js)
jsdir = $(ASCIIDOCCONF)/javascripts
callouts = $(wildcard images/icons/callouts/*)
calloutsdir = $(ASCIIDOCCONF)/images/icons/callouts
icons = $(wildcard images/icons/*.png) images/icons/README
iconsdir = $(ASCIIDOCCONF)/images/icons
doc = $(wildcard README*) $(wildcard BUGS*) $(wildcard INSTALL*) $(wildcard CHANGELOG*)
DATATARGETS = manp conf docbook dblatex css js callouts icons codefilterconf musicfilterconf sourcefilterconf graphvizfilterconf latexfilterconf flasktheme volnitskytheme
PROGTARGETS = prog codefilter musicfilter graphvizfilter latexfilter
TARGETS = $(DATATARGETS) $(PROGTARGETS) doc
INSTDIRS = $(TARGETS:%=%dir)
.PHONY: $(TARGETS)
all: build
# create directories used during the install
$(INSTDIRS):
$(INSTALL) -d $(DESTDIR)/$($@)
$(PROGTARGETS): % : %dir
$(INSTALL_PROG) $($@) $(DESTDIR)/$($<)/
$(DATATARGETS): % : %dir
$(INSTALL_DATA) $($@) $(DESTDIR)/$($<)/
$(manp): %.1 : %.1.txt
python a2x.py -f manpage $<
docs:
$(INSTALL) -d $(DESTDIR)/$(docdir)
$(INSTALL_DATA) $(doc) $(DESTDIR)/$(docdir)
$(INSTALL) -d $(DESTDIR)/$(docdir)/docbook-xsl
$(INSTALL_DATA) docbook-xsl/asciidoc-docbook-xsl.txt $(DESTDIR)/$(docdir)/docbook-xsl
$(INSTALL) -d $(DESTDIR)/$(docdir)/dblatex
$(INSTALL_DATA) dblatex/dblatex-readme.txt $(DESTDIR)/$(docdir)/dblatex
$(INSTALL) -d $(DESTDIR)/$(docdir)/stylesheets
$(INSTALL_DATA) $(css) $(DESTDIR)/$(docdir)/stylesheets
$(INSTALL) -d $(DESTDIR)/$(docdir)/javascripts
$(INSTALL_DATA) $(js) $(DESTDIR)/$(docdir)/javascripts
$(INSTALL) -d $(DESTDIR)/$(docdir)/images
( cd images && \
cp -R * $(DESTDIR)/$(docdir)/images )
$(INSTALL) -d $(DESTDIR)/$(docdir)/doc
( cd doc && \
cp -R * $(DESTDIR)/$(docdir)/doc )
$(INSTALL) -d $(DESTDIR)/$(docdir)/examples/website
( cd examples/website && \
cp -R * $(DESTDIR)/$(docdir)/examples/website )
progsymlink:
(cd $(DESTDIR)/$(progdir); ln -sf asciidoc.py asciidoc)
(cd $(DESTDIR)/$(progdir); ln -sf a2x.py a2x)
fixconfpath:
@for f in $(prog); do \
echo "Fixing CONF_DIR in $$f"; \
$(SED) "s#^CONF_DIR = '.*'#CONF_DIR = '$(ASCIIDOCCONF)'#" $$f > $$f.out; \
mv $$f.out $$f; \
chmod +x $$f; \
done
install-vim:
@for d in $(DESTDIR)/$(vimdir) /etc/vim; do \
if ! test -d $$d; then continue; fi ; \
echo "installing Vim files in $$d" ; \
$(INSTALL) -d $$d/syntax ; \
$(INSTALL_DATA) vim/syntax/asciidoc.vim $$d/syntax ; \
$(INSTALL) -d $$d/ftdetect ; \
$(INSTALL_DATA) vim/ftdetect/asciidoc_filetype.vim $$d/ftdetect ; \
done
uninstall-vim:
@for d in $(DESTDIR)/$(vimdir) /etc/vim; do \
if ! test -d $$d; then continue; fi ; \
echo "uninstalling Vim files in $$d" ; \
rm -f $$d/syntax/asciidoc.vim ; \
rm -f $$d/ftdetect/asciidoc_filetype.vim ; \
done
build: fixconfpath $(manp)
install: all $(PROGTARGETS) $(DATATARGETS) progsymlink install-vim
uninstall: uninstall-vim
rm -f $(DESTDIR)/$(progdir)/asciidoc
rm -f $(DESTDIR)/$(progdir)/asciidoc.py
rm -f $(DESTDIR)/$(progdir)/a2x
rm -f $(DESTDIR)/$(progdir)/a2x.py
rm -f $(DESTDIR)/$(manpdir)/asciidoc.1
rm -f $(DESTDIR)/$(manpdir)/a2x.1
rm -rf $(DESTDIR)/$(confdir)
rm -rf $(DESTDIR)/$(docdir)
clean:
rm -f $(manp)
test:
@echo "Nothing to see here...Move along."

View File

@ -1,45 +0,0 @@
AsciiDoc README File
version 8.6.8, 17 July 2012
__________________________________________________________________
1. Prerequisites
AsciiDoc is written in Python so you need a Python interpreter (version
2.4 or later) to execute asciidoc(1). Python is installed by default in
most Linux distributions. You can download Python from the official
Python website [1]http://www.python.org.
__________________________________________________________________
2. Obtaining AsciiDoc
Documentation and installation instructions are on the AsciiDoc website
[2]http://www.methods.co.nz/asciidoc/
__________________________________________________________________
3. Tools
Current AsciiDoc version tested on Xubuntu Linux 10.04 with:
* Python 2.6.5
* DocBook XSL Stylesheets 1.76.1
* xsltproc (libxml 20706, libxslt 10126 and libexslt 815).
* w3m 0.5.2
* dblatex 0.3
* FOP 0.95
* A-A-P 1.091
__________________________________________________________________
4. Copying
Copyright © 2002-2011 Stuart Rackham. Free use of this software is
granted under the terms of the GNU General Public License version 2
(GPLv2).
__________________________________________________________________
Version 8.6.8
Last updated 2011-05-04 18:47:58 NZST
References
1. http://www.python.org/
2. http://www.methods.co.nz/asciidoc/

View File

@ -1,35 +0,0 @@
AsciiDoc README File
====================
Prerequisites
-------------
AsciiDoc is written in Python so you need a Python interpreter
(version 2.4 or later) to execute asciidoc(1). Python is installed by
default in most Linux distributions. You can download Python from the
official Python website http://www.python.org.
Obtaining AsciiDoc
------------------
Documentation and installation instructions are on the AsciiDoc
website http://www.methods.co.nz/asciidoc/
Tools
-----
Current AsciiDoc version tested on Xubuntu Linux 10.04 with:
- Python 2.6.5
- DocBook XSL Stylesheets 1.76.1
- xsltproc (libxml 20706, libxslt 10126 and libexslt 815).
- w3m 0.5.2
- dblatex 0.3
- FOP 0.95
- A-A-P 1.091
Copying
-------
Copyright (C) 2002-2011 Stuart Rackham. Free use of this software is
granted under the terms of the GNU General Public License version 2
(GPLv2).

View File

@ -1,960 +0,0 @@
#!/usr/bin/env python
'''
a2x - A toolchain manager for AsciiDoc (converts Asciidoc text files to other
file formats)
Copyright: Stuart Rackham (c) 2009
License: MIT
Email: srackham@gmail.com
'''
import os
import fnmatch
import HTMLParser
import re
import shutil
import subprocess
import sys
import traceback
import urlparse
import zipfile
import xml.dom.minidom
import mimetypes
PROG = os.path.basename(os.path.splitext(__file__)[0])
VERSION = '8.6.8'
# AsciiDoc global configuration file directory.
# NOTE: CONF_DIR is "fixed up" by Makefile -- don't rename or change syntax.
CONF_DIR = '/etc/asciidoc'
######################################################################
# Default configuration file parameters.
######################################################################
# Optional environment variable dictionary passed to
# executing programs. If set to None the existing
# environment is used.
ENV = None
# External executables.
ASCIIDOC = 'asciidoc'
XSLTPROC = 'xsltproc'
DBLATEX = 'dblatex' # pdf generation.
FOP = 'fop' # pdf generation (--fop option).
W3M = 'w3m' # text generation.
LYNX = 'lynx' # text generation (if no w3m).
XMLLINT = 'xmllint' # Set to '' to disable.
EPUBCHECK = 'epubcheck' # Set to '' to disable.
# External executable default options.
ASCIIDOC_OPTS = ''
DBLATEX_OPTS = ''
FOP_OPTS = ''
XSLTPROC_OPTS = ''
BACKEND_OPTS = ''
######################################################################
# End of configuration file parameters.
######################################################################
#####################################################################
# Utility functions
#####################################################################
OPTIONS = None # These functions read verbose and dry_run command options.
def errmsg(msg):
sys.stderr.write('%s: %s\n' % (PROG,msg))
def warning(msg):
errmsg('WARNING: %s' % msg)
def infomsg(msg):
print '%s: %s' % (PROG,msg)
def die(msg, exit_code=1):
errmsg('ERROR: %s' % msg)
sys.exit(exit_code)
def trace():
"""Print traceback to stderr."""
errmsg('-'*60)
traceback.print_exc(file=sys.stderr)
errmsg('-'*60)
def verbose(msg):
if OPTIONS.verbose or OPTIONS.dry_run:
infomsg(msg)
class AttrDict(dict):
"""
Like a dictionary except values can be accessed as attributes i.e. obj.foo
can be used in addition to obj['foo'].
If self._default has been set then it will be returned if a non-existant
attribute is accessed (instead of raising an AttributeError).
"""
def __getattr__(self, key):
try:
return self[key]
except KeyError, k:
if self.has_key('_default'):
return self['_default']
else:
raise AttributeError, k
def __setattr__(self, key, value):
self[key] = value
def __delattr__(self, key):
try: del self[key]
except KeyError, k: raise AttributeError, k
def __repr__(self):
return '<AttrDict ' + dict.__repr__(self) + '>'
def __getstate__(self):
return dict(self)
def __setstate__(self,value):
for k,v in value.items(): self[k]=v
def isexecutable(file_name):
return os.path.isfile(file_name) and os.access(file_name, os.X_OK)
def find_executable(file_name):
'''
Search for executable file_name in the system PATH.
Return full path name or None if not found.
'''
def _find_executable(file_name):
if os.path.split(file_name)[0] != '':
# file_name includes directory so don't search path.
if not isexecutable(file_name):
return None
else:
return file_name
for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
f = os.path.join(p, file_name)
if isexecutable(f):
return os.path.realpath(f)
return None
if os.name == 'nt' and os.path.splitext(file_name)[1] == '':
for ext in ('.cmd','.bat','.exe'):
result = _find_executable(file_name + ext)
if result: break
else:
result = _find_executable(file_name)
return result
def write_file(filename, data, mode='w'):
f = open(filename, mode)
try:
f.write(data)
finally:
f.close()
def read_file(filename, mode='r'):
f = open(filename, mode)
try:
return f.read()
finally:
f.close()
def shell_cd(path):
verbose('chdir %s' % path)
if not OPTIONS.dry_run:
os.chdir(path)
def shell_makedirs(path):
if os.path.isdir(path):
return
verbose('creating %s' % path)
if not OPTIONS.dry_run:
os.makedirs(path)
def shell_copy(src, dst):
verbose('copying "%s" to "%s"' % (src,dst))
if not OPTIONS.dry_run:
shutil.copy(src, dst)
def shell_rm(path):
if not os.path.exists(path):
return
verbose('deleting %s' % path)
if not OPTIONS.dry_run:
os.unlink(path)
def shell_rmtree(path):
if not os.path.isdir(path):
return
verbose('deleting %s' % path)
if not OPTIONS.dry_run:
shutil.rmtree(path)
def shell(cmd, raise_error=True):
'''
Execute command cmd in shell and return tuple
(stdoutdata, stderrdata, returncode).
If raise_error is True then a non-zero return terminates the application.
'''
if os.name == 'nt':
# TODO: this is probably unnecessary, see:
# http://groups.google.com/group/asciidoc/browse_frm/thread/9442ee0c419f1242
# Windows doesn't like running scripts directly so explicitly
# specify python interpreter.
# Extract first (quoted or unquoted) argument.
mo = re.match(r'^\s*"\s*(?P<arg0>[^"]+)\s*"', cmd)
if not mo:
mo = re.match(r'^\s*(?P<arg0>[^ ]+)', cmd)
if mo.group('arg0').endswith('.py'):
cmd = 'python ' + cmd
# Remove redundant quoting -- this is not just cosmetic,
# quoting seems to dramatically decrease the allowed command
# length in Windows XP.
cmd = re.sub(r'"([^ ]+?)"', r'\1', cmd)
verbose('executing: %s' % cmd)
if OPTIONS.dry_run:
return
stdout = stderr = subprocess.PIPE
try:
popen = subprocess.Popen(cmd, stdout=stdout, stderr=stderr,
shell=True, env=ENV)
except OSError, e:
die('failed: %s: %s' % (cmd, e))
stdoutdata, stderrdata = popen.communicate()
if OPTIONS.verbose:
print stdoutdata
print stderrdata
if popen.returncode != 0 and raise_error:
die('%s returned non-zero exit status %d' % (cmd, popen.returncode))
return (stdoutdata, stderrdata, popen.returncode)
def find_resources(files, tagname, attrname, filter=None):
'''
Search all files and return a list of local URIs from attrname attribute
values in tagname tags.
Handles HTML open and XHTML closed tags.
Non-local URIs are skipped.
files can be a file name or a list of file names.
The filter function takes a dictionary of tag attributes and returns True if
the URI is to be included.
'''
class FindResources(HTMLParser.HTMLParser):
# Nested parser class shares locals with enclosing function.
def handle_startendtag(self, tag, attrs):
self.handle_starttag(tag, attrs)
def handle_starttag(self, tag, attrs):
attrs = dict(attrs)
if tag == tagname and (filter is None or filter(attrs)):
# Accept only local URIs.
uri = urlparse.urlparse(attrs[attrname])
if uri[0] in ('','file') and not uri[1] and uri[2]:
result.append(uri[2])
if isinstance(files, str):
files = [files]
result = []
for filename in files:
verbose('finding resources in: %s' % filename)
if OPTIONS.dry_run:
continue
parser = FindResources()
# HTMLParser has problems with non-ASCII strings.
# See http://bugs.python.org/issue3932
contents = read_file(filename)
mo = re.search(r'\A<\?xml.* encoding="(.*?)"', contents)
if mo:
encoding = mo.group(1)
parser.feed(contents.decode(encoding))
else:
parser.feed(contents)
parser.close()
result = list(set(result)) # Drop duplicate values.
result.sort()
return result
# NOT USED.
def copy_files(files, src_dir, dst_dir):
'''
Copy list of relative file names from src_dir to dst_dir.
'''
for filename in files:
filename = os.path.normpath(filename)
if os.path.isabs(filename):
continue
src = os.path.join(src_dir, filename)
dst = os.path.join(dst_dir, filename)
if not os.path.exists(dst):
if not os.path.isfile(src):
warning('missing file: %s' % src)
continue
dstdir = os.path.dirname(dst)
shell_makedirs(dstdir)
shell_copy(src, dst)
def find_files(path, pattern):
'''
Return list of file names matching pattern in directory path.
'''
result = []
for (p,dirs,files) in os.walk(path):
for f in files:
if fnmatch.fnmatch(f, pattern):
result.append(os.path.normpath(os.path.join(p,f)))
return result
def exec_xsltproc(xsl_file, xml_file, dst_dir, opts = ''):
cwd = os.getcwd()
shell_cd(dst_dir)
try:
shell('"%s" %s "%s" "%s"' % (XSLTPROC, opts, xsl_file, xml_file))
finally:
shell_cd(cwd)
def get_source_options(asciidoc_file):
'''
Look for a2x command options in AsciiDoc source file.
Limitation: options cannot contain double-quote characters.
'''
def parse_options():
# Parse options to result sequence.
inquotes = False
opt = ''
for c in options:
if c == '"':
if inquotes:
result.append(opt)
opt = ''
inquotes = False
else:
inquotes = True
elif c == ' ':
if inquotes:
opt += c
elif opt:
result.append(opt)
opt = ''
else:
opt += c
if opt:
result.append(opt)
result = []
if os.path.isfile(asciidoc_file):
options = ''
f = open(asciidoc_file)
try:
for line in f:
mo = re.search(r'^//\s*a2x:', line)
if mo:
options += ' ' + line[mo.end():].strip()
finally:
f.close()
parse_options()
return result
#####################################################################
# Application class
#####################################################################
class A2X(AttrDict):
'''
a2x options and conversion functions.
'''
def execute(self):
'''
Process a2x command.
'''
self.process_options()
# Append configuration file options.
self.asciidoc_opts += ' ' + ASCIIDOC_OPTS
self.dblatex_opts += ' ' + DBLATEX_OPTS
self.fop_opts += ' ' + FOP_OPTS
self.xsltproc_opts += ' ' + XSLTPROC_OPTS
self.backend_opts += ' ' + BACKEND_OPTS
# Execute to_* functions.
if self.backend:
self.to_backend()
else:
self.__getattribute__('to_'+self.format)()
if not (self.keep_artifacts or self.format == 'docbook' or self.skip_asciidoc):
shell_rm(self.dst_path('.xml'))
def load_conf(self):
'''
Load a2x configuration file from default locations and --conf-file
option.
'''
global ASCIIDOC
CONF_FILE = 'a2x.conf'
a2xdir = os.path.dirname(os.path.realpath(__file__))
conf_files = []
# From a2x.py directory.
conf_files.append(os.path.join(a2xdir, CONF_FILE))
# If the asciidoc executable and conf files are in the a2x directory
# then use the local copy of asciidoc and skip the global a2x conf.
asciidoc = os.path.join(a2xdir, 'asciidoc.py')
asciidoc_conf = os.path.join(a2xdir, 'asciidoc.conf')
if os.path.isfile(asciidoc) and os.path.isfile(asciidoc_conf):
self.asciidoc = asciidoc
else:
self.asciidoc = None
# From global conf directory.
conf_files.append(os.path.join(CONF_DIR, CONF_FILE))
# From $HOME directory.
home_dir = os.environ.get('HOME')
if home_dir is not None:
conf_files.append(os.path.join(home_dir, '.asciidoc', CONF_FILE))
# If asciidoc is not local to a2x then search the PATH.
if not self.asciidoc:
self.asciidoc = find_executable(ASCIIDOC)
if not self.asciidoc:
die('unable to find asciidoc: %s' % ASCIIDOC)
# From backend plugin directory.
if self.backend is not None:
stdout = shell(self.asciidoc + ' --backend list')[0]
backends = [(i, os.path.split(i)[1]) for i in stdout.splitlines()]
backend_dir = [i[0] for i in backends if i[1] == self.backend]
if len(backend_dir) == 0:
die('missing %s backend' % self.backend)
if len(backend_dir) > 1:
die('more than one %s backend' % self.backend)
verbose('found %s backend directory: %s' %
(self.backend, backend_dir[0]))
conf_files.append(os.path.join(backend_dir[0], 'a2x-backend.py'))
# From --conf-file option.
if self.conf_file is not None:
if not os.path.isfile(self.conf_file):
die('missing configuration file: %s' % self.conf_file)
conf_files.append(self.conf_file)
# From --xsl-file option.
if self.xsl_file is not None:
if not os.path.isfile(self.xsl_file):
die('missing XSL file: %s' % self.xsl_file)
self.xsl_file = os.path.abspath(self.xsl_file)
# Load ordered files.
for f in conf_files:
if os.path.isfile(f):
verbose('loading configuration file: %s' % f)
execfile(f, globals())
def process_options(self):
'''
Validate and command options and set defaults.
'''
if not os.path.isfile(self.asciidoc_file):
die('missing SOURCE_FILE: %s' % self.asciidoc_file)
self.asciidoc_file = os.path.abspath(self.asciidoc_file)
if not self.destination_dir:
self.destination_dir = os.path.dirname(self.asciidoc_file)
else:
if not os.path.isdir(self.destination_dir):
die('missing --destination-dir: %s' % self.destination_dir)
self.destination_dir = os.path.abspath(self.destination_dir)
self.resource_dirs = []
self.resource_files = []
if self.resource_manifest:
if not os.path.isfile(self.resource_manifest):
die('missing --resource-manifest: %s' % self.resource_manifest)
f = open(self.resource_manifest)
try:
for r in f:
self.resources.append(r.strip())
finally:
f.close()
for r in self.resources:
r = os.path.expanduser(r)
r = os.path.expandvars(r)
if r.endswith('/') or r.endswith('\\'):
if os.path.isdir(r):
self.resource_dirs.append(r)
else:
die('missing resource directory: %s' % r)
elif os.path.isdir(r):
self.resource_dirs.append(r)
elif r.startswith('.') and '=' in r:
ext, mimetype = r.split('=')
mimetypes.add_type(mimetype, ext)
else:
self.resource_files.append(r)
for p in (os.path.dirname(self.asciidoc), CONF_DIR):
for d in ('images','stylesheets'):
d = os.path.join(p,d)
if os.path.isdir(d):
self.resource_dirs.append(d)
verbose('resource files: %s' % self.resource_files)
verbose('resource directories: %s' % self.resource_dirs)
if not self.doctype and self.format == 'manpage':
self.doctype = 'manpage'
if self.doctype:
self.asciidoc_opts += ' --doctype %s' % self.doctype
for attr in self.attributes:
self.asciidoc_opts += ' --attribute "%s"' % attr
# self.xsltproc_opts += ' --nonet'
if self.verbose:
self.asciidoc_opts += ' --verbose'
self.dblatex_opts += ' -V'
if self.icons or self.icons_dir:
params = [
'callout.graphics 1',
'navig.graphics 1',
'admon.textlabel 0',
'admon.graphics 1',
]
if self.icons_dir:
params += [
'admon.graphics.path "%s/"' % self.icons_dir,
'callout.graphics.path "%s/callouts/"' % self.icons_dir,
'navig.graphics.path "%s/"' % self.icons_dir,
]
else:
params = [
'callout.graphics 0',
'navig.graphics 0',
'admon.textlabel 1',
'admon.graphics 0',
]
if self.stylesheet:
params += ['html.stylesheet "%s"' % self.stylesheet]
if self.format == 'htmlhelp':
params += ['htmlhelp.chm "%s"' % self.basename('.chm'),
'htmlhelp.hhp "%s"' % self.basename('.hhp'),
'htmlhelp.hhk "%s"' % self.basename('.hhk'),
'htmlhelp.hhc "%s"' % self.basename('.hhc')]
if self.doctype == 'book':
params += ['toc.section.depth 1']
# Books are chunked at chapter level.
params += ['chunk.section.depth 0']
for o in params:
if o.split()[0]+' ' not in self.xsltproc_opts:
self.xsltproc_opts += ' --stringparam ' + o
if self.fop_opts:
self.fop = True
if os.path.splitext(self.asciidoc_file)[1].lower() == '.xml':
self.skip_asciidoc = True
else:
self.skip_asciidoc = False
def dst_path(self, ext):
'''
Return name of file or directory in the destination directory with
the same name as the asciidoc source file but with extension ext.
'''
return os.path.join(self.destination_dir, self.basename(ext))
def basename(self, ext):
'''
Return the base name of the asciidoc source file but with extension
ext.
'''
return os.path.basename(os.path.splitext(self.asciidoc_file)[0]) + ext
def asciidoc_conf_file(self, path):
'''
Return full path name of file in asciidoc configuration files directory.
Search first the directory containing the asciidoc executable then
the global configuration file directory.
'''
f = os.path.join(os.path.dirname(self.asciidoc), path)
if not os.path.isfile(f):
f = os.path.join(CONF_DIR, path)
if not os.path.isfile(f):
die('missing configuration file: %s' % f)
return os.path.normpath(f)
def xsl_stylesheet(self, file_name=None):
'''
Return full path name of file in asciidoc docbook-xsl configuration
directory.
If an XSL file was specified with the --xsl-file option then it is
returned.
'''
if self.xsl_file is not None:
return self.xsl_file
if not file_name:
file_name = self.format + '.xsl'
return self.asciidoc_conf_file(os.path.join('docbook-xsl', file_name))
def copy_resources(self, html_files, src_dir, dst_dir, resources=[]):
'''
Search html_files for images and CSS resource URIs (html_files can be a
list of file names or a single file name).
Copy them from the src_dir to the dst_dir.
If not found in src_dir then recursively search all specified
resource directories.
Optional additional resources files can be passed in the resources list.
'''
resources = resources[:]
resources += find_resources(html_files, 'link', 'href',
lambda attrs: attrs.get('type') == 'text/css')
resources += find_resources(html_files, 'img', 'src')
resources += self.resource_files
resources = list(set(resources)) # Drop duplicates.
resources.sort()
for f in resources:
if '=' in f:
src, dst = f.split('=')
if not dst:
dst = src
else:
src = dst = f
src = os.path.normpath(src)
dst = os.path.normpath(dst)
if os.path.isabs(dst):
die('absolute resource file name: %s' % dst)
if dst.startswith(os.pardir):
die('resource file outside destination directory: %s' % dst)
src = os.path.join(src_dir, src)
dst = os.path.join(dst_dir, dst)
if not os.path.isfile(src):
for d in self.resource_dirs:
d = os.path.join(src_dir, d)
found = find_files(d, os.path.basename(src))
if found:
src = found[0]
break
else:
if not os.path.isfile(dst):
die('missing resource: %s' % src)
continue
# Arrive here if resource file has been found.
if os.path.normpath(src) != os.path.normpath(dst):
dstdir = os.path.dirname(dst)
shell_makedirs(dstdir)
shell_copy(src, dst)
def to_backend(self):
'''
Convert AsciiDoc source file to a backend output file using the global
'to_<backend name>' function (loaded from backend plugin a2x-backend.py
file).
Executes the global function in an A2X class instance context.
'''
eval('to_%s(self)' % self.backend)
def to_docbook(self):
'''
Use asciidoc to convert asciidoc_file to DocBook.
args is a string containing additional asciidoc arguments.
'''
docbook_file = self.dst_path('.xml')
if self.skip_asciidoc:
if not os.path.isfile(docbook_file):
die('missing docbook file: %s' % docbook_file)
return
shell('"%s" --backend docbook -a "a2x-format=%s" %s --out-file "%s" "%s"' %
(self.asciidoc, self.format, self.asciidoc_opts, docbook_file, self.asciidoc_file))
if not self.no_xmllint and XMLLINT:
shell('"%s" --nonet --noout --valid "%s"' % (XMLLINT, docbook_file))
def to_xhtml(self):
self.to_docbook()
docbook_file = self.dst_path('.xml')
xhtml_file = self.dst_path('.html')
opts = '%s --output "%s"' % (self.xsltproc_opts, xhtml_file)
exec_xsltproc(self.xsl_stylesheet(), docbook_file, self.destination_dir, opts)
src_dir = os.path.dirname(self.asciidoc_file)
self.copy_resources(xhtml_file, src_dir, self.destination_dir)
def to_manpage(self):
self.to_docbook()
docbook_file = self.dst_path('.xml')
opts = self.xsltproc_opts
exec_xsltproc(self.xsl_stylesheet(), docbook_file, self.destination_dir, opts)
def to_pdf(self):
if self.fop:
self.exec_fop()
else:
self.exec_dblatex()
def exec_fop(self):
self.to_docbook()
docbook_file = self.dst_path('.xml')
xsl = self.xsl_stylesheet('fo.xsl')
fo = self.dst_path('.fo')
pdf = self.dst_path('.pdf')
opts = '%s --output "%s"' % (self.xsltproc_opts, fo)
exec_xsltproc(xsl, docbook_file, self.destination_dir, opts)
shell('"%s" %s -fo "%s" -pdf "%s"' % (FOP, self.fop_opts, fo, pdf))
if not self.keep_artifacts:
shell_rm(fo)
def exec_dblatex(self):
self.to_docbook()
docbook_file = self.dst_path('.xml')
xsl = self.asciidoc_conf_file(os.path.join('dblatex','asciidoc-dblatex.xsl'))
sty = self.asciidoc_conf_file(os.path.join('dblatex','asciidoc-dblatex.sty'))
shell('"%s" -t %s -p "%s" -s "%s" %s "%s"' %
(DBLATEX, self.format, xsl, sty, self.dblatex_opts, docbook_file))
def to_dvi(self):
self.exec_dblatex()
def to_ps(self):
self.exec_dblatex()
def to_tex(self):
self.exec_dblatex()
def to_htmlhelp(self):
self.to_chunked()
def to_chunked(self):
self.to_docbook()
docbook_file = self.dst_path('.xml')
opts = self.xsltproc_opts
xsl_file = self.xsl_stylesheet()
if self.format == 'chunked':
dst_dir = self.dst_path('.chunked')
elif self.format == 'htmlhelp':
dst_dir = self.dst_path('.htmlhelp')
if not 'base.dir ' in opts:
opts += ' --stringparam base.dir "%s/"' % os.path.basename(dst_dir)
# Create content.
shell_rmtree(dst_dir)
shell_makedirs(dst_dir)
exec_xsltproc(xsl_file, docbook_file, self.destination_dir, opts)
html_files = find_files(dst_dir, '*.html')
src_dir = os.path.dirname(self.asciidoc_file)
self.copy_resources(html_files, src_dir, dst_dir)
def update_epub_manifest(self, opf_file):
'''
Scan the OEBPS directory for any files that have not been registered in
the OPF manifest then add them to the manifest.
'''
opf_dir = os.path.dirname(opf_file)
resource_files = []
for (p,dirs,files) in os.walk(os.path.dirname(opf_file)):
for f in files:
f = os.path.join(p,f)
if os.path.isfile(f):
assert f.startswith(opf_dir)
f = '.' + f[len(opf_dir):]
f = os.path.normpath(f)
if f not in ['content.opf']:
resource_files.append(f)
opf = xml.dom.minidom.parseString(read_file(opf_file))
manifest_files = []
manifest = opf.getElementsByTagName('manifest')[0]
for el in manifest.getElementsByTagName('item'):
f = el.getAttribute('href')
f = os.path.normpath(f)
manifest_files.append(f)
count = 0
for f in resource_files:
if f not in manifest_files:
count += 1
verbose('adding to manifest: %s' % f)
item = opf.createElement('item')
item.setAttribute('href', f.replace(os.path.sep, '/'))
item.setAttribute('id', 'a2x-%d' % count)
mimetype = mimetypes.guess_type(f)[0]
if mimetype is None:
die('unknown mimetype: %s' % f)
item.setAttribute('media-type', mimetype)
manifest.appendChild(item)
if count > 0:
write_file(opf_file, opf.toxml())
def to_epub(self):
self.to_docbook()
xsl_file = self.xsl_stylesheet()
docbook_file = self.dst_path('.xml')
epub_file = self.dst_path('.epub')
build_dir = epub_file + '.d'
shell_rmtree(build_dir)
shell_makedirs(build_dir)
# Create content.
exec_xsltproc(xsl_file, docbook_file, build_dir, self.xsltproc_opts)
# Copy resources referenced in the OPF and resources referenced by the
# generated HTML (in theory DocBook XSL should ensure they are
# identical but this is not always the case).
src_dir = os.path.dirname(self.asciidoc_file)
dst_dir = os.path.join(build_dir, 'OEBPS')
opf_file = os.path.join(dst_dir, 'content.opf')
opf_resources = find_resources(opf_file, 'item', 'href')
html_files = find_files(dst_dir, '*.html')
self.copy_resources(html_files, src_dir, dst_dir, opf_resources)
# Register any unregistered resources.
self.update_epub_manifest(opf_file)
# Build epub archive.
cwd = os.getcwd()
shell_cd(build_dir)
try:
if not self.dry_run:
zip = zipfile.ZipFile(epub_file, 'w')
try:
# Create and add uncompressed mimetype file.
verbose('archiving: mimetype')
write_file('mimetype', 'application/epub+zip')
zip.write('mimetype', compress_type=zipfile.ZIP_STORED)
# Compress all remaining files.
for (p,dirs,files) in os.walk('.'):
for f in files:
f = os.path.normpath(os.path.join(p,f))
if f != 'mimetype':
verbose('archiving: %s' % f)
zip.write(f, compress_type=zipfile.ZIP_DEFLATED)
finally:
zip.close()
verbose('created archive: %s' % epub_file)
finally:
shell_cd(cwd)
if not self.keep_artifacts:
shell_rmtree(build_dir)
if self.epubcheck and EPUBCHECK:
if not find_executable(EPUBCHECK):
warning('epubcheck skipped: unable to find executable: %s' % EPUBCHECK)
else:
shell('"%s" "%s"' % (EPUBCHECK, epub_file))
def to_text(self):
text_file = self.dst_path('.text')
html_file = self.dst_path('.text.html')
if self.lynx:
shell('"%s" %s --conf-file "%s" -b html4 -a "a2x-format=%s" -o "%s" "%s"' %
(self.asciidoc, self.asciidoc_opts, self.asciidoc_conf_file('text.conf'),
self.format, html_file, self.asciidoc_file))
shell('"%s" -dump "%s" > "%s"' %
(LYNX, html_file, text_file))
else:
# Use w3m(1).
self.to_docbook()
docbook_file = self.dst_path('.xml')
opts = '%s --output "%s"' % (self.xsltproc_opts, html_file)
exec_xsltproc(self.xsl_stylesheet(), docbook_file,
self.destination_dir, opts)
shell('"%s" -cols 70 -dump -T text/html -no-graph "%s" > "%s"' %
(W3M, html_file, text_file))
if not self.keep_artifacts:
shell_rm(html_file)
#####################################################################
# Script main line.
#####################################################################
if __name__ == '__main__':
description = '''A toolchain manager for AsciiDoc (converts Asciidoc text files to other file formats)'''
from optparse import OptionParser
parser = OptionParser(usage='usage: %prog [OPTIONS] SOURCE_FILE',
version='%s %s' % (PROG,VERSION),
description=description)
parser.add_option('-a', '--attribute',
action='append', dest='attributes', default=[], metavar='ATTRIBUTE',
help='set asciidoc attribute value')
parser.add_option('--asciidoc-opts',
action='append', dest='asciidoc_opts', default=[],
metavar='ASCIIDOC_OPTS', help='asciidoc options')
#DEPRECATED
parser.add_option('--copy',
action='store_true', dest='copy', default=False,
help='DEPRECATED: does nothing')
parser.add_option('--conf-file',
dest='conf_file', default=None, metavar='CONF_FILE',
help='configuration file')
parser.add_option('-D', '--destination-dir',
action='store', dest='destination_dir', default=None, metavar='PATH',
help='output directory (defaults to SOURCE_FILE directory)')
parser.add_option('-d','--doctype',
action='store', dest='doctype', metavar='DOCTYPE',
choices=('article','manpage','book'),
help='article, manpage, book')
parser.add_option('-b','--backend',
action='store', dest='backend', metavar='BACKEND',
help='name of backend plugin')
parser.add_option('--epubcheck',
action='store_true', dest='epubcheck', default=False,
help='check EPUB output with epubcheck')
parser.add_option('-f','--format',
action='store', dest='format', metavar='FORMAT', default = 'pdf',
choices=('chunked','epub','htmlhelp','manpage','pdf', 'text',
'xhtml','dvi','ps','tex','docbook'),
help='chunked, epub, htmlhelp, manpage, pdf, text, xhtml, dvi, ps, tex, docbook')
parser.add_option('--icons',
action='store_true', dest='icons', default=False,
help='use admonition, callout and navigation icons')
parser.add_option('--icons-dir',
action='store', dest='icons_dir',
default=None, metavar='PATH',
help='admonition and navigation icon directory')
parser.add_option('-k', '--keep-artifacts',
action='store_true', dest='keep_artifacts', default=False,
help='do not delete temporary build files')
parser.add_option('--lynx',
action='store_true', dest='lynx', default=False,
help='use lynx to generate text files')
parser.add_option('-L', '--no-xmllint',
action='store_true', dest='no_xmllint', default=False,
help='do not check asciidoc output with xmllint')
parser.add_option('-n','--dry-run',
action='store_true', dest='dry_run', default=False,
help='just print the commands that would have been executed')
parser.add_option('-r','--resource',
action='append', dest='resources', default=[],
metavar='PATH',
help='resource file or directory containing resource files')
parser.add_option('-m', '--resource-manifest',
action='store', dest='resource_manifest', default=None, metavar='FILE',
help='read resources from FILE')
#DEPRECATED
parser.add_option('--resource-dir',
action='append', dest='resources', default=[],
metavar='PATH',
help='DEPRECATED: use --resource')
#DEPRECATED
parser.add_option('-s','--skip-asciidoc',
action='store_true', dest='skip_asciidoc', default=False,
help='DEPRECATED: redundant')
parser.add_option('--stylesheet',
action='store', dest='stylesheet', default=None,
metavar='STYLESHEET',
help='HTML CSS stylesheet file name')
#DEPRECATED
parser.add_option('--safe',
action='store_true', dest='safe', default=False,
help='DEPRECATED: does nothing')
parser.add_option('--dblatex-opts',
action='append', dest='dblatex_opts', default=[],
metavar='DBLATEX_OPTS', help='dblatex options')
parser.add_option('--backend-opts',
action='append', dest='backend_opts', default=[],
metavar='BACKEND_OPTS', help='backend plugin options')
parser.add_option('--fop',
action='store_true', dest='fop', default=False,
help='use FOP to generate PDF files')
parser.add_option('--fop-opts',
action='append', dest='fop_opts', default=[],
metavar='FOP_OPTS', help='options for FOP pdf generation')
parser.add_option('--xsltproc-opts',
action='append', dest='xsltproc_opts', default=[],
metavar='XSLTPROC_OPTS', help='xsltproc options for XSL stylesheets')
parser.add_option('--xsl-file',
action='store', dest='xsl_file', metavar='XSL_FILE',
help='custom XSL stylesheet')
parser.add_option('-v', '--verbose',
action='count', dest='verbose', default=0,
help='increase verbosity')
if len(sys.argv) == 1:
parser.parse_args(['--help'])
source_options = get_source_options(sys.argv[-1])
argv = source_options + sys.argv[1:]
opts, args = parser.parse_args(argv)
if len(args) != 1:
parser.error('incorrect number of arguments')
opts.asciidoc_opts = ' '.join(opts.asciidoc_opts)
opts.dblatex_opts = ' '.join(opts.dblatex_opts)
opts.fop_opts = ' '.join(opts.fop_opts)
opts.xsltproc_opts = ' '.join(opts.xsltproc_opts)
opts.backend_opts = ' '.join(opts.backend_opts)
opts = eval(str(opts)) # Convert optparse.Values to dict.
a2x = A2X(opts)
OPTIONS = a2x # verbose and dry_run used by utility functions.
verbose('args: %r' % argv)
a2x.asciidoc_file = args[0]
try:
a2x.load_conf()
a2x.execute()
except KeyboardInterrupt:
exit(1)

View File

@ -1,647 +0,0 @@
#
# asciidoc.conf
#
# Asciidoc global configuration file.
# Contains backend independent configuration settings that are applied to all
# AsciiDoc documents.
#
[miscellaneous]
tabsize=8
textwidth=70
newline=\r\n
[attributes]
backend-alias-html=xhtml11
backend-alias-docbook=docbook45
toclevels=2
toc-placement=auto
sectids=
iconsdir=./images/icons
encoding=UTF-8
# Uncomment to use xhtml11 quirks mode CSS.
#quirks=
# HTML source code highlighter (source-highlight, pygments or highlight).
source-highlighter=source-highlight
# Uncomment to use deprecated quote attributes.
#deprecated-quotes=
empty=
sp=" "
# Attribute and AttributeList element patterns.
attributeentry-pattern=^:(?P<attrname>\w[^.]*?)(\.(?P<attrname2>.*?))?:(\s+(?P<attrvalue>.*))?$
attributelist-pattern=(?u)(^\[\[(?P<id>[\w_:][\w_:.-]*)(,(?P<reftext>.*?))?\]\]$)|(^\[(?P<attrlist>.*)\]$)
# Substitution attributes for escaping AsciiDoc processing.
amp=&
lt=<
gt=>
brvbar=|
nbsp=&#160;
zwsp=&#8203;
wj=&#8288;
deg=&#176;
backslash=\
two-colons=::
two-semicolons=;;
# DEPRECATED: underscore attribute names.
two_colons=::
two_semicolons=;;
# Left and right single and double quote characters.
# See http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks
lsquo=&#8216;
rsquo=&#8217;
ldquo=&#8220;
rdquo=&#8221;
[titles]
subs=specialcharacters,quotes,replacements,macros,attributes,replacements2
# Double-line title pattern and underlines.
sectiontitle=^(?P<title>.*?)$
underlines="==","--","~~","^^","++"
# Single-line title patterns.
sect0=^= +(?P<title>[\S].*?)( +=)?$
sect1=^== +(?P<title>[\S].*?)( +==)?$
sect2=^=== +(?P<title>[\S].*?)( +===)?$
sect3=^==== +(?P<title>[\S].*?)( +====)?$
sect4=^===== +(?P<title>[\S].*?)( +=====)?$
blocktitle=^\.(?P<title>([^.\s].*)|(\.[^.\s].*))$
[specialcharacters]
&=&amp;
<=&lt;
>=&gt;
[quotes]
# The order is important, quotes are processed in conf file order.
**=#strong
*=strong
``|''=doublequoted
'=emphasis
`|'=singlequoted
ifdef::no-inline-literal[]
`=monospaced
endif::no-inline-literal[]
# +++ and $$ quoting is applied to the +++ and $$ inline passthrough
# macros to allow quoted attributes to be used.
# This trick only works with inline passthrough macros.
+++=#unquoted
$$=#unquoted
++=#monospaced
+=monospaced
__=#emphasis
_=emphasis
\##=#unquoted
\#=unquoted
^=#superscript
~=#subscript
[specialwords]
emphasizedwords=
strongwords=
monospacedwords=
[replacements]
# Replacements performed in order of configuration file entry. The first entry
# of each replacement pair performs the (non-escaped) replacement, the second
# strips the backslash from the escaped replacement.
# (C) Copyright (entity reference &copy;)
(?<!\\)\(C\)=&#169;
\\\(C\)=(C)
# (R) registered trade mark (entity reference &reg;
(?<!\\)\(R\)=&#174;
\\\(R\)=(R)
# (TM) Trademark (entity reference &trade;)
(?<!\\)\(TM\)=&#8482;
\\\(TM\)=(TM)
# -- Spaced and unspaced em dashes (entity reference &mdash;).
# Space on both sides is translated to thin space characters.
(^-- )=&#8212;&#8201;
(\n-- )|( -- )|( --\n)=&#8201;&#8212;&#8201;
(\w)--(\w)=\1&#8212;\2
\\--(?!-)=--
# Replace vertical typewriter apostrophe with punctuation apostrophe.
(\w)'(\w)=\1&#8217;\2
(\w)\\'(\w)=\1'\2
# ... Ellipsis (entity reference &hellip;)
(?<!\\)\.\.\.=&#8230;
\\\.\.\.=...
# Arrows from the Arrows block of Unicode.
# -> right arrow
(?<!\\)-&gt;=&#8594;
\\-&gt;=-&gt;
# => right double arrow
(?<!\\)\=&gt;=&#8658;
\\\=&gt;==&gt;
# <- left arrow
(?<!\\)&lt;-=&#8592;
\\&lt;-=&lt;-
# <= left double arrow
(?<!\\)&lt;\==&#8656;
\\&lt;\==&lt;=
# Arbitrary entity references.
(?<!\\)&amp;([:_#a-zA-Z][:_.\-\w]*?;)=&\1
\\(&amp;[:_#a-zA-Z][:_.\-\w]*?;)=\1
#-----------
# Paragraphs
#-----------
[paradef-default]
delimiter=(?s)(?P<text>\S.*)
posattrs=style
style=normal
template::[paragraph-styles]
[paradef-literal]
delimiter=(?s)(?P<text>\s+.*)
options=listelement
posattrs=style
style=literal
template::[paragraph-styles]
[paradef-admonition]
delimiter=(?s)^\s*(?P<style>NOTE|TIP|IMPORTANT|WARNING|CAUTION):\s+(?P<text>.+)
template::[paragraph-styles]
[paragraph-styles]
normal-style=template="paragraph"
comment-style=template="paragraph",options=('skip',)
verse-style=template="verseparagraph",posattrs=("style","attribution","citetitle")
quote-style=template="quoteparagraph",posattrs=("style","attribution","citetitle")
literal-style=template="literalparagraph",subs=("verbatim",)
listing-style=template="listingparagraph",subs=("verbatim",)
example-style=template="exampleparagraph"
sidebar-style=template="sidebarparagraph"
abstract-style=template="abstractparagraph"
partintro-style=template="partintroparagraph"
NOTE-style=template="admonitionparagraph",name="note",caption="{note-caption}"
TIP-style=template="admonitionparagraph",name="tip",caption="{tip-caption}"
IMPORTANT-style=template="admonitionparagraph",name="important",caption="{important-caption}"
WARNING-style=template="admonitionparagraph",name="warning",caption="{warning-caption}"
CAUTION-style=template="admonitionparagraph",name="caution",caption="{caution-caption}"
[literalparagraph]
template::[literalblock]
[verseparagraph]
template::[verseblock]
[quoteparagraph]
template::[quoteblock]
[listingparagraph]
template::[listingblock]
[exampleparagraph]
template::[exampleblock]
[sidebarparagraph]
template::[sidebarblock]
[abstractparagraph]
template::[abstractblock]
[partintroparagraph]
template::[partintroblock]
[macros]
#--------------
# Inline macros
#--------------
# Backslash prefix required for escape processing.
# (?s) re flag for line spanning.
# Macros using default syntax.
(?su)(?<!\w)[\\]?(?P<name>http|https|ftp|file|irc|mailto|callto|image|link|anchor|xref|indexterm):(?P<target>\S*?)\[(?P<attrlist>.*?)(?<!\\)\]=
# These URL types don't require any special attribute list formatting.
(?su)(?<!\S)[\\]?(?P<name>http|https|ftp|file|irc):(?P<target>//[^\s<>]*[\w/])=
# Allow a leading parenthesis and square bracket.
(?su)(?<\=[([])[\\]?(?P<name>http|https|ftp|file|irc):(?P<target>//[^\s<>]*[\w/])=
# Allow <> brackets.
(?su)[\\]?&lt;(?P<name>http|https|ftp|file|irc):(?P<target>//[^\s<>]*[\w/])&gt;=
# Email addresses don't require special attribute list formatting.
# The before ">: and after "< character exclusions stop multiple substitution.
(?su)(?<![">:\w._/-])[\\]?(?P<target>\w[\w._-]*@[\w._-]*\w)(?!["<\w_-])=mailto
# Allow footnote macros hard up against the preceding word so the footnote mark
# can be placed against the noted text without an intervening space
# (http://groups.google.com/group/asciidoc/browse_frm/thread/e1dcb7ee0efc17b5).
(?su)[\\]?(?P<name>footnote|footnoteref):(?P<target>\S*?)\[(?P<attrlist>.*?)(?<!\\)\]=
# Anchor: [[[id]]]. Bibliographic anchor.
(?su)[\\]?\[\[\[(?P<attrlist>[\w_:][\w_:.-]*?)\]\]\]=anchor3
# Anchor: [[id,xreflabel]]
(?su)[\\]?\[\[(?P<attrlist>[\w"_:].*?)\]\]=anchor2
# Link: <<id,text>>
(?su)[\\]?&lt;&lt;(?P<attrlist>[\w"_:].*?)&gt;&gt;=xref2
ifdef::asciidoc7compatible[]
# Index term: ++primary,secondary,tertiary++
(?su)(?<!\S)[\\]?\+\+(?P<attrlist>[^+].*?)\+\+(?!\+)=indexterm
# Index term: +primary+
# Follows ++...++ macro otherwise it will match them.
(?<!\S)[\\]?\+(?P<attrlist>[^\s\+][^+].*?)\+(?!\+)=indexterm2
endif::asciidoc7compatible[]
ifndef::asciidoc7compatible[]
# Index term: (((primary,secondary,tertiary)))
(?su)(?<!\()[\\]?\(\(\((?P<attrlist>[^(].*?)\)\)\)(?!\))=indexterm
# Index term: ((primary))
# Follows (((...))) macro otherwise it will match them.
(?<!\()[\\]?\(\((?P<attrlist>[^\s\(][^(].*?)\)\)(?!\))=indexterm2
endif::asciidoc7compatible[]
# Callout
[\\]?&lt;(?P<index>\d+)&gt;=callout
# Passthrough macros.
(?su)[\\]?(?P<name>pass):(?P<subslist>\S*?)\[(?P<passtext>.*?)(?<!\\)\]=[]
# Triple-plus and double-dollar inline passthroughs.
(?su)[\\]?\+\+\+(?P<passtext>.*?)\+\+\+=pass[]
(?su)[\\]?\$\$(?P<passtext>.*?)\$\$=pass[specialcharacters]
# Inline literal.
ifndef::no-inline-literal[]
(?su)(?<![`\w])([\\]?`(?P<passtext>[^`\s]|[^`\s].*?\S)`)(?![`\w])=literal[specialcharacters]
endif::no-inline-literal[]
# Inline comment.
(?mu)^[\\]?//(?P<passtext>[^/].*|)$=comment[specialcharacters]
# Default (catchall) inline macro is not implemented so there is no ambiguity
# with previous definition that could result in double substitution of escaped
# references.
#(?su)[\\]?(?P<name>\w(\w|-)*?):(?P<target>\S*?)\[(?P<passtext>.*?)(?<!\\)\]=
#-------------
# Block macros
#-------------
# Macros using default syntax.
(?u)^(?P<name>image|unfloat|toc)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$=#
# Passthrough macros.
(?u)^(?P<name>pass)::(?P<subslist>\S*?)(\[(?P<passtext>.*?)\])$=#
^'{3,}$=#ruler
^<{3,}$=#pagebreak
^//(?P<passtext>[^/].*|)$=#comment[specialcharacters]
# Implemented in HTML backends.
[unfloat-blockmacro]
[toc-blockmacro]
#-----------------
# Delimited blocks
#-----------------
[blockdef-comment]
delimiter=^/{4,}$
options=skip
posattrs=style
[blockdef-sidebar]
delimiter=^\*{4,}$
template=sidebarblock
options=sectionbody
posattrs=style
# DEPRECATED: Use Openblock instead.
abstract-style=template="abstractblock"
[blockdef-open]
# A block without opening or closing tags.
delimiter=^--$
posattrs=style
style=default
default-style=template="openblock",options=("sectionbody",)
comment-style=template="openblock",options=("skip",)
abstract-style=template="abstractblock",options=("sectionbody",)
partintro-style=template="partintroblock",options=("sectionbody",)
example-style=template="exampleblock",options=("sectionbody",)
sidebar-style=template="sidebarblock",options=("sectionbody",)
verse-style=template="verseblock",posattrs=("style","attribution","citetitle")
quote-style=template="quoteblock",posattrs=("style","attribution","citetitle"),options=("sectionbody",)
literal-style=template="literalparagraph",subs=("verbatim",)
listing-style=template="listingparagraph",subs=("verbatim",)
NOTE-style=template="admonitionblock",name="note",caption="{note-caption}",options=("sectionbody",)
TIP-style=template="admonitionblock",name="tip",caption="{tip-caption}",options=("sectionbody",)
IMPORTANT-style=template="admonitionblock",name="important",caption="{important-caption}",options=("sectionbody",)
WARNING-style=template="admonitionblock",name="warning",caption="{warning-caption}",options=("sectionbody",)
CAUTION-style=template="admonitionblock",name="caution",caption="{caution-caption}",options=("sectionbody",)
[blockdef-pass]
delimiter=^\+{4,}$
template=passblock
# Default subs choosen for backward compatibility.
subs=attributes,macros
posattrs=style
pass-style=template="passblock",subs=()
[blockdef-listing]
delimiter=^-{4,}$
template=listingblock
subs=verbatim
posattrs=style
[blockdef-literal]
delimiter=^\.{4,}$
template=literalblock
subs=verbatim
posattrs=style
listing-style=template="listingblock"
# DEPRECATED: Use verse style on quote blocks instead.
verse-style=template="verseblock",subs="normal"
[blockdef-quote]
delimiter=^_{4,}$
subs=normal
style=quote
posattrs=style,attribution,citetitle
quote-style=template="quoteblock",options=("sectionbody",)
verse-style=template="verseblock"
[blockdef-example]
delimiter=^={4,}$
template=exampleblock
options=sectionbody
posattrs=style
NOTE-style=template="admonitionblock",name="note",caption="{note-caption}"
TIP-style=template="admonitionblock",name="tip",caption="{tip-caption}"
IMPORTANT-style=template="admonitionblock",name="important",caption="{important-caption}"
WARNING-style=template="admonitionblock",name="warning",caption="{warning-caption}"
CAUTION-style=template="admonitionblock",name="caution",caption="{caution-caption}"
# For use by custom filters.
# DEPRECATED: No longer used, a styled listing block (blockdef-listing) is preferable.
[blockdef-filter]
delimiter=^~{4,}$
template=listingblock
subs=none
posattrs=style
#-------
# Lists
#-------
[listdef-bulleted]
# - bullets.
delimiter=^\s*- +(?P<text>.+)$
posattrs=style
type=bulleted
tags=bulleted
callout-style=tags="callout"
bibliography-style=tags="bibliography"
[listdef-bulleted1]
# * bullets.
template::[listdef-bulleted]
delimiter=^\s*\* +(?P<text>.+)$
[listdef-bulleted2]
# ** bullets.
template::[listdef-bulleted]
delimiter=^\s*\*{2} +(?P<text>.+)$
[listdef-bulleted3]
# *** bullets.
template::[listdef-bulleted]
delimiter=^\s*\*{3} +(?P<text>.+)$
[listdef-bulleted4]
# **** bullets.
template::[listdef-bulleted]
delimiter=^\s*\*{4} +(?P<text>.+)$
[listdef-bulleted5]
# ***** bullets.
template::[listdef-bulleted]
delimiter=^\s*\*{5} +(?P<text>.+)$
[listdef-arabic]
# Arabic numbering.
delimiter=^\s*(?P<index>\d+\.) +(?P<text>.+)$
posattrs=style
type=numbered
tags=numbered
style=arabic
[listdef-loweralpha]
# Lower alpha numbering.
template::[listdef-arabic]
delimiter=^\s*(?P<index>[a-z]\.) +(?P<text>.+)$
style=loweralpha
[listdef-upperalpha]
# Upper alpha numbering.
template::[listdef-arabic]
delimiter=^\s*(?P<index>[A-Z]\.) +(?P<text>.+)$
style=upperalpha
[listdef-lowerroman]
# Lower roman numbering.
template::[listdef-arabic]
delimiter=^\s*(?P<index>[ivx]+\)) +(?P<text>.+)$
style=lowerroman
[listdef-upperroman]
# Upper roman numbering.
template::[listdef-arabic]
delimiter=^\s*(?P<index>[IVX]+\)) +(?P<text>.+)$
style=upperroman
[listdef-numbered1]
# . numbering.
template::[listdef-arabic]
delimiter=^\s*\. +(?P<text>.+)$
[listdef-numbered2]
# .. numbering.
template::[listdef-loweralpha]
delimiter=^\s*\.{2} +(?P<text>.+)$
[listdef-numbered3]
# ... numbering.
template::[listdef-lowerroman]
delimiter=^\s*\.{3} +(?P<text>.+)$
[listdef-numbered4]
# .... numbering.
template::[listdef-upperalpha]
delimiter=^\s*\.{4} +(?P<text>.+)$
[listdef-numbered5]
# ..... numbering.
template::[listdef-upperroman]
delimiter=^\s*\.{5} +(?P<text>.+)$
[listdef-labeled]
# label:: item.
delimiter=^\s*(?P<label>.*[^:])::(\s+(?P<text>.+))?$
posattrs=style
type=labeled
tags=labeled
vertical-style=tags="labeled"
horizontal-style=tags="horizontal"
glossary-style=tags="glossary"
qanda-style=tags="qanda"
[listdef-labeled2]
# label;; item.
template::[listdef-labeled]
delimiter=^\s*(?P<label>.*[^;]);;(\s+(?P<text>.+))?$
[listdef-labeled3]
# label::: item.
template::[listdef-labeled]
delimiter=^\s*(?P<label>.*[^:]):{3}(\s+(?P<text>.+))?$
[listdef-labeled4]
# label:::: item.
template::[listdef-labeled]
delimiter=^\s*(?P<label>.*[^:]):{4}(\s+(?P<text>.+))?$
[listdef-callout]
posattrs=style
delimiter=^<?(?P<index>\d*>) +(?P<text>.+)$
type=callout
tags=callout
style=arabic
# DEPRECATED: Old list syntax.
[listdef-qanda]
posattrs=style
delimiter=^\s*(?P<label>.*\S)\?\?$
type=labeled
tags=qanda
# DEPRECATED: Old list syntax.
[listdef-bibliography]
posattrs=style
delimiter=^\+ +(?P<text>.+)$
type=bulleted
tags=bibliography
# DEPRECATED: Old list syntax.
[listdef-glossary]
delimiter=^(?P<label>.*\S):-$
posattrs=style
type=labeled
tags=glossary
#-------
# Tables
#-------
[tabledef-default]
delimiter=^\|={3,}$
posattrs=style
template=table
default-style=tags="default"
verse-style=tags="verse"
literal-style=tags="literal",subs=("specialcharacters",)
emphasis-style=tags="emphasis"
strong-style=tags="strong"
monospaced-style=tags="monospaced"
header-style=tags="header"
asciidoc-style=tags="asciidoc",subs=(),filter='"{python}" "{asciidoc-file}" -b {backend} {asciidoc-args}{lang? -a "lang={lang}@"}{icons? -a icons -a "iconsdir={iconsdir}"}{imagesdir? -a "imagesdir={imagesdir}"}{data-uri? -a data-uri} -a "indir={indir}"{trace? -a "trace={trace}"}{blockname? -a "blockname={blockname}"} -s -'
[tabledef-nested]
# Same as [tabledef-default] but with different delimiter and separator.
delimiter=^!={3,}$
separator=((?<!\S)((?P<span>[\d.]+)(?P<op>[*+]))?(?P<align>[<\^>.]{,3})?(?P<style>[a-z])?)?!
posattrs=style
template=table
verse-style=tags="verse"
literal-style=tags="literal",subs=("specialcharacters",)
emphasis-style=tags="emphasis"
strong-style=tags="strong"
monospaced-style=tags="monospaced"
header-style=tags="header"
asciidoc-style=tags="asciidoc",subs=(),filter='"{python}" "{asciidoc-file}" -b {backend} {asciidoc-args}{lang? -a "lang={lang}@"}{icons? -a icons -a "iconsdir={iconsdir}"}{imagesdir? -a "imagesdir={imagesdir}"}{data-uri? -a data-uri} -a "indir={indir}"{trace? -a "trace={trace}"}{blockname? -a "blockname={blockname}"} -s -'
#----------------------------------------
# Common block and macro markup templates
#----------------------------------------
[comment-inlinemacro]
# Outputs nothing.
[comment-blockmacro]
# Outputs nothing.
[pass-blockmacro]
{passtext}
[pass-inlinemacro]
template::[pass-blockmacro]
[passblock]
|
[filter-image-blockmacro]
# Synthesize missing target attribute for filter generated file names.
# The tag split | ensures missing target file names are auto-generated
# before the filter is executed, the remainder (the [image-blockmacro])
# is excuted after the filter to ensure data URI encoding comes after
# the image is created.
{target%}{counter2:target-number}
{target%}{set2:target:{docname}__{target-number}.png}
|
template::[image-blockmacro]
[+docinfo]
# Blank section to suppress missing template warning.
#----------------------------------
# Default special section templates
#----------------------------------
[abstract]
template::[sect1]
[colophon]
template::[sect1]
[dedication]
template::[sect1]
[preface]
template::[sect1]
[appendix]
template::[sect1]
[glossary]
template::[sect1]
[bibliography]
template::[sect1]
[index]
template::[sect1]
[synopsis]
template::[sect1]
#--------------------------------------------------------------------
# Deprecated old table definitions.
#
[old_tabledef-default]
fillchar=-
format=fixed
[old_tabledef-csv]
fillchar=~
format=csv
[old_tabledef-dsv]
fillchar=_
format=dsv
# End of deprecated old table definitions.
#--------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -1,257 +0,0 @@
#!/usr/bin/env python
"""
asciidocapi - AsciiDoc API wrapper class.
The AsciiDocAPI class provides an API for executing asciidoc. Minimal example
compiles `mydoc.txt` to `mydoc.html`:
import asciidocapi
asciidoc = asciidocapi.AsciiDocAPI()
asciidoc.execute('mydoc.txt')
- Full documentation in asciidocapi.txt.
- See the doctests below for more examples.
Doctests:
1. Check execution:
>>> import StringIO
>>> infile = StringIO.StringIO('Hello *{author}*')
>>> outfile = StringIO.StringIO()
>>> asciidoc = AsciiDocAPI()
>>> asciidoc.options('--no-header-footer')
>>> asciidoc.attributes['author'] = 'Joe Bloggs'
>>> asciidoc.execute(infile, outfile, backend='html4')
>>> print outfile.getvalue()
<p>Hello <strong>Joe Bloggs</strong></p>
>>> asciidoc.attributes['author'] = 'Bill Smith'
>>> infile = StringIO.StringIO('Hello _{author}_')
>>> outfile = StringIO.StringIO()
>>> asciidoc.execute(infile, outfile, backend='docbook')
>>> print outfile.getvalue()
<simpara>Hello <emphasis>Bill Smith</emphasis></simpara>
2. Check error handling:
>>> import StringIO
>>> asciidoc = AsciiDocAPI()
>>> infile = StringIO.StringIO('---------')
>>> outfile = StringIO.StringIO()
>>> asciidoc.execute(infile, outfile)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "asciidocapi.py", line 189, in execute
raise AsciiDocError(self.messages[-1])
AsciiDocError: ERROR: <stdin>: line 1: [blockdef-listing] missing closing delimiter
Copyright (C) 2009 Stuart Rackham. Free use of this software is granted
under the terms of the GNU General Public License (GPL).
"""
import sys,os,re,imp
API_VERSION = '0.1.2'
MIN_ASCIIDOC_VERSION = '8.4.1' # Minimum acceptable AsciiDoc version.
def find_in_path(fname, path=None):
"""
Find file fname in paths. Return None if not found.
"""
if path is None:
path = os.environ.get('PATH', '')
for dir in path.split(os.pathsep):
fpath = os.path.join(dir, fname)
if os.path.isfile(fpath):
return fpath
else:
return None
class AsciiDocError(Exception):
pass
class Options(object):
"""
Stores asciidoc(1) command options.
"""
def __init__(self, values=[]):
self.values = values[:]
def __call__(self, name, value=None):
"""Shortcut for append method."""
self.append(name, value)
def append(self, name, value=None):
if type(value) in (int,float):
value = str(value)
self.values.append((name,value))
class Version(object):
"""
Parse and compare AsciiDoc version numbers. Instance attributes:
string: String version number '<major>.<minor>[.<micro>][suffix]'.
major: Integer major version number.
minor: Integer minor version number.
micro: Integer micro version number.
suffix: Suffix (begins with non-numeric character) is ignored when
comparing.
Doctest examples:
>>> Version('8.2.5') < Version('8.3 beta 1')
True
>>> Version('8.3.0') == Version('8.3. beta 1')
True
>>> Version('8.2.0') < Version('8.20')
True
>>> Version('8.20').major
8
>>> Version('8.20').minor
20
>>> Version('8.20').micro
0
>>> Version('8.20').suffix
''
>>> Version('8.20 beta 1').suffix
'beta 1'
"""
def __init__(self, version):
self.string = version
reo = re.match(r'^(\d+)\.(\d+)(\.(\d+))?\s*(.*?)\s*$', self.string)
if not reo:
raise ValueError('invalid version number: %s' % self.string)
groups = reo.groups()
self.major = int(groups[0])
self.minor = int(groups[1])
self.micro = int(groups[3] or '0')
self.suffix = groups[4] or ''
def __cmp__(self, other):
result = cmp(self.major, other.major)
if result == 0:
result = cmp(self.minor, other.minor)
if result == 0:
result = cmp(self.micro, other.micro)
return result
class AsciiDocAPI(object):
"""
AsciiDoc API class.
"""
def __init__(self, asciidoc_py=None):
"""
Locate and import asciidoc.py.
Initialize instance attributes.
"""
self.options = Options()
self.attributes = {}
self.messages = []
# Search for the asciidoc command file.
# Try ASCIIDOC_PY environment variable first.
cmd = os.environ.get('ASCIIDOC_PY')
if cmd:
if not os.path.isfile(cmd):
raise AsciiDocError('missing ASCIIDOC_PY file: %s' % cmd)
elif asciidoc_py:
# Next try path specified by caller.
cmd = asciidoc_py
if not os.path.isfile(cmd):
raise AsciiDocError('missing file: %s' % cmd)
else:
# Try shell search paths.
for fname in ['asciidoc.py','asciidoc.pyc','asciidoc']:
cmd = find_in_path(fname)
if cmd: break
else:
# Finally try current working directory.
for cmd in ['asciidoc.py','asciidoc.pyc','asciidoc']:
if os.path.isfile(cmd): break
else:
raise AsciiDocError('failed to locate asciidoc')
self.cmd = os.path.realpath(cmd)
self.__import_asciidoc()
def __import_asciidoc(self, reload=False):
'''
Import asciidoc module (script or compiled .pyc).
See
http://groups.google.com/group/asciidoc/browse_frm/thread/66e7b59d12cd2f91
for an explanation of why a seemingly straight-forward job turned out
quite complicated.
'''
if os.path.splitext(self.cmd)[1] in ['.py','.pyc']:
sys.path.insert(0, os.path.dirname(self.cmd))
try:
try:
if reload:
import __builtin__ # Because reload() is shadowed.
__builtin__.reload(self.asciidoc)
else:
import asciidoc
self.asciidoc = asciidoc
except ImportError:
raise AsciiDocError('failed to import ' + self.cmd)
finally:
del sys.path[0]
else:
# The import statement can only handle .py or .pyc files, have to
# use imp.load_source() for scripts with other names.
try:
imp.load_source('asciidoc', self.cmd)
import asciidoc
self.asciidoc = asciidoc
except ImportError:
raise AsciiDocError('failed to import ' + self.cmd)
if Version(self.asciidoc.VERSION) < Version(MIN_ASCIIDOC_VERSION):
raise AsciiDocError(
'asciidocapi %s requires asciidoc %s or better'
% (API_VERSION, MIN_ASCIIDOC_VERSION))
def execute(self, infile, outfile=None, backend=None):
"""
Compile infile to outfile using backend format.
infile can outfile can be file path strings or file like objects.
"""
self.messages = []
opts = Options(self.options.values)
if outfile is not None:
opts('--out-file', outfile)
if backend is not None:
opts('--backend', backend)
for k,v in self.attributes.items():
if v == '' or k[-1] in '!@':
s = k
elif v is None: # A None value undefines the attribute.
s = k + '!'
else:
s = '%s=%s' % (k,v)
opts('--attribute', s)
args = [infile]
# The AsciiDoc command was designed to process source text then
# exit, there are globals and statics in asciidoc.py that have
# to be reinitialized before each run -- hence the reload.
self.__import_asciidoc(reload=True)
try:
try:
self.asciidoc.execute(self.cmd, opts.values, args)
finally:
self.messages = self.asciidoc.messages[:]
except SystemExit, e:
if e.code:
raise AsciiDocError(self.messages[-1])
if __name__ == "__main__":
"""
Run module doctests.
"""
import doctest
options = doctest.NORMALIZE_WHITESPACE + doctest.ELLIPSIS
doctest.testmod(optionflags=options)

View File

@ -1,9 +0,0 @@
#
# Executed by all main.aap's before anything else.
#
_parent.VERS = 8.6.8
_parent.DATE = 17 July 2012
all:
:pass

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
AC_INIT(asciidoc, 8.6.8)
AC_CONFIG_FILES(Makefile)
AC_PROG_SED
AC_PROG_LN_S
AC_PROG_INSTALL
AC_OUTPUT

View File

@ -1,20 +0,0 @@
%%
%% This style is derived from the docbook one.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style]
%% Just use the original package and pass the options.
\RequirePackageWithOptions{docbook}
% Sidebar is a boxed minipage that can contain verbatim.
% Changed shadow box to double box.
\renewenvironment{sidebar}[1][0.95\textwidth]{
\hspace{0mm}\newline%
\noindent\begin{Sbox}\begin{minipage}{#1}%
\setlength\parskip{\medskipamount}%
}{
\end{minipage}\end{Sbox}\doublebox{\TheSbox}%
}
% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`.
\usepackage{alltt}

View File

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
dblatex(1) XSL user stylesheet for asciidoc(1).
See dblatex(1) -p option.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- TOC links in the titles, and in blue. -->
<xsl:param name="latex.hyperparam">colorlinks,linkcolor=blue,pdfstartview=FitH</xsl:param>
<xsl:param name="doc.publisher.show">1</xsl:param>
<xsl:param name="doc.lot.show"></xsl:param>
<xsl:param name="term.breakline">1</xsl:param>
<xsl:param name="doc.collab.show">0</xsl:param>
<xsl:param name="doc.section.depth">3</xsl:param>
<xsl:param name="table.in.float">0</xsl:param>
<xsl:param name="monoseq.hyphenation">0</xsl:param>
<xsl:param name="latex.output.revhistory">1</xsl:param>
<!-- This doesn't work, don't know why, see:
http://dblatex.sourceforge.net/html/manual/apas03.html
./docbook-xsl/common.xsl
-->
<!--
<xsl:param name="doc.toc.show">
<xsl:choose>
<xsl:when test="/processing-instruction('asciidoc-toc')">
1
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="doc.lot.show">
<xsl:choose>
<xsl:when test="/book">
figure,table,equation,example
</xsl:when>
</xsl:choose>
</xsl:param>
-->
<xsl:param name="doc.toc.show">1</xsl:param>
<!--
Override default literallayout template.
See `./dblatex/dblatex-readme.txt`.
-->
<xsl:template match="address|literallayout[@class!='monospaced']">
<xsl:text>\begin{alltt}</xsl:text>
<xsl:text>&#10;\normalfont{}&#10;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&#10;\end{alltt}</xsl:text>
</xsl:template>
<xsl:template match="processing-instruction('asciidoc-pagebreak')">
<!-- force hard pagebreak, varies from 0(low) to 4(high) -->
<xsl:text>\pagebreak[4] </xsl:text>
<xsl:apply-templates />
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="processing-instruction('asciidoc-br')">
<xsl:text>\newline&#10;</xsl:text>
</xsl:template>
<xsl:template match="processing-instruction('asciidoc-hr')">
<!-- draw a 444 pt line (centered) -->
<xsl:text>\begin{center}&#10; </xsl:text>
<xsl:text>\line(1,0){444}&#10; </xsl:text>
<xsl:text>\end{center}&#10; </xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,39 +0,0 @@
AsciiDoc dblatex README
=======================
Customization
-------------
The `./dblatex` directory contains:
`./dblatex/asciidoc-dblatex.xsl`:: Optional dblatex XSL parameter
customization.
`./dblatex/asciidoc-dblatex.sty`:: Optional customized LaTeX styles.
Use these files with dblatex(1) `-p` and `-s` options, for example:
dblatex -p ../dblatex/asciidoc-dblatex.xsl \
-s ../dblatex/asciidoc-dblatex.sty article.xml
Limitations
-----------
Observed in dblatex 0.2.8.
- dblatex doesn't seem to process the DocBook 'literallayout' element
correctly: it is rendered in a monospaced font and no inline
elements are processed. By default the normal font should be used
and almost all DocBook inline elements should be processed
(http://www.docbook.org/tdg/en/html/literallayout.html). I almost
fixed this by overriding the default dblatex literallayout template
(in `./dblatex/asciidoc-dblatex.xsl`) and using the LaTeX 'alltt'
package, but there are remaining problems:
* Blank lines are replaced by a single space.
* The 'literallayout' element incorrectly wraps text when rendered
inside a table.
- Callouts do not work inside DocBook 'literallayout' elements which
means callouts are not displayed inside AsciiDoc literal blocks. A
workaround is to change the AsciiDoc literal block to a listing
block.

View File

@ -1,744 +0,0 @@
'\" t
.\" Title: a2x
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 17 July 2012
.\" Manual: \ \&
.\" Source: \ \& 8.6.8
.\" Language: English
.\"
.TH "A2X" "1" "17 July 2012" "\ \& 8\&.6\&.8" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
a2x \- A toolchain manager for AsciiDoc (converts Asciidoc text files to other file formats)
.SH "SYNOPSIS"
.sp
\fBa2x\fR [\fIOPTIONS\fR] \fISOURCE_FILE\fR
.SH "DESCRIPTION"
.sp
A DocBook toolchain manager that translates an AsciiDoc text file \fISOURCE_FILE\fR to PDF, EPUB, DVI, PS, LaTeX, XHTML (single page or chunked), man page, HTML Help or plain text formats using \fIasciidoc(1)\fR and other applications (see REQUISITES section)\&. \fISOURCE_FILE\fR can also be a DocBook file with an \&.xml extension\&.
.SH "OPTIONS"
.PP
\fB\-a, \-\-attribute\fR=\fIATTRIBUTE\fR
.RS 4
Set asciidoc(1) attribute value (shortcut for
\fB\-\-asciidoc\-opts\fR=\fI"\-a ATTRIBUTE"\fR
option)\&. This option may be specified more than once\&.
.RE
.PP
\fB\-\-asciidoc\-opts\fR=\fIASCIIDOC_OPTS\fR
.RS 4
Additional
\fIasciidoc(1)\fR
options\&. This option may be specified more than once\&.
.RE
.PP
\fB\-\-conf\-file\fR=\fICONF_FILE\fR
.RS 4
Load configuration file\&. See
CONF FILES section\&.
.RE
.PP
\fB\-D, \-\-destination\-dir\fR=\fIDESTINATION_DIR\fR
.RS 4
Output directory\&. Defaults to
\fISOURCE_FILE\fR
directory\&.
.RE
.PP
\fB\-d, \-\-doctype\fR=\fIDOCTYPE\fR
.RS 4
DocBook document type:
\fIarticle\fR,
\fImanpage\fR
or
\fIbook\fR\&. Default document type is
\fIarticle\fR
unless the format is
\fImanpage\fR
(in which case it defaults to
\fImanpage\fR)\&.
.RE
.PP
\fB\-b, \-\-backend\fR=\fIBACKEND\fR
.RS 4
\fIBACKEND\fR
is the name of an installed backend plugin\&. When this option is specified
\fIa2x\fR
attempts load a file name
\fIa2x\-backend\&.py\fR
from the
\fIBACKEND\fR
plugin directory It then converts the
\fISOURCE_FILE\fR
to a
\fIBACKEND\fR
formatted output file using a global function defined in
\fIa2x\-backend\&.py\fR
called
\fIto_BACKEND\fR\&.
.RE
.PP
\fB\-f, \-\-format\fR=\fIFORMAT\fR
.RS 4
Output formats:
\fIchunked\fR,
\fIdocbook\fR,
\fIdvi\fR,
\fIepub\fR,
\fIhtmlhelp\fR,
\fImanpage\fR,
\fIpdf\fR
(default),
\fIps\fR,
\fItex\fR,
\fItext\fR,
\fIxhtml\fR\&. The AsciiDoc
\fIa2x\-format\fR
attribute value is set to
\fIFORMAT\fR\&.
.RE
.PP
\fB\-h, \-\-help\fR
.RS 4
Print command\-line syntax and program options to stdout\&.
.RE
.PP
\fB\-\-icons\fR
.RS 4
Use admonition or navigation icon images in output documents\&. The default behavior is to use text in place of icons\&.
.RE
.PP
\fB\-\-icons\-dir\fR=\fIPATH\fR
.RS 4
A path (relative to output files) containing admonition and navigation icons\&. Defaults to
images/icons\&. The
\fI\-\-icons\fR
option is implicit if this option is used\&.
.RE
.PP
\fB\-k, \-\-keep\-artifacts\fR
.RS 4
Do not delete temporary build files\&.
.RE
.PP
\fB\-\-lynx\fR
.RS 4
Use
\fIlynx(1)\fR
to generate text formatted output\&. The default behavior is to use
\fIw3m(1)\fR\&.
.RE
.PP
\fB\-L, \-\-no\-xmllint\fR
.RS 4
Do not check asciidoc output with
\fIxmllint(1)\fR\&.
.RE
.PP
\fB\-\-\-epubcheck\fR
.RS 4
Check EPUB output with
\fIepubcheck(1)\fR\&.
.RE
.PP
\fB\-n, \-\-dry\-run\fR
.RS 4
Do not do anything just print what would have been done\&.
.RE
.PP
\fB\-r, \-\-resource\fR=\fIRESOURCE_SPEC\fR
.RS 4
Specify a resource\&. This option may be specified more than once\&. See the
\fBRESOURCES\fR
section for more details\&.
.RE
.PP
\fB\-m, \-\-resource\-manifest\fR=\fIFILE\fR
.RS 4
\fIFILE\fR
contains a list resources (one per line)\&. Manifest
\fIFILE\fR
entries are formatted just like
\fB\-\-resource\fR
option arguments\&. Environment variables and tilde home directories are allowed\&.
.RE
.PP
\fB\-\-stylesheet\fR=\fISTYLESHEET\fR
.RS 4
A space delimited list of one or more CSS stylesheet file names that are used to style HTML output generated by DocBook XSL Stylesheets\&. Defaults to
\fIdocbook\-xsl\&.css\fR\&. The stylesheets are processed in list order\&. The stylesheets must reside in a valid
resource file
location\&. Applies to HTML formats:
\fIxhtml\fR,
\fIepub\fR,
\fIchunked\fR,
\fIhtmlhelp\fR
formats\&.
.RE
.PP
\fB\-v, \-\-verbose\fR
.RS 4
Print operational details to stderr\&. A second
\fB\-v\fR
option applies the verbose option to toolchain commands\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print program version to stdout\&.
.RE
.PP
\fB\-\-xsltproc\-opts\fR=\fIXSLTPROC_OPTS\fR
.RS 4
Additional
\fIxsltproc(1)\fR
options\&. This option may be specified more than once\&.
.RE
.PP
\fB\-\-xsl\-file\fR=\fIXSL_FILE\fR
.RS 4
Override the built\-in XSL stylesheet with the custom XSL stylesheet
\fIXSL_FILE\fR\&.
.RE
.PP
\fB\-\-fop\fR
.RS 4
Use FOP to generate PDFs\&. The default behavior is to use
\fIdblatex(1)\fR\&. The
\fI\-\-fop\fR
option is implicit if this option is used\&.
.RE
.PP
\fB\-\-fop\-opts\fR=\fIFOP_OPTS\fR
.RS 4
Additional
\fIfop(1)\fR
options\&. If this option is specified FOP is used to generate PDFs\&. This option may be specified more than once\&.
.RE
.PP
\fB\-\-dblatex\-opts\fR=\fIDBLATEX_OPTS\fR
.RS 4
Additional
\fIdblatex(1)\fR
options\&. This option may be specified more than once\&.
.RE
.PP
\fB\-\-backend\-opts\fR=\fIBACKEND_OPTS\fR
.RS 4
Options for the backend plugin specified by the
\fI\-\-backend\fR
option\&. This option may be specified more than once\&.
.RE
.sp
Options can also be set in the AsciiDoc source file\&. If \fISOURCE_FILE\fR contains a comment line beginning with \fB// a2x:\fR then the remainder of the line will be treated as \fIa2x\fR command\-line options\&. For example:
.sp
.if n \{\
.RS 4
.\}
.nf
// a2x default options\&.
// a2x: \-dbook \-\-epubcheck
// Suppress revision history in dblatex outputs\&.
// a2x: \-\-dblatex\-opts "\-P latex\&.output\&.revhistory=0"
.fi
.if n \{\
.RE
.\}
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Options spanning multiple such comment lines will be concatenated\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Zero or more white space characters can appear between the leading
\fB//\fR
and
\fBa2x:\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Command\-line options take precedence over options set in the source file\&.
.RE
.SH "OUTPUT FILES"
.sp
Output files are written to the directory specified by the \fB\-\-destination\-dir\fR option\&. If no \fB\-\-destination\-dir\fR option is set output files are written to the \fISOURCE_FILE\fR directory\&.
.sp
Output files have the same name as the \fISOURCE_FILE\fR but with an appropriate file name extension: \&.html for \fIxhtml\fR; \&.epub for \fIepub\fR; \&.hhp for \fIhtmlhelp\fR; \&.pdf for \fIpdf\fR; \&.text for \fItext\fR, \&.xml for \fIdocbook\fR\&. By convention manpages have no \&.man extension (man page section number only)\&. Chunked HTML directory names have a \&.chunked extension; chunked HTML Help directory names have a \&.htmlhelp extension\&.
.sp
Same named existing files are overwritten\&.
.sp
In addition to generating HTML files the \fIxhtml\fR, \fIepub\fR, \fIchunked\fR and \fIhtmlhelp\fR formats ensure resource files are copied to their correct destination directory locations\&.
.SH "RESOURCES"
.sp
Resources are files (typically CSS and images) that are required by HTML based outputs (\fIxhtml\fR, \fIepub\fR, \fIchunked\fR, \fIhtmlhelp\fR formats)\&. \fIa2x\fR scans the generated HTML files and builds a list of required CSS and image files\&. Additional resource files can be specified explicitly using the \fB\-\-resource\fR option\&.
.sp
\fIa2x\fR searches for resource files in the following locations in the following order:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
The
\fISOURCE_FILE\fR
directory\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
Resource directories specified by the
\fB\-\-resource\fR
option (searched recursively)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
Resource directories specified by the
\fB\-\-resource\-manifest\fR
option (searched recursively in the order they appear in the manifest file)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
The stock
images
and
stylesheets
directories in the
\fIasciidoc(1)\fR
configuration files directories (searched recursively)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 5.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 5." 4.2
.\}
The destination directory\&.
.RE
.sp
When a resource file is found it is copied to the correct relative destination directory\&. Missing destination sub\-directories are created automatically\&.
.sp
There are two distinct mechanisms for specifying additional resources:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
A resource directory which will be searched recursively for missing resource files\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
A resource file which will be copied to the output destination directory\&.
.RE
.sp
Resources are specified with \fB\-\-resource\fR option values which can be one of the following formats:
.sp
.if n \{\
.RS 4
.\}
.nf
<resource_dir>
<resource_file>[=<destination_file>]
\&.<ext>=<mimetype>
.fi
.if n \{\
.RE
.\}
.sp
Where:
.PP
<resource_dir>
.RS 4
Specifies a directory (absolute or relative to the
\fISOURCE_FILE\fR) which is searched recursively for missing resource files\&. To eliminate ambiguity the
<resource_dir>
name should end with a directory separator character\&.
.RE
.PP
<resource_file>
.RS 4
Specifies a resource file (absolute or relative to the
\fISOURCE_FILE\fR) which will be copied to
<destination_file>\&. If
<destination_file>
is not specified then it is the same as the
<resource_file>\&.
.RE
.PP
<destination_file>
.RS 4
Specifies the destination of the copied source file\&. The
<destination_file>
path is relative to the destination directory (absolute paths are not allowed)\&. The location of the destination directory depends on the output
\fIFORMAT\fR
(see the
\fBOUTPUT FILES\fR
section for details):
.PP
chunked, htmlhelp
.RS 4
The chunked output directory\&.
.RE
.PP
epub
.RS 4
The archived
OEBPS
directory\&.
.RE
.PP
xhtml
.RS 4
The output
\fBDESTINATION_DIR\fR\&.
.RE
.RE
.PP
\&.<ext>=<mimetype>
.RS 4
When adding resources to EPUB files the mimetype is inferred from the
<destination file>
extension, if the mimetype cannot be guessed an error occurs\&. The
\&.<ext>=<mimetype>
resource syntax can be used to explicitly set mimetypes\&.
<ext>
is the file name extension,
<mimetype>
is the corresponding MIME type\&.
.RE
.sp
Resource option examples:
.sp
.if n \{\
.RS 4
.\}
.nf
\-\-resource \&.\&./images/
\-\-resource doc/README\&.txt=README\&.txt
\-\-resource ~/images/tiger\&.png=images/tiger\&.png
\-\-resource \&.ttf=application/x\-font\-ttf
.fi
.if n \{\
.RE
.\}
.SH "EXAMPLES"
.PP
a2x \-f pdf doc/source\-highlight\-filter\&.txt
.RS 4
Generates
doc/source\-highlight\-filter\&.pdf
file\&.
.RE
.PP
a2x \-f xhtml \-D \&.\&./doc \-\-icons \-r \&.\&./images/ team\&.txt
.RS 4
Creates HTML file
\&.\&./doc/team\&.html, uses admonition icons and recursively searches the
\&.\&./images/
directory for any missing resources\&.
.RE
.PP
a2x \-f manpage doc/asciidoc\&.1\&.txt
.RS 4
Generate
doc/asciidoc\&.1
manpage\&.
.RE
.SH "REQUISITES"
.sp
\fIa2x\fR uses the following programs:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBAsciidoc\fR:
http://www\&.methods\&.co\&.nz/asciidoc/
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBxsltproc\fR: (all formats except text):
http://xmlsoft\&.org/XSLT/
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBDocBook XSL Stylesheets\fR
(all formats except text):
http://docbook\&.sourceforge\&.net/projects/xsl/
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBdblatex\fR
(pdf, dvi, ps, tex formats):
http://dblatex\&.sourceforge\&.net/
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBFOP\fR
(pdf format \(em alternative PDF file generator):
http://xmlgraphics\&.apache\&.org/fop/
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBw3m\fR
(text format):
http://w3m\&.sourceforge\&.net/index\&.en\&.html
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBLynx\fR
(text format \(em alternative text file generator):
http://lynx\&.isc\&.org/
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBepubcheck\fR
(epub format \(em EPUB file validator):
http://code\&.google\&.com/p/epubcheck/
.RE
.sp
See also the latest README file\&.
.SH "CONF FILES"
.sp
A configuration file contains executable Python code that overrides the global configuration parameters in a2x\&.py\&. Optional configuration files are loaded in the following order:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
a2x\&.conf
from the directory containing the
\fIa2x\&.py\fR
executable\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
a2x\&.conf
from the AsciiDoc global configuration directory\&. Skip this step if we are executing a locally installed (non system wide) copy\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
a2x\&.conf
from the AsciiDoc
$HOME/\&.asciidoc
configuration directory\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
The
\fICONF_FILE\fR
specified in the
\fI\-\-conf\-file\fR
option\&.
.RE
.sp
Here are the default configuration file option values:
.sp
.if n \{\
.RS 4
.\}
.nf
# Optional environment variable dictionary passed to
# executing programs\&. If set to None the existing
# environment is used\&.
ENV = None
# External executables\&.
ASCIIDOC = \*(Aqasciidoc\*(Aq
XSLTPROC = \*(Aqxsltproc\*(Aq
DBLATEX = \*(Aqdblatex\*(Aq # pdf generation\&.
FOP = \*(Aqfop\*(Aq # pdf generation (\-\-fop option)\&.
W3M = \*(Aqw3m\*(Aq # text generation\&.
LYNX = \*(Aqlynx\*(Aq # text generation (if no w3m)\&.
XMLLINT = \*(Aqxmllint\*(Aq # Set to \*(Aq\*(Aq to disable\&.
EPUBCHECK = \*(Aqepubcheck\*(Aq # Set to \*(Aq\*(Aq to disable\&.
# External executable default options\&.
ASCIIDOC_OPTS = \*(Aq\*(Aq
DBLATEX_OPTS = \*(Aq\*(Aq
FOP_OPTS = \*(Aq\*(Aq
XSLTPROC_OPTS = \*(Aq\*(Aq
.fi
.if n \{\
.RE
.\}
.SH "BUGS"
.sp
See the AsciiDoc distribution BUGS file\&.
.SH "AUTHOR"
.sp
a2x was originally written by Stuart Rackham\&. Many people have contributed to it\&.
.SH "RESOURCES"
.sp
SourceForge: http://sourceforge\&.net/projects/asciidoc/
.sp
Main web site: http://www\&.methods\&.co\&.nz/asciidoc/
.SH "COPYING"
.sp
Copyright (C) 2002\-2011 Stuart Rackham\&. Free use of this software is granted under the terms of the MIT license\&.

View File

@ -1,358 +0,0 @@
A2X(1)
======
:doctype: manpage
NAME
----
a2x - A toolchain manager for AsciiDoc (converts Asciidoc text files to other
file formats)
SYNOPSIS
--------
*a2x* ['OPTIONS'] 'SOURCE_FILE'
DESCRIPTION
-----------
A DocBook toolchain manager that translates an AsciiDoc text file
'SOURCE_FILE' to PDF, EPUB, DVI, PS, LaTeX, XHTML (single page or
chunked), man page, HTML Help or plain text formats using
'asciidoc(1)' and other applications (see <<X1,REQUISITES section>>).
'SOURCE_FILE' can also be a DocBook file with an .xml extension.
OPTIONS
-------
*-a, --attribute*='ATTRIBUTE'::
Set asciidoc(1) attribute value (shortcut for *--asciidoc-opts*='"-a
ATTRIBUTE"' option).
This option may be specified more than once.
*--asciidoc-opts*='ASCIIDOC_OPTS'::
Additional 'asciidoc(1)' options.
This option may be specified more than once.
*--conf-file*='CONF_FILE'::
Load configuration file. See <<X2,CONF FILES section>>.
*-D, --destination-dir*='DESTINATION_DIR'::
Output directory. Defaults to 'SOURCE_FILE' directory.
*-d, --doctype*='DOCTYPE'::
DocBook document type: 'article', 'manpage' or 'book'. Default
document type is 'article' unless the format is 'manpage' (in which
case it defaults to 'manpage').
*-b, --backend*='BACKEND'::
'BACKEND' is the name of an installed backend plugin. When this
option is specified 'a2x' attempts load a file name 'a2x-backend.py'
from the 'BACKEND' plugin directory It then converts the
'SOURCE_FILE' to a 'BACKEND' formatted output file using a global
function defined in 'a2x-backend.py' called 'to_BACKEND'.
*-f, --format*='FORMAT'::
Output formats: 'chunked', 'docbook', 'dvi', 'epub', 'htmlhelp',
'manpage', 'pdf' (default), 'ps', 'tex', 'text', 'xhtml'.
The AsciiDoc 'a2x-format' attribute value is set to 'FORMAT'.
*-h, --help*::
Print command-line syntax and program options to stdout.
*--icons*::
Use admonition or navigation icon images in output documents. The
default behavior is to use text in place of icons.
*--icons-dir*='PATH'::
A path (relative to output files) containing admonition
and navigation icons. Defaults to `images/icons`.
The '--icons' option is implicit if this option is used.
*-k, --keep-artifacts*::
Do not delete temporary build files.
*--lynx*::
Use 'lynx(1)' to generate text formatted output. The default
behavior is to use 'w3m(1)'.
*-L, --no-xmllint*::
Do not check asciidoc output with 'xmllint(1)'.
*---epubcheck*::
Check EPUB output with 'epubcheck(1)'.
*-n, --dry-run*::
Do not do anything just print what would have been done.
*-r, --resource*='RESOURCE_SPEC'::
Specify a resource. This option may be specified more than once.
See the <<X3,*RESOURCES*>> section for more details.
*-m, --resource-manifest*='FILE'::
'FILE' contains a list resources (one per line). Manifest 'FILE'
entries are formatted just like *--resource* option arguments.
Environment variables and tilde home directories are allowed.
*--stylesheet*='STYLESHEET'::
A space delimited list of one or more CSS stylesheet file names that
are used to style HTML output generated by DocBook XSL Stylesheets.
Defaults to 'docbook-xsl.css'. The stylesheets are processed in
list order. The stylesheets must reside in a valid <<X3, resource
file>> location. Applies to HTML formats: 'xhtml', 'epub',
'chunked', 'htmlhelp' formats.
*-v, --verbose*::
Print operational details to stderr.
A second *-v* option applies the verbose option to toolchain commands.
*--version*::
Print program version to stdout.
*--xsltproc-opts*='XSLTPROC_OPTS'::
Additional 'xsltproc(1)' options.
This option may be specified more than once.
*--xsl-file*='XSL_FILE'::
Override the built-in XSL stylesheet with the custom XSL stylesheet
'XSL_FILE'.
*--fop*::
Use FOP to generate PDFs. The default behavior is to use
'dblatex(1)'. The '--fop' option is implicit if this option is
used.
*--fop-opts*='FOP_OPTS'::
Additional 'fop(1)' options. If this option is specified FOP is used
to generate PDFs.
This option may be specified more than once.
*--dblatex-opts*='DBLATEX_OPTS'::
Additional 'dblatex(1)' options.
This option may be specified more than once.
*--backend-opts*='BACKEND_OPTS'::
Options for the backend plugin specified by the '--backend' option.
This option may be specified more than once.
Options can also be set in the AsciiDoc source file. If 'SOURCE_FILE'
contains a comment line beginning with *// a2x:* then the remainder of
the line will be treated as 'a2x' command-line options. For example:
// a2x default options.
// a2x: -dbook --epubcheck
// Suppress revision history in dblatex outputs.
// a2x: --dblatex-opts "-P latex.output.revhistory=0"
- Options spanning multiple such comment lines will be concatenated.
- Zero or more white space characters can appear between the leading
*//* and *a2x:*.
- Command-line options take precedence over options set in the source
file.
[[X4]]
OUTPUT FILES
------------
Output files are written to the directory specified by the
*--destination-dir* option. If no *--destination-dir* option is set
output files are written to the 'SOURCE_FILE' directory.
Output files have the same name as the 'SOURCE_FILE' but with an
appropriate file name extension: `.html` for 'xhtml'; `.epub` for
'epub'; `.hhp` for 'htmlhelp'; `.pdf` for 'pdf'; `.text` for 'text',
`.xml` for 'docbook'. By convention manpages have no `.man` extension
(man page section number only). Chunked HTML directory names have a
`.chunked` extension; chunked HTML Help directory names have a
`.htmlhelp` extension.
Same named existing files are overwritten.
In addition to generating HTML files the 'xhtml', 'epub', 'chunked'
and 'htmlhelp' formats ensure <<X3,resource files>> are copied to
their correct destination directory locations.
[[X3]]
RESOURCES
---------
Resources are files (typically CSS and images) that are required by
HTML based outputs ('xhtml', 'epub', 'chunked', 'htmlhelp' formats).
'a2x' scans the generated HTML files and builds a list of required CSS
and image files. Additional resource files can be specified explicitly
using the *--resource* option.
'a2x' searches for resource files in the following locations in the
following order:
. The 'SOURCE_FILE' directory.
. Resource directories specified by the *--resource* option (searched
recursively).
. Resource directories specified by the *--resource-manifest* option
(searched recursively in the order they appear in the manifest
file).
. The stock `images` and `stylesheets` directories in the
'asciidoc(1)' configuration files directories (searched
recursively).
. The destination directory.
When a resource file is found it is copied to the correct relative
destination directory. Missing destination sub-directories are created
automatically.
There are two distinct mechanisms for specifying additional resources:
. A resource directory which will be searched recursively for missing
resource files.
. A resource file which will be copied to the output destination
directory.
Resources are specified with *--resource* option values which can be
one of the following formats:
<resource_dir>
<resource_file>[=<destination_file>]
.<ext>=<mimetype>
Where:
`<resource_dir>`::
Specifies a directory (absolute or relative to the 'SOURCE_FILE')
which is searched recursively for missing resource files. To
eliminate ambiguity the `<resource_dir>` name should end with a
directory separator character.
`<resource_file>`::
Specifies a resource file (absolute or relative to the
'SOURCE_FILE') which will be copied to `<destination_file>`. If
`<destination_file>` is not specified then it is the same as the
`<resource_file>`.
`<destination_file>`::
Specifies the destination of the copied source file. The
`<destination_file>` path is relative to the destination directory
(absolute paths are not allowed). The location of the destination
directory depends on the output 'FORMAT' (see the <<X4,*OUTPUT
FILES*>> section for details):
chunked, htmlhelp;; The chunked output directory.
epub;; The archived `OEBPS` directory.
xhtml;; The output *DESTINATION_DIR*.
`.<ext>=<mimetype>`::
When adding resources to EPUB files the mimetype is inferred from
the `<destination file>` extension, if the mimetype cannot be
guessed an error occurs. The `.<ext>=<mimetype>` resource syntax can
be used to explicitly set mimetypes. `<ext>` is the file name
extension, `<mimetype>` is the corresponding MIME type.
Resource option examples:
--resource ../images/
--resource doc/README.txt=README.txt
--resource ~/images/tiger.png=images/tiger.png
--resource .ttf=application/x-font-ttf
EXAMPLES
--------
`a2x -f pdf doc/source-highlight-filter.txt`::
Generates `doc/source-highlight-filter.pdf` file.
`a2x -f xhtml -D ../doc --icons -r ../images/ team.txt`::
Creates HTML file `../doc/team.html`, uses admonition icons and
recursively searches the `../images/` directory for any missing
resources.
`a2x -f manpage doc/asciidoc.1.txt`::
Generate `doc/asciidoc.1` manpage.
[[X1]]
REQUISITES
----------
'a2x' uses the following programs:
- *Asciidoc*:
http://www.methods.co.nz/asciidoc/
- *xsltproc*: (all formats except text):
http://xmlsoft.org/XSLT/
- *DocBook XSL Stylesheets* (all formats except text):
http://docbook.sourceforge.net/projects/xsl/
- *dblatex* (pdf, dvi, ps, tex formats):
http://dblatex.sourceforge.net/
- *FOP* (pdf format -- alternative PDF file generator):
http://xmlgraphics.apache.org/fop/
- *w3m* (text format):
http://w3m.sourceforge.net/index.en.html
- *Lynx* (text format -- alternative text file generator):
http://lynx.isc.org/
- *epubcheck* (epub format -- EPUB file validator):
http://code.google.com/p/epubcheck/
See also the latest README file.
[[X2]]
CONF FILES
----------
A configuration file contains executable Python code that overrides
the global configuration parameters in `a2x.py`. Optional configuration
files are loaded in the following order:
. `a2x.conf` from the directory containing the 'a2x.py' executable.
. `a2x.conf` from the AsciiDoc global configuration directory. Skip
this step if we are executing a locally installed (non system wide)
copy.
. `a2x.conf` from the AsciiDoc `$HOME/.asciidoc` configuration
directory.
. The 'CONF_FILE' specified in the '--conf-file' option.
Here are the default configuration file option values:
---------------------------------------------------------------------
# Optional environment variable dictionary passed to
# executing programs. If set to None the existing
# environment is used.
ENV = None
# External executables.
ASCIIDOC = 'asciidoc'
XSLTPROC = 'xsltproc'
DBLATEX = 'dblatex' # pdf generation.
FOP = 'fop' # pdf generation (--fop option).
W3M = 'w3m' # text generation.
LYNX = 'lynx' # text generation (if no w3m).
XMLLINT = 'xmllint' # Set to '' to disable.
EPUBCHECK = 'epubcheck' # Set to '' to disable.
# External executable default options.
ASCIIDOC_OPTS = ''
DBLATEX_OPTS = ''
FOP_OPTS = ''
XSLTPROC_OPTS = ''
---------------------------------------------------------------------
BUGS
----
See the AsciiDoc distribution BUGS file.
AUTHOR
------
a2x was originally written by Stuart Rackham. Many people have
contributed to it.
RESOURCES
---------
SourceForge: http://sourceforge.net/projects/asciidoc/
Main web site: http://www.methods.co.nz/asciidoc/
COPYING
-------
Copyright \(C) 2002-2011 Stuart Rackham. Free use of this software is
granted under the terms of the MIT license.

View File

@ -1,87 +0,0 @@
<!--
article-docinfo.xml
Example DocBook document information file for article.txt.
-->
<authorgroup>
<author>
<honorific>Dr</honorific>
<firstname>Lois</firstname>
<surname>Common-Demoninator</surname>
<affiliation>
<shortaffil>Director, M. Behn School of Coop. Eng.</shortaffil>
<jobtitle>Director of Cooperative Efforts</jobtitle>
<orgname>The Marguerite Behn International School of
Cooperative Engineering</orgname>
</affiliation>
</author>
<author>
<honorific>Mr</honorific>
<firstname>Steven</firstname>
<surname>Norman</surname>
<othername role='mi'>T</othername>
<affiliation>
<shortaffil>ATI</shortaffil>
<jobtitle>Senior Application Analyst</jobtitle>
<orgname>Foobar, Inc.</orgname>
<orgdiv>Application Development</orgdiv>
</affiliation>
</author>
<editor>
<firstname>Peter</firstname>
<surname>Pan</surname>
<lineage>Sr.</lineage>
<othername>Spiderman</othername>
<authorblurb>
<para>
Peter's a super hero in his spare time.
</para>
</authorblurb>
</editor>
</authorgroup>
<copyright>
<year>2009</year>
<holder>Behn International</holder>
</copyright>
<legalnotice>
<simpara>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
</simpara>
<simpara>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
</simpara>
<simpara>
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</simpara>
</legalnotice>
<revhistory>
<revision>
<revnumber>1.1</revnumber>
<date>May 2009</date>
<authorinitials>PP</authorinitials>
<revremark>
Updates.
</revremark>
</revision>
<revision>
<revnumber>1.0</revnumber>
<date>October 2003</date>
<authorinitials>PP</authorinitials>
<revremark>
First release.
</revremark>
</revision>
</revhistory>

View File

@ -1,139 +0,0 @@
The Article Title
=================
Author's Name <authors@email.address>
v1.0, 2003-12
This is the optional preamble (an untitled section body). Useful for
writing simple sectionless documents consisting only of a preamble.
NOTE: The abstract, preface, appendix, bibliography, glossary and
index section titles are significant ('specialsections').
:numbered!:
[abstract]
Example Abstract
----------------
The optional abstract (one or more paragraphs) goes here.
This document is an AsciiDoc article skeleton containing briefly
annotated element placeholders plus a couple of example index entries
and footnotes.
:numbered:
The First Section
-----------------
Article sections start at level 1 and can be nested up to four levels
deep.
footnote:[An example footnote.]
indexterm:[Example index entry]
And now for something completely different: ((monkeys)), lions and
tigers (Bengal and Siberian) using the alternative syntax index
entries.
(((Big cats,Lions)))
(((Big cats,Tigers,Bengal Tiger)))
(((Big cats,Tigers,Siberian Tiger)))
Note that multi-entry terms generate separate index entries.
Here are a couple of image examples: an image:images/smallnew.png[]
example inline image followed by an example block image:
.Tiger block image
image::images/tiger.png[Tiger image]
Followed by an example table:
.An example table
[width="60%",options="header"]
|==============================================
| Option | Description
| -a 'USER GROUP' | Add 'USER' to 'GROUP'.
| -R 'GROUP' | Disables access to 'GROUP'.
|==============================================
.An example example
===============================================
Lorum ipum...
===============================================
[[X1]]
Sub-section with Anchor
~~~~~~~~~~~~~~~~~~~~~~~
Sub-section at level 2.
A Nested Sub-section
^^^^^^^^^^^^^^^^^^^^
Sub-section at level 3.
Yet another nested Sub-section
++++++++++++++++++++++++++++++
Sub-section at level 4.
This is the maximum sub-section depth supported by the distributed
AsciiDoc configuration.
footnote:[A second example footnote.]
The Second Section
------------------
Article sections are at level 1 and can contain sub-sections nested up
to four deep.
An example link to anchor at start of the <<X1,first sub-section>>.
indexterm:[Second example index entry]
An example link to a bibliography entry <<taoup>>.
:numbered!:
[appendix]
Example Appendix
----------------
AsciiDoc article appendices are just just article sections with
'specialsection' titles.
Appendix Sub-section
~~~~~~~~~~~~~~~~~~~~
Appendix sub-section at level 2.
[bibliography]
Example Bibliography
--------------------
The bibliography list is a style of AsciiDoc bulleted list.
[bibliography]
- [[[taoup]]] Eric Steven Raymond. 'The Art of Unix
Programming'. Addison-Wesley. ISBN 0-13-142901-9.
- [[[walsh-muellner]]] Norman Walsh & Leonard Muellner.
'DocBook - The Definitive Guide'. O'Reilly & Associates. 1999.
ISBN 1-56592-580-7.
[glossary]
Example Glossary
----------------
Glossaries are optional. Glossaries entries are an example of a style
of AsciiDoc labeled lists.
[glossary]
A glossary term::
The corresponding (indented) definition.
A second glossary term::
The corresponding (indented) definition.
ifdef::backend-docbook[]
[index]
Example Index
-------------
////////////////////////////////////////////////////////////////
The index is normally left completely empty, it's contents being
generated automatically by the DocBook toolchain.
////////////////////////////////////////////////////////////////
endif::backend-docbook[]

View File

@ -1,310 +0,0 @@
'\" t
.\" Title: asciidoc
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 17 July 2012
.\" Manual: \ \&
.\" Source: \ \& 8.6.8
.\" Language: English
.\"
.TH "ASCIIDOC" "1" "17 July 2012" "\ \& 8\&.6\&.8" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
asciidoc \- converts an AsciiDoc text file to HTML or DocBook
.SH "SYNOPSIS"
.sp
\fBasciidoc\fR [\fIOPTIONS\fR] \fIFILE\fR
.SH "DESCRIPTION"
.sp
The asciidoc(1) command translates the AsciiDoc text file \fIFILE\fR to DocBook or HTML\&. If \fIFILE\fR is \fI\-\fR then the standard input is used\&.
.SH "OPTIONS"
.PP
\fB\-a, \-\-attribute\fR=\fIATTRIBUTE\fR
.RS 4
Define or delete document attribute\&.
\fIATTRIBUTE\fR
is formatted like
\fINAME=VALUE\fR\&. Command\-line attributes take precedence over document and configuration file attributes\&. Alternate acceptable forms are
\fINAME\fR
(the
\fIVALUE\fR
defaults to an empty string);
\fINAME!\fR
(delete the
\fINAME\fR
attribute);
\fINAME=VALUE@\fR
(do not override document or configuration file attributes)\&. Values containing spaces should be enclosed in double\-quote characters\&. This option may be specified more than once\&. A special attribute named
\fItrace\fR
controls the output of diagnostic information\&.
.RE
.PP
\fB\-b, \-\-backend\fR=\fIBACKEND\fR
.RS 4
Backend output file format:
\fIdocbook45\fR,
\fIxhtml11\fR,
\fIhtml4\fR,
\fIhtml5\fR,
\fIslidy\fR,
\fIwordpress\fR
or
\fIlatex\fR
(the
\fIlatex\fR
backend is experimental)\&. You can also use the backend alias names
\fIhtml\fR
(aliased to
\fIxhtml11\fR) or
\fIdocbook\fR
(aliased to
\fIdocbook45\fR)\&. Defaults to
\fIhtml\fR\&. The
\fB\-\-backend\fR
option is also used to manage backend plugins (see
\fBPLUGIN COMMANDS\fR)\&.
.RE
.PP
\fB\-f, \-\-conf\-file\fR=\fICONF_FILE\fR
.RS 4
Use configuration file
\fICONF_FILE\fR\&.Configuration files processed in command\-line order (after implicit configuration files)\&. This option may be specified more than once\&.
.RE
.PP
\fB\-\-doctest\fR
.RS 4
Run Python doctests in
\fIasciidoc\fR
module\&.
.RE
.PP
\fB\-d, \-\-doctype\fR=\fIDOCTYPE\fR
.RS 4
Document type:
\fIarticle\fR,
\fImanpage\fR
or
\fIbook\fR\&. The
\fIbook\fR
document type is only supported by the
\fIdocbook\fR
backend\&. Default document type is
\fIarticle\fR\&.
.RE
.PP
\fB\-c, \-\-dump\-conf\fR
.RS 4
Dump configuration to stdout\&.
.RE
.PP
\fB\-\-filter\fR=\fIFILTER\fR
.RS 4
Specify the name of a filter to be loaded (used to load filters that are not auto\-loaded)\&. This option may be specified more than once\&. The
\fB\-\-filter\fR
option is also used to manage filter plugins (see
\fBPLUGIN COMMANDS\fR)\&.
.RE
.PP
\fB\-h, \-\-help\fR [\fITOPIC\fR]
.RS 4
Print help TOPIC\&.
\fB\-\-help\fR
\fItopics\fR
will print a list of help topics,
\fB\-\-help\fR
\fIsyntax\fR
summarizes AsciiDoc syntax,
\fB\-\-help\fR
\fImanpage\fR
prints the AsciiDoc manpage\&.
.RE
.PP
\fB\-e, \-\-no\-conf\fR
.RS 4
Exclude implicitly loaded configuration files except for those named like the input file (\fIinfile\&.conf\fR
and
\fIinfile\-backend\&.conf\fR)\&.
.RE
.PP
\fB\-s, \-\-no\-header\-footer\fR
.RS 4
Suppress document header and footer output\&.
.RE
.PP
\fB\-o, \-\-out\-file\fR=\fIOUT_FILE\fR
.RS 4
Write output to file
\fIOUT_FILE\fR\&. Defaults to the base name of input file with
\fIbackend\fR
extension\&. If the input is stdin then the outfile defaults to stdout\&. If
\fIOUT_FILE\fR
is
\fI\-\fR
then the standard output is used\&.
.RE
.PP
\fB\-n, \-\-section\-numbers\fR
.RS 4
Auto\-number HTML article section titles\&. Synonym for
\fB\-\-attribute numbered\fR\&.
.RE
.PP
\fB\-\-safe\fR
.RS 4
Enable safe mode\&. Safe mode is disabled by default\&. AsciiDoc
\fIsafe mode\fR
skips potentially dangerous scripted sections in AsciiDoc source files\&.
.RE
.PP
\fB\-\-theme\fR=\fITHEME\fR
.RS 4
Specify a theme name\&. Synonym for
\fB\-\-attribute theme\fR=\fITHEME\fR\&. The
\fB\-\-theme\fR
option is also used to manage theme plugins (see
\fBPLUGIN COMMANDS\fR)\&.
.RE
.PP
\fB\-v, \-\-verbose\fR
.RS 4
Verbosely print processing information and configuration file checks to stderr\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print program version number\&.
.RE
.SH "PLUGIN COMMANDS"
.sp
The asciidoc(1) \fB\-\-filter\fR, \fB\-\-backend\fR and \fB\-\-theme\fR options are used to install, remove and list AsciiDoc filter, backend and theme plugins\&. Syntax:
.sp
.if n \{\
.RS 4
.\}
.nf
asciidoc OPTION install ZIP_FILE [PLUGINS_DIR]
asciidoc OPTION remove PLUGIN_NAME [PLUGINS_DIR]
asciidoc OPTION list
asciidoc OPTION build ZIP_FILE PLUGIN_SOURCE
.fi
.if n \{\
.RE
.\}
.sp
Where:
.PP
\fBOPTION\fR
.RS 4
asciidoc(1)
\fB\-\-filter\fR,
\fB\-\-backend\fR
or
\fB\-\-theme\fR
option specifying the type of plugin\&.
.RE
.PP
\fBPLUGIN_NAME\fR
.RS 4
A unique plugin name containing only alphanumeric or underscore characters\&.
.RE
.PP
\fBZIP_FILE\fR
.RS 4
A Zip file containing plugin resources, the name must start with the plugin name e\&.g\&.
my_filter\-1\&.0\&.zip
packages filter
my_filter\&.
.RE
.PP
\fBPLUGINS_DIR\fR
.RS 4
The directory containing installed plugins\&. Each plugin is contained in its own separate subdirectory which has the same name as the plugin\&.
\fBPLUGINS_DIR\fR
defaults to the
$HOME/\&.asciidoc/filters
(for filter plugins) or
$HOME/\&.asciidoc/backends
(for backend plugins) or
$HOME/\&.asciidoc/themes
(for theme plugins)\&.
.RE
.PP
\fBPLUGIN_SOURCE\fR
.RS 4
The name of a directory containing the plugin source files or the name of a single source file\&.
.RE
.sp
The plugin commands perform as follows:
.PP
\fBinstall\fR
.RS 4
Create a subdirectory in
\fBPLUGINS_DIR\fR
with the same name as the plugin then extract the
\fBZIP_FILE\fR
into it\&.
.RE
.PP
\fBremove\fR
.RS 4
Delete the
\fBPLUGIN_NAME\fR
plugin subdirectory and all its contents from the
\fBPLUGINS_DIR\fR\&.
.RE
.PP
\fBlist\fR
.RS 4
List the names and locations of all installed filter or theme plugins (including standard plugins installed in the global configuration directory)\&.
.RE
.PP
\fBbuild\fR
.RS 4
Create a plugin file named
\fBZIP_FILE\fR
containing the files and subdirectories specified by
\fBPLUGIN_SOURCE\fR\&. File and directory names starting with a period are skipped\&.
.RE
.SH "EXIT STATUS"
.PP
\fB0\fR
.RS 4
Success
.RE
.PP
\fB1\fR
.RS 4
Failure (syntax or usage error; configuration error; document processing failure; unexpected error)\&.
.RE
.SH "BUGS"
.sp
See the AsciiDoc distribution BUGS file\&.
.SH "AUTHOR"
.sp
AsciiDoc was originally written by Stuart Rackham\&. Many people have contributed to it\&.
.SH "RESOURCES"
.sp
SourceForge: http://sourceforge\&.net/projects/asciidoc/
.sp
Main web site: http://www\&.methods\&.co\&.nz/asciidoc/
.SH "COPYING"
.sp
Copyright (C) 2002\-2011 Stuart Rackham\&. Free use of this software is granted under the terms of the GNU General Public License (GPL)\&.

View File

@ -1,197 +0,0 @@
ASCIIDOC(1)
===========
:doctype: manpage
NAME
----
asciidoc - converts an AsciiDoc text file to HTML or DocBook
SYNOPSIS
--------
*asciidoc* ['OPTIONS'] 'FILE'
DESCRIPTION
-----------
The asciidoc(1) command translates the AsciiDoc text file 'FILE' to
DocBook or HTML. If 'FILE' is '-' then the standard input is used.
OPTIONS
-------
*-a, --attribute*='ATTRIBUTE'::
Define or delete document attribute. 'ATTRIBUTE' is formatted like
'NAME=VALUE'. Command-line attributes take precedence over
document and configuration file attributes. Alternate acceptable
forms are 'NAME' (the 'VALUE' defaults to an empty string);
'NAME!' (delete the 'NAME' attribute); 'NAME=VALUE@' (do not override
document or configuration file attributes). Values containing
spaces should be enclosed in double-quote characters. This option
may be specified more than once. A special attribute named
'trace' controls the output of diagnostic information.
*-b, --backend*='BACKEND'::
Backend output file format: 'docbook45', 'xhtml11', 'html4',
'html5', 'slidy', 'wordpress' or 'latex' (the 'latex' backend is
experimental). You can also use the backend alias names 'html'
(aliased to 'xhtml11') or 'docbook' (aliased to 'docbook45').
Defaults to 'html'. The *--backend* option is also used to manage
backend plugins (see <<X1,*PLUGIN COMMANDS*>>).
*-f, --conf-file*='CONF_FILE'::
Use configuration file 'CONF_FILE'.Configuration files processed
in command-line order (after implicit configuration files). This
option may be specified more than once.
*--doctest*::
Run Python doctests in 'asciidoc' module.
*-d, --doctype*='DOCTYPE'::
Document type: 'article', 'manpage' or 'book'. The 'book' document
type is only supported by the 'docbook' backend. Default document
type is 'article'.
*-c, --dump-conf*::
Dump configuration to stdout.
*--filter*='FILTER'::
Specify the name of a filter to be loaded (used to load filters
that are not auto-loaded). This option may be specified more than
once. The *--filter* option is also used to manage filter plugins
(see <<X1,*PLUGIN COMMANDS*>>).
*-h, --help* ['TOPIC']::
Print help TOPIC. *--help* 'topics' will print a list of help
topics, *--help* 'syntax' summarizes AsciiDoc syntax,
*--help* 'manpage' prints the AsciiDoc manpage.
*-e, --no-conf*::
Exclude implicitly loaded configuration files except for those
named like the input file ('infile.conf' and
'infile-backend.conf').
*-s, --no-header-footer*::
Suppress document header and footer output.
*-o, --out-file*='OUT_FILE'::
Write output to file 'OUT_FILE'. Defaults to the base name of
input file with 'backend' extension. If the input is stdin then
the outfile defaults to stdout. If 'OUT_FILE' is '-' then the
standard output is used.
*-n, --section-numbers*::
Auto-number HTML article section titles. Synonym for
*--attribute numbered*.
*--safe*::
Enable safe mode. Safe mode is disabled by default. AsciiDoc
'safe mode' skips potentially dangerous scripted sections in
AsciiDoc source files.
*--theme*='THEME'::
Specify a theme name. Synonym for *--attribute theme*='THEME'.
The *--theme* option is also used to manage theme plugins (see
<<X1,*PLUGIN COMMANDS*>>).
*-v, --verbose*::
Verbosely print processing information and configuration file
checks to stderr.
*--version*::
Print program version number.
[[X1]]
PLUGIN COMMANDS
---------------
The asciidoc(1) *--filter*, *--backend* and *--theme* options are used
to install, remove and list AsciiDoc filter, backend and theme
plugins. Syntax:
asciidoc OPTION install ZIP_FILE [PLUGINS_DIR]
asciidoc OPTION remove PLUGIN_NAME [PLUGINS_DIR]
asciidoc OPTION list
asciidoc OPTION build ZIP_FILE PLUGIN_SOURCE
Where:
*OPTION*::
asciidoc(1) *--filter*, *--backend* or *--theme* option specifying
the type of plugin.
*PLUGIN_NAME*::
A unique plugin name containing only alphanumeric or underscore
characters.
*ZIP_FILE*::
A Zip file containing plugin resources, the name must start with the
plugin name e.g. `my_filter-1.0.zip` packages filter `my_filter`.
*PLUGINS_DIR*::
The directory containing installed plugins. Each plugin is contained
in its own separate subdirectory which has the same name as the
plugin.
*PLUGINS_DIR* defaults to the `$HOME/.asciidoc/filters` (for
filter plugins) or `$HOME/.asciidoc/backends` (for backend plugins) or
`$HOME/.asciidoc/themes` (for theme plugins).
*PLUGIN_SOURCE*::
The name of a directory containing the plugin source files or the
name of a single source file.
The plugin commands perform as follows:
*install*::
Create a subdirectory in *PLUGINS_DIR* with the same name as the
plugin then extract the *ZIP_FILE* into it.
*remove*::
Delete the *PLUGIN_NAME* plugin subdirectory and all its contents
from the *PLUGINS_DIR*.
*list*::
List the names and locations of all installed filter or theme
plugins (including standard plugins installed in the global
configuration directory).
*build*::
Create a plugin file named *ZIP_FILE* containing the files and
subdirectories specified by *PLUGIN_SOURCE*. File and directory
names starting with a period are skipped.
EXIT STATUS
-----------
*0*::
Success
*1*::
Failure (syntax or usage error; configuration error; document
processing failure; unexpected error).
BUGS
----
See the AsciiDoc distribution BUGS file.
AUTHOR
------
AsciiDoc was originally written by Stuart Rackham. Many people have
contributed to it.
RESOURCES
---------
SourceForge: <http://sourceforge.net/projects/asciidoc/>
Main web site: <http://www.methods.co.nz/asciidoc/>
COPYING
-------
Copyright \(C) 2002-2011 Stuart Rackham. Free use of this software is
granted under the terms of the GNU General Public License (GPL).

View File

@ -1,7 +0,0 @@
#
# Customization for AsciiDoc documentation.
#
[specialwords]
ifndef::doctype-manpage[]
monospacedwords=(?u)\\?\basciidoc\(1\) (?u)\\?\ba2x\(1\)
endif::doctype-manpage[]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,189 +0,0 @@
AsciiDoc API
============
'asciidocapi' -- a Python API module for 'AsciiDoc'.
Introduction
------------
The 'asciidocapi' module implements a Python API for AsciiDoc. It
allows you to set `asciidoc(1)` program options, compile an AsciiDoc
source file and then interrogate the results. The `asciidocapi.py`
module file contains the `AsciiDocAPI` wrapper class for
`asciidoc.py`.
.Benefits
- Stable API Shields the user from the undocumented and possibly
volatile `asciidoc.py` internals.
- Easier to use and more flexible than the alternative of running
`asciidoc(1)` as a separate process.
- Executes inside your application (better performance than running
separate `asciidoc(1)` command processes).
Using asciidocapi
-----------------
To use the API just drop the `asciidocapi.py` file into your
application directory, import it and use the `AsciiDocAPI` class. The
only requirement is that a compatible version of 'AsciiDoc' is already
installed -- simple, no setuptools to run, no Eggs to install, no
non-standard library dependencies.
You can find `asciidocapi.py` in the AsciiDoc
http://www.methods.co.nz/asciidoc/INSTALL.html#X1[distribution
archives] (version 8.4.1 or better).
Once you have `asciidocapi.py` Verify everything is working by running
the module doctests:
python asciidocapi.py
If there are no messages then all is well.
The following minimal example compiles `mydoc.txt` to `mydoc.html`:
[source,python]
-------------------------------------------------------------------------------
from asciidocapi import AsciiDocAPI
asciidoc = AsciiDocAPI()
asciidoc.execute('mydoc.txt')
-------------------------------------------------------------------------------
The next interactive example uses file-like objects for input and output:
-------------------------------------------------------------------------------
$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from asciidocapi import AsciiDocAPI
>>> import StringIO
>>> infile = StringIO.StringIO('Hello *{author}*')
>>> outfile = StringIO.StringIO()
>>> asciidoc = AsciiDocAPI()
>>> asciidoc.options('--no-header-footer')
>>> asciidoc.attributes['author'] = 'Joe Bloggs'
>>> asciidoc.execute(infile, outfile, backend='html4')
>>> print outfile.getvalue()
<p>Hello <strong>Joe Bloggs</strong></p>
>>>
-------------------------------------------------------------------------------
Implementation Rationale
------------------------
.Leverage existing knowledge
The API maps directly onto the `asciidoc(1)` command -- this is
deliberate -- if you know the `asciidoc(1)` command learning the API
will be trivial. A nice side effect of this goal is that API and
command-line modes share the same code -- virtually no `asciidoc(1)`
code is specific to API usage.
.Simplicity
Implemented with a single Python module file (`asciidocapi.py`)
containing the 'AsciiDocAPI' API class. 'AsciiDocAPI' contains just
one method plus a few attributes for processing options and result
messages. No external setup tools and no non-standard library
dependencies are used or required.
.Loose coupling
The dependency between `asciidocapi.py` and `asciidoc.py` is minimal
-- the current `asciidocapi.py` module uses only two attributes and
one function from the `asciidoc.py` module.
.Why isn't the API baked right into the asciidoc.py command script?
1. You can't just drop `asciidoc.py` into your application because it
requires all the related config files and filters -- complex and
unnecessary since all this was already done when you installed
AsciiDoc.
2. This scheme separates the API from the AsciiDoc application -- the
API implementation can be extended or replaced independently of
AsciiDoc.
API reference
-------------
[[X2]]
Class `AsciiDocAPI(object)`
~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is the 'AsciiDoc' API class.
Instance attributes
^^^^^^^^^^^^^^^^^^^
`asciidoc`::
The imported `asciidoc.py` module.
`attributes`::
A dictionary of AsciiDoc attribute values passed to AsciiDoc.
- Setting an attribute value to `None` (`name: None`) will undefine
(delete) the attribute (this in addition to the `name!` attribute
name format that the `asciidoc(1)` command uses).
- To simply define an attribute set the attribute value to a blank
string (`name: ''`)
`cmd`::
The file path of the `asciidoc.py` script. Set by the `__init__`
method.
`messages`::
A chronologically ordered list of message strings generated during
AsciiDoc execution (last message at the end of the list).
`options`::
An instance of the <<X1,Options class>>. Contains a list of command
options passed to AsciiDoc.
Instance methods
^^^^^^^^^^^^^^^^
`__init__(self, asciidoc_py=None)`::
Locate and import `asciidoc.py` module and verify API compatibility.
Initialize instance attributes. A search for the `asciidoc` module is
made in the following order:
. Use the `ASCIIDOC_PY` environment variable if it is set.
. Use the `asciidoc_py` argument if it is set.
. Search the environment 'PATH' for `asciidoc.py`, `asciidoc.pyc` and
`asciidoc` (in that order).
. Finally repeat the previous search in the current working directory.
`execute(self, infile, outfile=None, backend=None)`::
Compile `infile` to `outfile` using `backend` format. `infile` and
`outfile` can be file path strings or file-like objects. `backend` is
name of 'AsciiDoc' backend (takes same values as `asciidoc(1)` command
`--backend` option). If `outfile` or `backend` are `None` then their
respective `asciidoc(1)` defaults are used.
[[X1]]
Class `Options(object)`
~~~~~~~~~~~~~~~~~~~~~~~
Stores `asciidoc(1)` command options. You can use any `asciidoc(1)`
options with the exception of the `--doctest` and `--filter` options.
Instance attributes
^^^^^^^^^^^^^^^^^^^
`values`::
The list of `(name,value)` command option tuples.
Instance methods
^^^^^^^^^^^^^^^^
`__call__(self, name, value=None)`::
A shortcut for the `append` method. Example:
opts = Options()
opts('--verbose')
`append(self, name, value=None)`::
Append `(name,value)` to the options list. Example:
opts = Options()
opts.append('--conf-file', 'blog.conf')
Class `AsciiDocError(Exception)`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thrown by the <<X2,AsciiDocAPI class>> when an 'AsciiDoc' execution
error occurs.

View File

@ -1,61 +0,0 @@
ASCIIMathML Formulae
====================
http://www1.chapman.edu/~jipsen/mathml/asciimath.html[ASCIIMathML] is
a clever JavaScript written by Peter Jipsen that dynamically
transforms mathematical formulae written in a wiki-like plain text
markup to http://www.w3.org/Math/[MathML] markup which is displayed as
standard mathematical notation by the Web Browser. See 'Appendix E'
in the AsciiDoc User Guide for more details.
The AsciiDoc `xhtml11` backend supports ASCIIMathML -- it links the
ASCIIMathML script and escapes ASCIIMathML delimiters and special
characters to yield valid XHTML. To use ASCIIMathML:
1. Include the `-a asciimath` command-line option when you run
`asciidoc(1)`.
2. Enclose ASCIIMathML formulas inside math or double-dollar
passthroughs or in math passthrough blocks.
Here's the link:asciimathml.txt[AsciiDoc source] that generated this
page.
.NOTE
- When you use the `asciimath:[]` inline macro you need to escape `]`
characters in the formulas with a backslash, escaping is unnecessary
if you use the double-dollar macro (for examples see the second
formula below).
- See the
http://www1.chapman.edu/~jipsen/mathml/asciimath.html[ASCIIMathML]
website for ASCIIMathML documentation and the latest version.
- If the formulas don't appear to be correct you probably need to
install the correct math fonts (see the
http://www1.chapman.edu/~jipsen/mathml/asciimath.html[ASCIIMathML]
website for details).
- See the link:latexmathml.html[LaTeXMathML page] if you prefer to use
LaTeX math formulas.
A list of example formulas:
- $$`[[a,b],[c,d]]((n),(k))`$$
- asciimath:[x/x={(1,if x!=0),(text{undefined},if x=0):}]
- asciimath:[d/dxf(x)=lim_(h->0)(f(x+h)-f(x))/h]
- +++`sum_(i=1)\^n i=(n(n+1))/2`$+++ and *bold
asciimath:[int_0\^(pi/2) sinx\ dx=1]*
- asciimath:[(a,b\]={x in RR : a < x <= b}]
- asciimath:[x^2+y_1+z_12^34]
*********************************************************************
The first three terms factor to give
asciimath:[(x+b/(2a))^2=(b^2)/(4a^2)-c/a].
asciimath:[x+b/(2a)=+-sqrt((b^2)/(4a^2)-c/a)].
Now we take square roots on both sides and get
asciimath:[x+b/(2a)=+-sqrt((b^2)/(4a^2)-c/a)].
Finally we move the asciimath:[b/(2a)] to the right and simplify to
get the two solutions:
*asciimath:[x_(1,2)=(-b+-sqrt(b^2-4ac))/(2a)]*.
*********************************************************************

View File

@ -1,181 +0,0 @@
Multi-Part Book Title Goes Here
===============================
Author's Name
v1.0, 2003-12
:doctype: book
[dedication]
Example Dedication
==================
The optional dedication goes here.
This document is an AsciiDoc multi-part book skeleton containing
briefly annotated element placeholders plus a couple of example index
entries and footnotes. Books are normally used to generate DocBook
markup and the preface, appendix, bibliography, glossary and index
section titles are significant ('specialsections').
NOTE: Multi-part books differ from all other AsciiDoc document formats
in that top level sections (dedication, preface, book parts,
appendices, bibliography, glossary, index) must be level zero headings
(not level one).
[preface]
Example Preface
================
The optional book preface goes here at section level zero.
Preface Sub-section
~~~~~~~~~~~~~~~~~~~
NOTE: Preface and appendix subsections start out of sequence at level
2 (level 1 is skipped). This only applies to multi-part book
documents.
The First Part of the Book
==========================
[partintro]
.Optional part introduction title
--
Optional part introduction goes here.
--
The First Chapter
-----------------
Chapters can be grouped by preceeding them with a level 0 Book Part
title.
Book chapters are at level 1 and can contain sub-sections nested up to
three deep.
footnote:[An example footnote.]
indexterm:[Example index entry]
It's also worth noting that a book part can have it's own preface,
bibliography, glossary and index. Chapters can have their own
bibliography, glossary and index.
And now for something completely different: ((monkeys)), lions and
tigers (Bengal and Siberian) using the alternative syntax index
entries.
(((Big cats,Lions)))
(((Big cats,Tigers,Bengal Tiger)))
(((Big cats,Tigers,Siberian Tiger)))
Note that multi-entry terms generate separate index entries.
Here are a couple of image examples: an image:images/smallnew.png[]
example inline image followed by an example block image:
.Tiger block image
image::images/tiger.png[Tiger image]
Followed by an example table:
.An example table
[width="60%",options="header"]
|==============================================
| Option | Description
| -a 'USER GROUP' | Add 'USER' to 'GROUP'.
| -R 'GROUP' | Disables access to 'GROUP'.
|==============================================
.An example example
===============================================
Lorum ipum...
===============================================
[[X1]]
Sub-section with Anchor
~~~~~~~~~~~~~~~~~~~~~~~
Sub-section at level 2.
Chapter Sub-section
^^^^^^^^^^^^^^^^^^^
Sub-section at level 3.
Chapter Sub-section
+++++++++++++++++++
Sub-section at level 4.
This is the maximum sub-section depth supported by the distributed
AsciiDoc configuration.
footnote:[A second example footnote.]
The Second Chapter
------------------
An example link to anchor at start of the <<X1,first sub-section>>.
indexterm:[Second example index entry]
An example link to a bibliography entry <<taoup>>.
The Second Part of the Book
===========================
The First Chapter of the Second Part
------------------------------------
Chapters grouped into book parts are at level 1 and can contain
sub-sections.
:numbered!:
[appendix]
Example Appendix
================
One or more optional appendixes go here at section level zero.
Appendix Sub-section
~~~~~~~~~~~~~~~~~~~
NOTE: Preface and appendix subsections start out of sequence at level
2 (level 1 is skipped). This only applies to multi-part book
documents.
[bibliography]
Example Bibliography
====================
The bibliography list is a style of AsciiDoc bulleted list.
[bibliography]
- [[[taoup]]] Eric Steven Raymond. 'The Art of Unix
Programming'. Addison-Wesley. ISBN 0-13-142901-9.
- [[[walsh-muellner]]] Norman Walsh & Leonard Muellner.
'DocBook - The Definitive Guide'. O'Reilly & Associates. 1999.
ISBN 1-56592-580-7.
[glossary]
Example Glossary
================
Glossaries are optional. Glossaries entries are an example of a style
of AsciiDoc labeled lists.
[glossary]
A glossary term::
The corresponding (indented) definition.
A second glossary term::
The corresponding (indented) definition.
[colophon]
Example Colophon
================
Text at the end of a book describing facts about its production.
[index]
Example Index
=============
////////////////////////////////////////////////////////////////
The index is normally left completely empty, it's contents are
generated automatically by the DocBook toolchain.
////////////////////////////////////////////////////////////////

View File

@ -1,156 +0,0 @@
Book Title Goes Here
====================
Author's Name
v1.0, 2003-12
:doctype: book
[dedication]
Example Dedication
------------------
Optional dedication.
This document is an AsciiDoc book skeleton containing briefly
annotated example elements plus a couple of example index entries and
footnotes.
Books are normally used to generate DocBook markup and the titles of
the preface, appendix, bibliography, glossary and index sections are
significant ('specialsections').
[preface]
Example Preface
---------------
Optional preface.
Preface Sub-section
~~~~~~~~~~~~~~~~~~~
Preface sub-section body.
The First Chapter
-----------------
Chapters can contain sub-sections nested up to three deep.
footnote:[An example footnote.]
indexterm:[Example index entry]
Chapters can have their own bibliography, glossary and index.
And now for something completely different: ((monkeys)), lions and
tigers (Bengal and Siberian) using the alternative syntax index
entries.
(((Big cats,Lions)))
(((Big cats,Tigers,Bengal Tiger)))
(((Big cats,Tigers,Siberian Tiger)))
Note that multi-entry terms generate separate index entries.
Here are a couple of image examples: an image:images/smallnew.png[]
example inline image followed by an example block image:
.Tiger block image
image::images/tiger.png[Tiger image]
Followed by an example table:
.An example table
[width="60%",options="header"]
|==============================================
| Option | Description
| -a 'USER GROUP' | Add 'USER' to 'GROUP'.
| -R 'GROUP' | Disables access to 'GROUP'.
|==============================================
.An example example
===============================================
Lorum ipum...
===============================================
[[X1]]
Sub-section with Anchor
~~~~~~~~~~~~~~~~~~~~~~~
Sub-section at level 2.
Chapter Sub-section
^^^^^^^^^^^^^^^^^^^
Sub-section at level 3.
Chapter Sub-section
+++++++++++++++++++
Sub-section at level 4.
This is the maximum sub-section depth supported by the distributed
AsciiDoc configuration.
footnote:[A second example footnote.]
The Second Chapter
------------------
An example link to anchor at start of the <<X1,first sub-section>>.
indexterm:[Second example index entry]
An example link to a bibliography entry <<taoup>>.
The Third Chapter
-----------------
Book chapters are at level 1 and can contain sub-sections.
:numbered!:
[appendix]
Example Appendix
----------------
One or more optional appendixes go here at section level 1.
Appendix Sub-section
~~~~~~~~~~~~~~~~~~~
Sub-section body.
[bibliography]
Example Bibliography
--------------------
The bibliography list is a style of AsciiDoc bulleted list.
[bibliography]
.Books
- [[[taoup]]] Eric Steven Raymond. 'The Art of Unix
Programming'. Addison-Wesley. ISBN 0-13-142901-9.
- [[[walsh-muellner]]] Norman Walsh & Leonard Muellner.
'DocBook - The Definitive Guide'. O'Reilly & Associates. 1999.
ISBN 1-56592-580-7.
[bibliography]
.Articles
- [[[abc2003]]] Gall Anonim. 'An article', Whatever. 2003.
[glossary]
Example Glossary
----------------
Glossaries are optional. Glossaries entries are an example of a style
of AsciiDoc labeled lists.
[glossary]
A glossary term::
The corresponding (indented) definition.
A second glossary term::
The corresponding (indented) definition.
[colophon]
Example Colophon
----------------
Text at the end of a book describing facts about its production.
[index]
Example Index
-------------
////////////////////////////////////////////////////////////////
The index is normally left completely empty, it's contents being
generated automatically by the DocBook toolchain.
////////////////////////////////////////////////////////////////

View File

@ -1,18 +0,0 @@
"AROUT","Around the Horn","Thomas Hardy","120 Hanover Sq.
London","(171) 555-7788"
"BERGS","Berglunds snabbkop","Christina Berglund","Berguvsvagen 8
Lulea","0921-12 34 65"
"BLAUS","Blauer See Delikatessen","Hanna Moos","Forsterstr. 57
Mannheim","0621-08460"
"BLONP","Blondel pere et fils","Frederique Citeaux","24, place Kleber
Strasbourg","88.60.15.31"
"BOLID","Bolido Comidas preparadas","Martin Sommer","C/ Araquil, 67
Madrid","(91) 555 22 82"
"BONAP","Bon app'","Laurence Lebihan","12, rue des Bouchers
Marseille","91.24.45.40"
"BOTTM","Bottom-Dollar Markets","Elizabeth Lincoln","23 Tsawassen Blvd.
Tsawassen","(604) 555-4729"
"BSBEV","B's Beverages","Victoria Ashworth","Fauntleroy Circus
London","(171) 555-1212"
"CACTU","Cactus Comidas para llevar","Patricio Simpson","Cerrito 333
Buenos Aires","(1) 135-5555"
1 AROUT Around the Horn Thomas Hardy 120 Hanover Sq. London (171) 555-7788
2 BERGS Berglunds snabbkop Christina Berglund Berguvsvagen 8 Lulea 0921-12 34 65
3 BLAUS Blauer See Delikatessen Hanna Moos Forsterstr. 57 Mannheim 0621-08460
4 BLONP Blondel pere et fils Frederique Citeaux 24, place Kleber Strasbourg 88.60.15.31
5 BOLID Bolido Comidas preparadas Martin Sommer C/ Araquil, 67 Madrid (91) 555 22 82
6 BONAP Bon app' Laurence Lebihan 12, rue des Bouchers Marseille 91.24.45.40
7 BOTTM Bottom-Dollar Markets Elizabeth Lincoln 23 Tsawassen Blvd. Tsawassen (604) 555-4729
8 BSBEV B's Beverages Victoria Ashworth Fauntleroy Circus London (171) 555-1212
9 CACTU Cactus Comidas para llevar Patricio Simpson Cerrito 333 Buenos Aires (1) 135-5555

View File

@ -1,210 +0,0 @@
AsciiDoc EPUB Notes
===================
Restrictions
------------
- If the date format of the DocBook 'data' element is not formatted like
`YYYY[-MM[-DD]]` you will get an error like the following one when
validating with `epubcheck(1)`:
ERROR: doc/article.epub/OEBPS/content.opf(6): date value 'Dec 2003'
is not valid, YYYY[-MM[-DD]] expected
- Navigation headers are suppressed by `docbook-xsl/epub.xsl` (see
<<X3,bug report>>).
DocBook XSL Stylesheets related limitations and bugs
----------------------------------------------------
=== epub: toc.section.depth parameter ignored
https://sourceforge.net/tracker/?func=detail&aid=3043393&group_id=21935&atid=373747
epub outputs include every section in the table of contents regardless of the
toc.section.depth XSL Stylesheets parameter
(http://docbook.sourceforge.net/release/xsl/current/doc/html/toc.section.depth.html).
This behavior is specific to epub (xhtml and fo outputs honor
toc.section.depth).
Environment: DocBook XSL 1.75.2; Xubuntu 10.04
Also epub/docbook.xsl has written a hard-coded illegal dtb:depth value of -1
into the toc.ncx navigation control file:
<ncx:meta name="dtb:depth" content="-1"/>
Shouldn't it be a positive integer equal to the depth navPoint nesting in the
navMap element (see
http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NavMeta)? Though epubcheck 1.05 doesn't flag it as invalid -- are they both wrong?
[[X1]]
=== epub: untitled DocBook sidebar emits invalid XHTML
https://sourceforge.net/tracker/index.php?func=detail&aid=2840768&group_id=21935&atid=373747
I get the same problem, but is confined to EPUB outputs (not XHTML)
and results in the sidebar and all subsequent text on the page
displayed in bold text in both Firefox 3.6.8 and Google Chrome
5.0.375.125 (I haven't checked other browsers).
Environment: DocBook XSL 1.75.2; Xubuntu 10.04
If a DocBook sidebar element does not have a title then the emitted
title is (I haven't checked other browsers).
set to <b/> instead of <b></b>, for example this DocBook markup:
<sidebar>
<simpara>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</simpara>
</sidebar>
Generates this EPUB XHTML:
<div class="sidebar"><p class="title"><b/></p><p>Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.</p></div>
This problem is not picked up by either the epubcheck or the W3C
validators.
The problem does not occur generating XHTML which emits the following
for the above example:
<div class="sidebar"><p class="title"><b></b></p><p>Lorem ipsum
dolor sit amet, consectetuer adipiscing elit.</p></div>
=== epub: Unreferenced callout icons in OPF
NOTE: A workaround for this problem was added in `a2x(1)` version
8.6.5.
https://sourceforge.net/tracker/?func=detail&aid=2854075&group_id=21935&atid=373747
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
When callouts are used in a document and callout graphics are disabled
(callout.graphics=0) the generated 'contents.opf' still contains
references to all the callout icons even though none are not
referenced in the generated XHTML content. This results in 10
epubcheck validation errors like:
image file OEBPS/images/icons/callouts/1.png is missing
It appears that epub is adding the icons to the OPF without
first checking the callout.graphics parameter.
=== epub: Table grids not generated
https://sourceforge.net/tracker/?func=detail&aid=2849647&group_id=21935&atid=373747
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
DocBook XSL epub does not appear to process the DocBook table element rowsep
and colsep attributes -- table grids are not displayed. The DocBook
<table rowsep="1" colsep="1"> results in:
epub DocBook XSL generates:
<td style="text-align: left" valign="top">
i.e. epub is not generating CSS borders (same for generated th elements).
Compare this with the (correct) xhtml DocBook XSL generates the correct border
styles:
<td style="border-right: 1px solid ; border-bottom: 1px solid ; " align="left" valign="top">
=== epub: htmltoc is not generated
https://sourceforge.net/tracker/?func=detail&aid=2849686&group_id=21935&atid=373747
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
If DocBook XSL TOC generation is specified the generated
'contents.opf' contains an 'htmltoc' element but the referenced TOC file
is not generated by DocBook XSL. For example the contents.opf contains:
<item id="htmltoc" media-type="application/xhtml+xml" href="ar01-toc.html"/>
but the actual TOC file `OEBPS/ar01-toc.html` is missing and epubcheck
generates validation errors like:
ERROR: doc/article.epub: OPS/XHTML file OEBPS/ar01-toc.html is missing
=== epub: leading dot in directory name error
https://sourceforge.net/tracker/?func=detail&aid=2849683&group_id=21935&atid=373747
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
Specifying paths with a leading dot causes problems, for example:
<xsl:param name="html.stylesheet" select="'./docbook-xsl.css'"/>
This generates validation errors like:
ERROR: article.epub/OEBPS/index.html(4):
'OEBPS/./docbook-xsl.css': referenced resource missing in the package
The file is in the archive at the correct location, just doesn't
seem to like './' in the path name -- the path needs to be normalized
before being written to the contents.opf.
It's not just the validator, the file is missing when the EPUB is viewed
(in bookworm).
This works fine:
<xsl:param name="html.stylesheet" select="'docbook-xsl.css'"/>
[[X2]]
=== epub: admonition icon images missing from contents.opf
NOTE: A workaround for this problem was added in `a2x(1)` version
8.6.5.
https://sourceforge.net/tracker/?func=detail&aid=2849681&group_id=21935&atid=373747
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
When admonition icons are specified epubcheck generates validation
errors like:
ERROR: article.epub/OEBPS/index.html(4):
'OEBPS/images/icons/note.png': referenced resource exists,
but not declared in the OPF file
i.e. The admonition icon is in the EPUB file but DocBook XSL has not
been added to the content.opf manifest. Compare this with callout icons
which are processed correctly.
[[X3]]
=== Table width attribute validation error
https://sourceforge.net/tracker/?func=detail&aid=2848734&group_id=21935&atid=373747
Environment: DocBook XSL 1.75.2; Xubuntu 8.04
I get the following validation errors when navigation headers are in
included in the generated XHTML:
ERROR: article.epub/OEBPS/ix01.html(3): attribute "width" not allowed
at this point; ignored
This is because DocBook XSL has emitted invalid XHTML 1.1: tables
using the 'width' element are generated automatically in navigation
headers.
Though, admittedly, navigation is redundant if you're reading with an
EPUB reader. Suppress by setting the suppress.navigation param to 1.
Is this a DocBook XSL bug?
The Linux zip(1) command
------------------------
If you use the Linux `zip(1)` command to update or create EPUB files
you must use the `-X`, `--no-extra` command-line option, if you do not
the platform dependent extra fields will confuse `epubcheck(1)` which
will emit errors like ``extra field length for first filename must be
0, but was 28''.

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
Replaced the plain DocBook XSL admonition icons with Jimmac's DocBook
icons (http://jimmac.musichall.cz/ikony.php3). I dropped transparency
from the Jimmac icons to get round MS IE and FOP PNG incompatibilies.
Stuart Rackham

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -1,192 +0,0 @@
LaTeX backend for Asciidoc
==========================
Benjamin Klum <benjamin.klum@gmail.com>
v1.0, June 2006
== Introduction
LaTeX backend is a configuration file for Stuart Rackham's http://www.methods.co.nz/asciidoc/[Asciidoc]. It generates high-level LaTeX markup from Asciidoc documents. LaTeX is a document preparation system for TeX which in turn is a popular typesetting system. It is well known for producing excellently typesetted high quality printouts, especially suited for scientific text.
== Tutorial
Getting a ready-to-print document from an Asciidoc document using the LaTeX backend involves at least two steps:
1. Conversion of the Asciidoc document into a LaTeX document (this is done by Asciidoc using the LaTeX backend)
2. Conversion of the LaTeX document into a PDF document (this is done by the TeX system)
Try to create a PDF document from the Asciidoc document `article.txt` which resides in the `doc` directory of Asciidoc:
.. Make a copy of `article.txt` in a directory of your choice, let's call it `latex-test`.
.. Make sure that all images referenced in `article.txt` exist in `latex-test`. Brute force approach: Copy the whole `images` directory from Asciidoc directory into `latex-test`.
.. Change directory to `latex-test` and type following commands:
+
asciidoc --unsafe --backend=latex article.txt
pdflatex article.tex
+
.. Now there should be a file `article.pdf` in the `latex-test` directory.
[IMPORTANT]
==============================
- Asciidoc has to be started in 'unsafe mode' when using LaTeX backend.
- Note that some special LaTeX packages are necessary, see <<packageRequirements,here>>.
==============================
== General notes
=== Quality of LaTeX output
High-level LaTeX is not very straightforward to generate. Therefore there's no guarantee that the generated output is valid and compiles successfully. At all, this backend should be considered as rather experimental. You should have been already in touch with LaTeX in order to use the backend effectively because LaTeX compilation errors can be really nasty.
Nevertheless good results can be achieved by using LaTeX backend. Try for example to compile Stuart Rackham's Asciidoc documentation, a rather large document. It should compile without problems. However, the code filter might have to be reconfigured for the code filter example to work.
=== Configuration file customization
Like every other Asciidoc backend the LaTeX backend can be customized easily to fit the user's needs. Actually it is very important to have this option since LaTeX doesn't have a companion language like CSS which allows to put styling information in a separate file. Read more about the LaTeX backend configuration file <<configurationFile,here>>.
=== Output optimization
The LaTeX output is optimized for creating PDF documents using 'pdflatex'.
[[unicodeSupport]]
=== Unicode support
Unfortunately TeX/LaTeX does not have native unicode support. The package 'ucs' adds elementary unicode support by introducing UTF-8 input encoding recognition and by defining lookup tables which contain the corresponding LaTeX commands for unicode characters. But these lookup tables are far from being complete. When a unicode character is found which is not defined in the lookup tables an error is raised by the TeX/LaTeX compiler. Note that TeX/LaTeX compilation errors caused by missing unicode character definitions are not fatal, that means the result is probably readable but undefined unicode characters are replaced with `[U+...]`. You may (de)activate the recognition of escaped unicode characters. See the <<latex-recognize-escaped-unicode>> backend option.
== Backend specific features
=== Special sections
LaTeX backend supports the following special sections and replaces them with corresponding LaTeX commands or environments:
- Abstract (only for document type 'article')
- Dedication (only for document type 'book')
- Index
- Bibliography (only when the attribute 'latex-use-bibliography-environment' is set)
- Appendix
- Contents
[[internalCrossReferences]]
=== Internal cross references
Macros for internal cross references have been extended by the attribute 'style'.
xref:<id>[<caption>, style=<style>]
or
<<<id>,<caption>,<style>>>
The additional attribute 'style' can have following values:
page::
Let's LaTeX print the page number of the referenced anchor.
ref::
Let's LaTeX print the number of the section, subsection, figure, table or theorem the referenced anchor resides.
autoref::
Let's LaTeX print the number of the section, subsection, figure, table or theorem the referenced anchor resides preceded with a contextual label.
cite::
Let's LaTeX interprete this reference as a reference to a bibliography entry. If the attribute 'latex-use-bibliography-environment' is set, references with 'cite' style as well as their corresponding bibliography anchors are presented as automatically generated numbers.
If the 'style' attribute is not set the reference is printed the common way.
=== Options
LaTeX document generation is influenced by the following attributes:
latex-table-rowlimit::
The maximum number of rows for typesetting tables using the 'tabular' environment. If a table has more rows than 'latex-table-rowlimit', 'longtable' environment is used instead of 'tabular' environment. 'longtable' environment supports tables spanning over several pages.
latex-use-bibliography-environment::
If 'latex-use-bibliography-environment' is defined, 'thebibliography' environment is used for the bibliography section. As a result bibliography entries are automatically numbered. Note that this works only if the bibliography section contains exclusively bibliography list items which start with a bibliography entry ([[[...]]]). Otherwise a TeX/LaTeX compilation error will occur. In order to display bibliography references correctly their 'style' attribute must be set to 'cite'. For more information see <<internalCrossReferences,Internal cross references>>.
latex-indent-paragraphs::
If 'latex-indent-paragraphs' is defined, the first line of paragraphs will be indented. By default LaTeX backend prevents paragraph indentation and prints paragraphs with preceding vertical space.
[[latex-recognize-escaped-unicode]] latex-recognize-escaped-unicode::
If 'latex-recognize-escaped-unicode' is defined, escaped unicode
characters (e.g. `\$${amp}#960;$$` or `\$${amp}#x3C0;$$`) will be recognized. This can lead to LaTeX compilation errors since LaTeX unicode support is only rudimentary. For more information see <<unicodeSupport, Unicode support>>.
latex-use-custom-list-items::
If 'latex-use-custom-list-items' is defined, lists will be bulleted or enumerated the way you have typed them in the original Asciidoc document. That means, `*` turns into a circle bullet, `-` turns into a dash, `.` turns into a number and `..` turns into a letter. Otherwise LaTeX will use different bullets and enumeration characters depending on the level of nesting.
latex-use-colored-tables::
If 'latex-use-colored-tables' is defined, tables will be printed colored.
latex-use-running-title-headings::
If 'latex-use-running-title-headings' is defined, 'pagestyle' will be set to 'headings' which results in running titles in the head.
latex-use-colored-sidebar-blocks::
If 'latex-use-colored-sidebar-blocks' is defined, sidebar block content will be put in a color box instead of being indented by a vertical bar.
icons::
Link admonition paragraph and admonition block icon images and badge images. By default icons is undefined and text is used in place of icon images.
encoding::
Set the input and output document character set encoding. Currently `ISO-8859-1` and `UTF-8` are supported.
== Requirements
=== General
The following software is necessary for using the LaTeX backend:
- An up-to-date version of http://www.methods.co.nz/asciidoc/[Asciidoc]
- An up-to-date TeX distribution, e.g.:
* http://www.miktex.org/[MiKTeX] for Windows
* http://www.tug.org/tetex/[teTeX] for Linux
[[packageRequirements]]
=== TeX/LaTeX Package requirements
LaTeX backend makes use of some LaTeX specialities which don't belong to a minimal TeX/LaTeX distribution. However, I took special care not to employ exotic packages. Hence the following packages should be available in most package repositories. The table is not complete yet because I don't know the package names for all TeX distributions.
[cols="4*,4",options="header"]
|====================================================================
|Speciality | MiKTeX package name | teTeX package name | TeX Live package name | Description
|KOMA-Script | koma-script | | | LaTeX backend uses the document classes 'scrartcl' and 'scrbook' as well as some other specialities defined in the 'KOMA-Script' package, e.g. the commands `\addmargin{}` and `\minisec{}`.
|xcolor.sty | xcolor | | | Used to produce colored boxes and tables.
|colortbl.sty | colortbl | | | Used to produce colored tables.
|type1ec.sty | cm-super | | | Enables high quality fonts for PDF output.
|hyperref.sty | hyperref | | | Extensive support for hypertext in PDF documents.
|enumerate.sty | tools | | | When 'latex-use-custom-list-items' is defined this package is used for determining the enumeration character.
|graphicx.sty | graphics | | | Used for including images.
|longtable.sty | tools | | | Enables page spanning tables.
|ucs.sty | unicode | | | Enables support for unicode characters.
|textcomp | ltxbase | | | Used for printing various symbols like arrows. Should be already installed.
|alltt | ltxbase | | | Used in literal-like blocks for retaining line and whitespace formatting. Should be already installed.
|listings.sty | listings | | | Used for listing blocks.
|====================================================================
[[configurationFile]]
== About the LaTeX backend configuration file
An important note for people who want to adapt the LaTeX backend configuration file to their own needs:
LaTeX markup has a lot of special characters, most importantly ``, `{`, `}`. In order to make things less complicated, I changed the default substitution order (see entry 'subsnormal' in the `[miscellaneous]` section). In contrast to the backends 'docbook' and 'xhtml11', the 'specialcharacters' substitution is applied very late. As a result all special characters produced by 'quotes', 'specialwords', 'replacements', 'attributes' and 'macros' become escaped at the end. If you don't want special characters in the corresponding sections to get escaped, you've to use following symbols instead of the special characters.
- `\$$!..backslash..!$$` instead of ``
- `\$$!..braceleft..!$$` instead of `{`
- `\$$!..braceright..!$$` instead of `}`
For more special characters take a look in the `[replacements2]` sections. `[replacements2]` section is responsible for replacing the symbols with their corresponding special characters.
== Ideas
=== Code listing block
For creating highlighted code listings I suggest the use of http://www.andre-simon.de/[Highlight] or http://www.gnu.org/software/src-highlite/[GNU Source Highlight]. Both are suited for use as Asciidoc filters.
== Known Bugs
- Sometimes LaTeX backend handles things differently from the default backends
- A lot of little bugs
== Todo List
- Remove bugs
- Support for 'grid' attribute in tables
- Better looking tables
- Option for squeezing output (smaller lists)
- Support for different languages (That would be a nice feature for Asciidoc in general)
- Option for switching titlepage on and off

View File

@ -1,134 +0,0 @@
Bugs in asciidoc latex backend
==============================
Geoff Eddy
Benjamin Klum was unable to maintain the LaTeX backend beyond version
8.2.7, and as a consequence the `latex.conf` file ceased to work with
`asciidoc` sometime after this. For version 8.4.3 I made some changes
to the file to get it working again. This document summarises the
remaining issues which I have found with generating LaTeX and thence
PDF output with `asciidoc`, which is done as follows:
- `asciidoc --backend=latex --unsafe FILE.txt`
- `latex FILE.tex`
- `kpdf FILE.pdf`
Many of these were found by processing the `asciidoc.txt` file and
comparing the HTML output with the PDF.
== Footnotes
Priority:: Low.
Problem:: References to footnotes, and a sensible value for the
`[footnoteref-inlinemacro]` section, don't seem to be possible.
Cause:: LaTeX doesn't support footnoting much beyond creating a
footnote at a certain point in text and displaying the footnote
itself.
Solution:: Unclear. How important or necessary is this, anyway?
== Spurious text at starts of paragraphs
Priority:: Medium
Problem:: It is necessary to insert spurious text in paragraphs.
Cause:: This `asciidoc` input:
+
-------------------------------------------------------------------
Text
-------------------------------------------------------------------
+
generates this LaTeX code:
+
\begin{lstlisting}
SPURIOUS TEXTText\end{lstlisting}
+
which should be:
+
\begin{lstlisting}[]
Text\end{lstlisting}
Solution:: Find out a way to generate the correct LaTeX output as
above. The obvious solution, as explained in `latet.conf`, doesn't
work.
== Tables
Priority:: Rather high.
Problem:: Not all of the table configuration options can be passed
through to the LaTeX backend. In particular, I've had to assume that
all tables will be fifteen or fewer left-justified columns wide.
Cause:: The table models in LaTeX and HTML are too dissimilar for one
`asciidoc` specification to generate valid output in both formats by
simple regexp replacement. Related to this is the unfortunate fact
that `<COLGROUP>` and related tags aren't a required part of HTML4,
and some broswers (at least Firefox and Konqueror) don't implement
them.
Solution:: Perhaps table processing could be handled by a Python
plugin, which would read in a table spec and generate the appropriate
text?
== Unicode escaping
Priority:: Rather high, to me at least.
Problem:: The commented-out section in `latex.conf`, if uncommented,
converts `&#960;` to `\unichar{960}`, which then causes LaTeX to
complain that the resulting command is unavailable in encoding T1. The
more common non-ASCII characters, such as those in `félicité` and
`świeca`, are handled properly, but some - such as the IPA characters
in the `tipa` package - are not.
Cause:: The encodings in the LaTeX output are wrong.
Solution:: Correct the encodings.
== Text colours
Priority:: Probably low
Problem:: The text colour options are not processed by LaTeX; for
example `[#ff0000]#Red text#` is not rendered in red.
Cause:: LaTeX and HTML represent RGB triads differently: HTML is happy
with `#ff8000`, but LaTeX needs `[rgb]{1,0.5,0}`.
Solution:: Provide some sort of internal RGB conversion mechanism
which can convert RGB triads to different representations.
== Text sizes
Priority:: Probably low
Problem:: The text size options are not processed by LaTeX:
`[,,1]#text#` is rendered in the same size as normal text.
Cause:: HTML size tags - `h1` through `h7` - are directly derivable
from the size number, whereas LaTeX has a series of descriptive words
(`HUGE` through `normalsize` to `scriptsize`).
Solution:: Provide a way to treat the number as an index into an
array.
== Background colour in paragraphs
Priority:: Medium
Problem:: If the `backgroundcolor` attribute is specified in the
`lstset` command, all paragraphs are displayed as black rectangles by
`kpdf`, `xpdf`, and `evince`, although `kdvi` has no problems. I've
had to remove the attribute, and so paragraphs all appear on white
backgrounds. The PDF viewers also complain:
Error (NNNN): Unknown operator 'rgb'
Cause:: Apparently a known bug in the output of `pdflatex`. Not a bug
in `asciidoc`.
Solution:: Wait until this bug is fixed?

View File

@ -1,196 +0,0 @@
LaTeX Filter
============
:blogpost-status: published
:blogpost-doctype: article
:blogpost-posttype: page
:blogpost-categories: AsciiDoc,LaTeX,python
The AsciiDoc distribution includes a LaTeX filter that translates
LaTeX source to PNG image which is automatically inserted into the
AsciiDoc output document. Although it can accept any LaTeX source, the
primary use is to render mathematical formulae (see the examples
below). The filter implements the 'latex' Listing block and Paragraph
styles.
This LaTeX paragraph:
[listing]
.....................................................................
[latex]
$y = \int_0^\infty \gamma^2 \cos(x) dx$
.....................................................................
Renders:
[latex]
$y = \int_0^\infty \gamma^2 \cos(x) dx$
This LaTeX block:
[listing]
.....................................................................
["latex","latex1.png",align="center"]
---------------------------------------------------------------------
$\displaystyle{ V_i = C_0 - C_3
\frac{C_1\cos(\theta_i+C_3)}{C_4+C_1\cos(\theta_i+C_2)} }$
---------------------------------------------------------------------
.....................................................................
Renders:
["latex","latex1.png",align="center"]
---------------------------------------------------------------------
$\displaystyle{ V_i = C_0 - C_3
\frac{C_1\cos(\theta_i+C_3)}{C_4+C_1\cos(\theta_i+C_2)} }$
---------------------------------------------------------------------
This LaTeX block:
[listing]
.....................................................................
.LaTeX filter example
[latex]
["latex","latex3.png"]
---------------------------------------------------------------------
\begin{equation}
\Re{z} =\frac{n\pi \dfrac{\theta +\psi}{2}}{
\left(\dfrac{\theta +\psi}{2}\right)^2 + \left( \dfrac{1}{2}
\log \left\lvert\dfrac{B}{A}\right\rvert\right)^2}.
\end{equation}
\begin{equation}
\boxed{\eta \leq C(\delta(\eta) +\Lambda_M(0,\delta))}
\end{equation}
\begin{equation}\label{first}
a=b+c
\end{equation}
\begin{subequations}\label{grp}
\begin{align}
a&=b+c\label{second}\\
d&=e+f+g\label{third}\\
h&=i+j\label{fourth}
\end{align}
\end{subequations}
---------------------------------------------------------------------
.....................................................................
Renders:
.LaTeX filter example
[latex]
---------------------------------------------------------------------
\begin{equation}
\Re{z} =\frac{n\pi \dfrac{\theta +\psi}{2}}{
\left(\dfrac{\theta +\psi}{2}\right)^2 + \left( \dfrac{1}{2}
\log \left\lvert\dfrac{B}{A}\right\rvert\right)^2}.
\end{equation}
\begin{equation}
\boxed{\eta \leq C(\delta(\eta) +\Lambda_M(0,\delta))}
\end{equation}
\begin{equation}\label{first}
a=b+c
\end{equation}
\begin{subequations}\label{grp}
\begin{align}
a&=b+c\label{second}\\
d&=e+f+g\label{third}\\
h&=i+j\label{fourth}
\end{align}
\end{subequations}
---------------------------------------------------------------------
This LaTeX paragraph:
[listing]
.....................................................................
.A LaTeX table
[latex]
\begin{tabular}{c r @{.} l}
Pi expression &
\multicolumn{2}{c}{Value} \\
\hline
$\pi$ & 3&1416 \\
$\pi^{\pi}$ & 36&46 \\
$(\pi^{\pi})^{\pi}$ & 80662&7 \\
\end{tabular}
.....................................................................
Renders:
.A LaTeX table
[latex]
\begin{tabular}{c r @{.} l}
Pi expression &
\multicolumn{2}{c}{Value} \\
\hline
$\pi$ & 3&1416 \\
$\pi^{\pi}$ & 36&46 \\
$(\pi^{\pi})^{\pi}$ & 80662&7 \\
\end{tabular}
Using the Filter
----------------
- The LaTeX filter is invoked by setting the Listing block or
Paragraph style (the first positional block attribute) to 'latex'.
- The second positional attribute (named 'target' is optional, it sets
the name of the generated PNG image file. If this is not supplied a
file name like `{docname}__{target-number}.png` is synthesised
(where `{docname}` is the document file name and `{target-number}`
is an integer number.
- The third positional attribute, named 'dpi', is also optional; it is
an integer number that sets the output resolution in dots per inch.
Because the LaTeX images are rendered using the image block templates
you can also use the optional named image block attributes (see
link:userguide.html#X55[Image macro attributes] in the AsciiDoc User
Guide).
[TIP]
=====================================================================
You can also change the image size using the following LaTeX commands:
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
For example:
[latex]
\Large $y = \int_0^\infty \gamma^2 \cos(x) dx$
The `\Large` command is outside the `$` math delimiters.
=====================================================================
The filter (`./filters/latex/latex2png.py`) can be used outside
AsciiDoc to convert LaTeX source to PNG images.
Execute the following command to see how to use it:
$ ./filters/latex/latex2png.py --help
Limitations
-----------
- The `asciidoc(1)` input and output files cannot both be `-` (stdin
and stdout), either the input or output files (or both) must be a
named file.
Installation
------------
In addition to AsciiDoc you will need to have `latex(1)` and
`dvipng(1)` installed.

View File

@ -1,121 +0,0 @@
Embedding LaTeX Math in AsciiDoc dblatex documents
==================================================
You can include LaTeX math equations in AsciiDoc documents that are
processed by http://dblatex.sourceforge.net/[dblatex]. The AsciiDoc
'latexmath' macros and passthrough blocks generate DocBook
'inlineequation', 'informalequation' and 'equation' elements
containing the LaTeX markup which is processed by 'dblatex'.
Inline equations
----------------
This markup:
---------------------------------------------------------------------
An inline equation latexmath:[$C = \alpha + \beta Y^{\gamma} + \epsilon$]
using the 'latexmath' inline macro.
---------------------------------------------------------------------
Renders:
An inline equation latexmath:[$C = \alpha + \beta Y^{\gamma} + \epsilon$]
using the 'latexmath' inline macro.
Informal equations
------------------
Informal (untitled) equations are generated with a 'latexmath' style
passthrough delimited block. This markup:
---------------------------------------------------------------------
[latexmath]
++++++++++++++++++++++++++++++++++++++++++++
\[C = \alpha + \beta Y^{\gamma} + \epsilon\]
++++++++++++++++++++++++++++++++++++++++++++
---------------------------------------------------------------------
Renders:
[latexmath]
++++++++++++++++++++++++++++++++++++++++++++
\[C = \alpha + \beta Y^{\gamma} + \epsilon\]
++++++++++++++++++++++++++++++++++++++++++++
Functionally identical block macro syntax:
---------------------------------------------------------------------
latexmath::[\[C = \alpha + \beta Y^{\gamma} + \epsilon\]]
---------------------------------------------------------------------
Renders:
latexmath::[\[C = \alpha + \beta Y^{\gamma} + \epsilon\]]
Formal equations
----------------
Formal equations are titled and are generated with a 'latexmath' style
passthrough delimited block.
This markup:
---------------------------------------------------------------------
.First equation
[latexmath]
++++++++++++++++++++++++++++++++++++++++++++
\[C = \alpha + \beta Y^{\gamma} + \epsilon\]
++++++++++++++++++++++++++++++++++++++++++++
---------------------------------------------------------------------
Renders:
.First equation
[latexmath]
++++++++++++++++++++++++++++++++++++++++++++
\[C = \alpha + \beta Y^{\gamma} + \epsilon\]
++++++++++++++++++++++++++++++++++++++++++++
This markup:
---------------------------------------------------------------------
.Matrix
[latexmath]
++++++++++++++++++++++++++++++++++++++++++++
\[ P^{e \rightarrow c}= \left[
\begin{array}{*{3}{r@{}l}}
& \cos \theta & & \sin \theta \sin \varphi & & \sin \theta \cos \varphi\\
& \sin \theta \sin \psi
& & \cos \varphi \cos \psi - \cos \theta \sin \varphi \sin \psi
& - & \sin \varphi \cos \psi - \cos \theta \cos \varphi \sin \psi\\
- & \sin \theta \cos \psi
& & \cos \varphi \sin \psi + \cos \theta \sin \varphi \cos \psi
& - & \sin \varphi \sin \psi + \cos \theta \cos \varphi \cos \psi\\
\end{array}
\right] \]
++++++++++++++++++++++++++++++++++++++++++++
---------------------------------------------------------------------
Renders:
.Matrix
[latexmath]
++++++++++++++++++++++++++++++++++++++++++++
\[ P^{e \rightarrow c}= \left[
\begin{array}{*{3}{r@{}l}}
& \cos \theta & & \sin \theta \sin \varphi & & \sin \theta \cos \varphi\\
& \sin \theta \sin \psi
& & \cos \varphi \cos \psi - \cos \theta \sin \varphi \sin \psi
& - & \sin \varphi \cos \psi - \cos \theta \cos \varphi \sin \psi\\
- & \sin \theta \cos \psi
& & \cos \varphi \sin \psi + \cos \theta \sin \varphi \cos \psi
& - & \sin \varphi \sin \psi + \cos \theta \cos \varphi \cos \psi\\
\end{array}
\right] \]
++++++++++++++++++++++++++++++++++++++++++++

View File

@ -1,41 +0,0 @@
LaTeXMathML Formulae
====================
http://www.maths.nottingham.ac.uk/personal/drw/lm.html[LaTeXMathML]
capability has been added to AsciiDoc for users who are more familar
with or prefer LaTeX math formulas to the
http://www.methods.co.nz/asciidoc/asciimathml.html[ASCIIMathML]
notation.
'LaTeXMathML' is a derivative of
http://www.methods.co.nz/asciidoc/asciimathml.html[ASCIIMathML] -- in
terms of usage the only difference it that you use the `latexmath`
attribute instead of the `asciimath` attribute.
'LaTeXMathML' processes LaTeX math formulas not arbitrary LaTeX (as
`dblatex(1)` does). See the
http://www.maths.nottingham.ac.uk/personal/drw/lm.html[LaTeXMathML]
website for details.
Here's the link:latexmathml.txt[AsciiDoc source] that generated this
page.
Some example 'LaTeXMathML' formulas:
- latexmath:[$R_x = 10.0 \times \sin(R_\phi)$]
- latexmath:[$\sum_{n=1}^\infty \frac{1}{2^n}$]
- latexmath:[$\lim_{x\to\infty} f(x) = k \choose r + \frac ab
\sum_{n=1}^\infty a_n + \displaystyle{ \left\{ \frac{1}{13}
\sum_{n=1}^\infty b_n \right\} }$]
- latexmath:[$\$\alpha + \$\beta = \$(\alpha + \beta)$]
- latexmath:[$\begin{eqnarray} x & = & \frac{-7 \pm
\sqrt{49 - 24}}{6} \\ & = & -2 \textrm{ or } -\frac13.
\end{eqnarray}$]
- latexmath:[$\displaystyle{ V_i = C_0 - C_3
\frac{C_1\cos(\theta_i+C_3)}{C_4+C_1\cos(\theta_i+C_2)} }$]

View File

@ -1,233 +0,0 @@
#####################################################################
#
# A-A-P file for making AsciiDoc distribution documentation.
# (you can obtain A-A-P from http://www.a-a-p.org)
#
# Stuart Rackham <srackham@gmail.com>
#####################################################################
:execute ../common.aap
ASCIIDOC = python ../asciidoc.py -a revnumber=$(VERS)@ -a revdate="$(DATE)@"
A2X = python ../a2x.py
:syseval which fop | :assign FOP
@if not _no.FOP:
:syseval which fop.sh | :assign FOP
:syseval which lynx | :assign LYNX # Converts HTML to text.
:syseval which xmllint | :assign XMLLINT # Validates XML.
:syseval which dblatex | :assign DBLATEX # Converts DocBook XML to PDF.
:syseval which aspell | :assign ASPELL
:syseval which xsltproc | :assign XSLTPROC
ROOT = asciidoc asciidoc.1
INFILES = $*(ROOT).txt
CHUNK_DIR = ./asciidoc.chunked
HTMLHELP_DIR = ./asciidoc.htmlhelp
HTMLHELP_FILE = asciidoc
OUTFILES = $*(ROOT).html $*(ROOT).css.html $*(ROOT).css-embedded.html \
asciidoc.pdf asciidoc.1.man a2x.1.man \
article.html book.html book-multi.html asciidoc.xml asciidoc.1.xml \
../BUGS ../CHANGELOG ../README ../INSTALL \
latex-backend.html \
$HTMLHELP_DIR/index.html \
$CHUNK_DIR/index.html \
article.pdf \
latexmath.pdf \
latex-filter.pdf \
source-highlight-filter.pdf \
music-filter.pdf \
book.epub \
article-standalone.html \
article-html5-toc2.html
TEST_FILES = $*(ROOT).css-embedded.html
article.css-embedded.html book.css-embedded.html \
article.xml book.xml book-multi.xml asciidoc.xml asciidoc.1.xml \
asciidoc.1.html a2x.1.xml music-filter.xml \
book.epub asciidoc.epub \
#####################################################################
# Filetype build rules.
#####################################################################
:rule %.epub : %.txt
:sys $A2X -f epub -d book --epubcheck --icons $source
:rule %.text : %.txt
# Convert AsciiDoc to HTML then use lynx(1) to convert HTML to text.
@if not _no.LYNX:
:print WARNING: lynx(1) unavailable: skipping $target file generation
@else:
opt = -f ../text.conf
@if source_list[0] == 'asciidoc.1.txt':
opt += -d manpage
@else:
opt += -n
:sys $ASCIIDOC $opt -b html4 -o - $source | \
lynx -dump -stdin > $target
:rule %.css.html : %.txt
opt =
@if source_list[0] == 'asciidoc.1.txt':
opt += -d manpage
@else:
opt += -n
opt += -a toc -a toclevels=2 -a scriptsdir=../javascripts
:sys $ASCIIDOC $opt -b xhtml11 -a linkcss -a icons -a stylesdir=../stylesheets -o $target $(source[0])
@if _no.XMLLINT:
:sys $XMLLINT --nonet --noout --valid $target
@else:
:print WARNING: xmllint(1) unavailable: skipping validation
:rule %.css-embedded.html : %.txt
opt =
@if source_list[0] == 'asciidoc.1.txt':
opt += -d manpage
@else:
opt += -n
opt += -a toc -a toclevels=2
:sys $ASCIIDOC -b xhtml11 $opt -o $target $(source[0])
@if _no.XMLLINT:
:sys $XMLLINT --nonet --noout --valid $target
@else:
:print WARNING: xmllint(1) unavailable: skipping validation
:rule %.xml : %.txt
opt =
@if source_list[0] in ('asciidoc.1.txt','a2x.1.txt'):
opt += -d manpage
@else:
opt += -n
@if source_list[0] == 'asciidoc.txt' or source_list[0].startswith('book'):
opt += -d book
:sys $ASCIIDOC $opt -b docbook $(source[0])
@if _no.XMLLINT:
:sys $XMLLINT --nonet --noout --valid $target
@else:
:print WARNING: xmllint(1) unavailable: skipping validation
:rule %.sgml : %.txt
opt =
@if source_list[0] in ('asciidoc.1.txt','a2x.1.txt'):
opt += -d manpage
@if source_list[0] == 'asciidoc.txt' or source_list[0].startswith('book'):
opt += -d book
:sys $ASCIIDOC $opt -b docbook-sgml $(source[0])
:rule %.html: %.xml
:sys $XSLTPROC --nonet --stringparam admon.textlabel 0 --stringparam html.stylesheet ./docbook-xsl.css ../docbook-xsl/xhtml.xsl $source >$target
:rule %.man : %.xml
:sys $XSLTPROC --nonet ../docbook-xsl/manpage.xsl $source
:sys touch $target # Dummy target.
:rule %.fo: %.xml
:sys $XSLTPROC --nonet --stringparam admon.textlabel 0 ../docbook-xsl/fo.xsl $source >$target
# This kludge forces the User Guide and LaTeX related PDFs to be generated
# using dblatex so we include a dblatex example in the distribution.
@if _no.DBLATEX:
asciidoc.pdf: asciidoc.txt
:sys $ASCIIDOC -b docbook $(source[0])
:sys $DBLATEX -p ../dblatex/asciidoc-dblatex.xsl -s ../dblatex/asciidoc-dblatex.sty -o $target asciidoc.xml
latexmath.pdf: latexmath.xml
:sys $DBLATEX -p ../dblatex/asciidoc-dblatex.xsl -s ../dblatex/asciidoc-dblatex.sty -o $target $source
latex-filter.pdf: latex-filter.xml
:sys $DBLATEX -p ../dblatex/asciidoc-dblatex.xsl -s ../dblatex/asciidoc-dblatex.sty -o $target $source
# Force the Source Highlighter PDF to be generated using dblatex
# because dblatex has builtin source code highlighting.
@if _no.DBLATEX:
source-highlight-filter.pdf: source-highlight-filter.xml
:sys $DBLATEX -p ../dblatex/asciidoc-dblatex.xsl -s ../dblatex/asciidoc-dblatex.sty -o $target $source
@if _no.FOP:
:rule %.pdf: %.fo
:sys $FOP $source $target
@elif _no.DBLATEX:
# Fall back to dblatex if no FOP.
:rule %.pdf: %.xml
:sys $DBLATEX -p ../dblatex/asciidoc-dblatex.xsl -s ../dblatex/asciidoc-dblatex.sty -o $target $source
@else:
:rule %.pdf:
:print WARNING: PDF processor unavailable: skipping $target file generation
#####################################################################
# Explicit file generation (cases that don't fit the rules).
#####################################################################
article-standalone.html: article.txt
:sys $ASCIIDOC -a data-uri -a icons -a toc -a max-width=55em -o $target $source
article-html5-toc2.html: article.txt
:sys $ASCIIDOC -b html5 -a icons -a toc2 -a theme=flask -o $target $source
asciidoc.1.html: asciidoc.1.txt
:sys $ASCIIDOC -d manpage -b html4 $source
@if _no.XMLLINT:
:sys $XMLLINT --nonet --noout --valid --html $target
@else:
:print WARNING: xmllint(1) unavailable: skipping validation
# User Guide 'chunked' into linked HTML pages.
$CHUNK_DIR/index.html: asciidoc.txt
:sys $A2X -fchunked -dbook --icons -D ./ asciidoc.txt
# HTML Help formatted User Guide.
$HTMLHELP_DIR/index.html: asciidoc.xml
:sys $A2X -fhtmlhelp -dbook --icons -D ./ asciidoc.txt
../BUGS: ../BUGS.text
# Make BUGS.text and copy to BUGS.
:copy ../BUGS.text ../BUGS
../CHANGELOG: ../CHANGELOG.text
# Make CHANGELOG.text and copy to CHANGELOG.
:copy ../CHANGELOG.text ../CHANGELOG
../README: ../README.text
# Make README.text and copy to README.
:copy ../README.text ../README
../INSTALL: ../INSTALL.text
# Make INSTALL.text and copy to INSTALL.
:copy ../INSTALL.text ../INSTALL
asciimathml.html: asciimathml.txt
:sys $ASCIIDOC -a asciimath $source
# No xmllint(1) checking -- fails on embedded JavaScript.
latexmathml.html: latexmathml.txt
:sys $ASCIIDOC -a latexmath $source
# No xmllint(1) checking -- fails on embedded JavaScript.
#####################################################################
# Build commands.
#####################################################################
all: $OUTFILES
clean:
:del {f} $OUTFILES $TEST_FILES
:del {f} *.bak # Remove aspell backups.
spell: $INFILES ../CHANGELOG.txt ../README.txt ../BUGS.txt ../INSTALL.txt \
a2x.1.txt faq.txt asciidocapi.txt testasciidoc.txt \
epub-notes.txt publishing-ebooks-with-asciidoc.txt \
source-highlight-filter.txt \
slidy.txt slidy-example.txt
# Interactively spell check all files.
@for s in source_list:
:sys {i} $ASPELL check -p ./asciidoc.dict $s
clean_testfiles:
:del {f} $TEST_FILES
:del {f} music*.png # Force Lilypond to run.
test: clean_testfiles $TEST_FILES
# Force generation and validation of .html and Docbook (.xml) files.

View File

@ -1,148 +0,0 @@
Music Filter
============
The AsciiDoc distribution includes a Music Block filter that
translates music in http://lilypond.org/[LilyPond] or
http://abcnotation.org.uk/[ABC] notation to standard classical
notation in the form of a trimmed PNG image which is automatically
inserted into the AsciiDoc output document (see the examples below).
Actually the filter (`./filters/music/music2png.py`) can be used outside
AsciiDoc to convert LilyPond or ABC music files to PNG images.
Execute the following command to see how to use it:
$ ./filters/music/music2png.py --help
.Music Block containing ABC notation
=====================================================================
This Music Block:
[listing]
.....................................................................
["music","music1.png",scaledwidth="100%"]
---------------------------------------------------------------------
T:The Butterfly
R:slip jig
C:Tommy Potts
H:Fiddle player Tommy Potts made this tune from two older slip jigs,
H:one of which is called "Skin the Peelers" in Roche's collection.
H:This version by Peter Cooper.
D:Bothy Band: 1975.
M:9/8
K:Em
vB2(E G2)(E F3)|B2(E G2)(E F)ED|vB2(E G2)(E F3)|(B2d) d2(uB A)FD:|
|:(vB2c) (e2f) g3|(uB2d) (g2e) (dBA)|(B2c) (e2f) g2(ua|b2a) (g2e) (dBA):|
|:~B3 (B2A) G2A|~B3 BA(uB d)BA|~B3 (B2A) G2(A|B2d) (g2e) (dBA):|
---------------------------------------------------------------------
.....................................................................
Renders:
["music","music1.png",scaledwidth="100%"]
---------------------------------------------------------------------
T:The Butterfly
R:slip jig
C:Tommy Potts
H:Fiddle player Tommy Potts made this tune from two older slip jigs,
H:one of which is called "Skin the Peelers" in Roche's collection.
H:This version by Peter Cooper.
D:Bothy Band: 1975.
M:9/8
K:Em
vB2(E G2)(E F3)|B2(E G2)(E F)ED|vB2(E G2)(E F3)|(B2d) d2(uB A)FD:|
|:(vB2c) (e2f) g3|(uB2d) (g2e) (dBA)|(B2c) (e2f) g2(ua|b2a) (g2e) (dBA):|
|:~B3 (B2A) G2A|~B3 BA(uB d)BA|~B3 (B2A) G2(A|B2d) (g2e) (dBA):|
---------------------------------------------------------------------
=====================================================================
.Music Block containing LilyPond notation
=====================================================================
This example contains LilyPond musical markup.
[listing]
.....................................................................
[music]
---------------------------------------------------------------------
\version "2.14.2"
\paper {
ragged-right = ##t
}
{
\time 3/4
\clef bass
c2 e4 g2. f4 e d c2 r4
}
---------------------------------------------------------------------
.....................................................................
Renders:
[music]
---------------------------------------------------------------------
\version "2.14.2"
\paper {
ragged-right = ##t
}
{
\time 3/4
\clef bass
c2 e4 g2. f4 e d c2 r4
}
---------------------------------------------------------------------
=====================================================================
NOTE: If you get an error processing the above example it may be that
it is not compatible with your version of LilyPond. Use the LilyPond
`convert-ly(1)` utility to update the source to the version that you
are using.
Using the Filter
----------------
- The Music filter is invoked by setting the Listing block or
Paragraph style (the first positional block attribute) to 'music'.
- The second positional attribute (named 'target' is optional, it sets
the name of the generated PNG image file. If this is not supplied a
file name like `{docname}__{target-number}.png` is synthesised
(where `{docname}` is the document file name and `{target-number}`
is an integer number.
- The third positional attribute ('format') specifies the music input
format: either 'abc' for ABC or 'ly' for LilyPond. If the format is
omitted ABC notation is assumed unless the text starts with a
backslash character, in which case the format is set to 'ly'.
Because the LaTeX images are rendered using the image block templates
you can also use the optional named image block attributes (see
link:userguide.html#X55[Image macro attributes] in the AsciiDoc User
Guide).
Limitations
-----------
- The `asciidoc(1)` input and output files cannot both be `-` (stdin
and stdout), either the input or output files (or both) must be a
named file.
Installation
------------
In addition to AsciiDoc you will need to have installed:
- http://lilypond.org/web/[LilyPond] (most Linux distributions include
this package).
- http://www.imagemagick.org[ImageMagick] (most Linux distributions
include this package).
Test the music filter it by converting the test file to HTML with AsciiDoc:
$ asciidoc -v ./filters/music/music-filter-test.txt
$ firefox ./filters/music/music-filter-test.html &
The filter was developed and tested on Xubuntu Linux using LilyPond
2.10.5 and ImageMagick 6.2.4.
NOTE: The filter does not work with LilyPond 2.2.6 because it did not
generate the requested output file name correctly (2.6.3 does not have
a problem).

View File

@ -1,398 +0,0 @@
Publishing eBooks with AsciiDoc
===============================
// Web page meta data.
:keywords: AsciiDoc, EPUB tools, EPUB, PDF, ebooks
:description: How to create EPUB and PDF ebooks using AsciiDoc.
ifdef::blogpost[]
// Use the same article for both a blog post and on the AsciiDoc
// website.
:blogpost-title: Publishing eBooks with AsciiDoc
:blogpost-status: published
:blogpost-doctype: article
:blogpost-posttype: post
:blogpost-categories: AsciiDoc,eBook,EPUB,DocBook
*Published*: 2010-08-23 +
*Updated*: 2010-05-08
endif::blogpost[]
It's easy to write and publish books in
http://en.wikipedia.org/wiki/EPUB[EPUB] and PDF formats using
http://www.methods.co.nz/asciidoc/[AsciiDoc].
ifdef::blogpost[]
This article was originally published on the
http://www.methods.co.nz/asciidoc/publishing-ebooks-with-asciidoc.html[AsciiDoc
website].
endif::blogpost[]
Here are three examples: The first is a <<X1,minimal example>>
introducing the AsciiDoc format, the second <<X2,The Brothers
Karamazov>> is a rather long multi-part book and the third <<X3,The
Adventures of Sherlock Holmes>> includes a front cover image and
customized page styling.
ifdef::blogpost[]
// Wordpress processing instruction.
pass::[<!--more-->]
endif::blogpost[]
The examples presented below were created on a PC running Xubuntu
Linux 10.04 but should be applicable to any UNIX-based operating
system.
NOTE: A number of 'asciidoc' and 'a2x' features used in this article
require newer versions of AsciiDoc -- version 8.6.5 or better is
recommended. The version of
http://wiki.docbook.org/topic/DocBookXslStylesheets[DocBook XSL
Stylesheets] used was 1.76.1.
TIP: If you are experiencing 'xsltproc' errors when you run 'a2x' take
a look at Francis Shanahan's
http://francisshanahan.com/index.php/2011/fixing-epub-problem-docbook-xsl-asciidoc-a2x/[Fixing
the ePub problem with Docbook-XSL/A2X/Asciidoc] blog post.
[[X1]]
Minimal Book
------------
This didactic example contains a title and two chapters. The AsciiDoc
source is a plain text file named `minimal-book.txt`:
---------------------------------------------------------------------
= The Book Title
== The first chapter
Nec vitae mus fringilla eu vel pede sed pellentesque. Nascetur fugiat
nobis. Eu felis id mauris sollicitudin ut. Sem volutpat feugiat.
Ornare convallis urna vitae.
Nec mauris sed aliquam nam mauris dolor lorem imperdiet.
== The second chapter
Ut suspendisse nulla. Auctor felis facilisis. Rutrum vivamus nec
lectus porttitor dui dapibus eu ridiculus tempor sodales et. Sit a
cras. Id tellus cubilia erat.
Quisque nullam et. Blandit dui tempor. Posuere in elit diam egestas
sem vivamus vel ac.
---------------------------------------------------------------------
To generate the EPUB formatted book file `minimal-book.epub` run
AsciiDoc's 'a2x' toolchain wrapper command from the command-line:
a2x -fepub -dbook minimal-book.txt
The `-f` option specifies the output format, the `-d` option specifies
the document type (book, article or manpage). The optional
`--epubcheck` option tells 'a2x' to validate the EPUB file using
http://code.google.com/p/epubcheck/[epubcheck]. To generate a PDF
version (`minimal-book.pdf`) with 'dblatex' run:
a2x -fpdf -dbook minimal-book.txt
The distributed example PDFs were built using FOP -- if you prefer
http://xmlgraphics.apache.org/fop/[FOP] over
http://dblatex.sourceforge.net/[dblatex] use:
a2x -fpdf -dbook --fop minimal-book.txt
You can also generate an HTML formatted book, either using DocBook XSL
Stylesheets:
a2x -fxhtml -dbook minimal-book.txt
or directly using the 'asciidoc' command:
asciidoc -dbook minimal-book.txt
[NOTE]
======
The http://www.methods.co.nz/asciidoc/a2x.1.html[a2x toolchain
wrapper] uses the following programs (most will be available
prepackaged for your Linux distribution):
- http://xmlsoft.org/XSLT/[xsltproc]
- http://docbook.sourceforge.net/projects/xsl/[DocBook XSL
Stylesheets]
- http://dblatex.sourceforge.net/[dblatex] (PDF file generator)
- http://xmlgraphics.apache.org/fop/[FOP] (alternative PDF file
generator)
- http://code.google.com/p/epubcheck/[epubcheck] (optional EPUB file
validator)
======
[[X2]]
The Brothers Karamazov
----------------------
'The Brothers Karamazov' is an example of a multi-part book. To
generate the AsciiDoc source I downloaded the
http://www.gutenberg.org[Project Gutenberg] plain text source and
edited it manually (this took around 15 minutes). To generate the
`brothers-karamazov.epub` EPUB file run this command:
a2x brothers-karamazov.txt
:examples-url: http://www.methods.co.nz/misc/examples/books/
[frame="topbot",options="header",caption=""]
.Brothers Karamazov source files and eBooks
|====================================================================
|EPUB |PDF |AsciiDoc source |Project Gutenburg text
|{examples-url}brothers-karamazov.epub[brothers-karamazov.epub]
|{examples-url}brothers-karamazov.pdf[brothers-karamazov.pdf]
|{examples-url}brothers-karamazov.zip[brothers-karamazov.zip]
|http://www.gutenberg.org/etext/28054
|====================================================================
Here's the start of the AsciiDoc source file showing the AsciiDoc
specific meta-data:
---------------------------------------------------------------------
//
// Text from Project Gutenburg http://www.gutenberg.org/etext/28054
//
// Formatted for AsciiDoc by Stuart Rackham.
//
// a2x default options.
// a2x: -f epub -d book --epubcheck
// Suppress revision history in dblatex outputs.
// a2x: --dblatex-opts "-P latex.output.revhistory=0"
// Suppress book part, chapter and section numbering in DocBook XSL outputs.
// a2x: --xsltproc-opts
// a2x: "--stringparam part.autolabel 0
// a2x: --stringparam chapter.autolabel 0
// a2x: --stringparam section.autolabel.max.depth 0"
//
= The Brothers Karamazov
:author: Fyodor Dostoyevsky
:encoding: iso-8859-1
:plaintext:
..........................................................................
Translated from the Russian of Fyodor Dostoyevsky by Constance Garnett
The Lowell Press New York
:
:
***START OF THE PROJECT GUTENBERG EBOOK THE BROTHERS KARAMAZOV***
..........................................................................
= PART I
== The History Of A Family
=== Fyodor Pavlovitch Karamazov
Alexey Fyodorovitch Karamazov was the third son of Fyodor Pavlovitch
...
---------------------------------------------------------------------
- The book, book part and chapter titles have been edited to conform
to http://www.methods.co.nz/asciidoc/userguide.html#X17[AsciiDoc
title conventions].
- Book part titles must be level zero titles:
= Book title (level 0)
= Part one title (level 0)
== Chapter 1 title (level 1)
:
- Sub-chapter levels can be accommodated with `===`, `====` and
`=====` title prefixes.
- In this example the 'Project Gutenberg' front matter was put in the
untitled preface inside an AsciiDoc literal block.
- The comment lines starting with `// a2x:` contain 'a2x' command
options for this document (it's easier to put them in the document
once than type them every time on the command-line).
- A number of 'xsltproc' options are passed to 'a2x' to suppress book
part, chapter and section numbering.
- Setting the AsciiDoc 'plaintext' attribute suppresses most of
http://www.methods.co.nz/asciidoc/userguide.html#_text_formatting[AsciiDoc's
text formatting] and substitution conventions, this allows large
amounts of text to be imported with little or no manual editing.
* Once you have defined the AsciiDoc 'plaintext' attribute the only
requisite manual editing will be to format the titles and rectify
the odd paragraph being interpreted as some other AsciiDoc block
element.
* In the combined 49 thousand lines of imported 'Sherlock Holmes'
and 'Brothers Karamazov' text I only encountered two
misinterpreted list items, neither affected the rendered output or
necessitated editing.
* You can selectively enable and disable the 'plaintext' attribute
throughout your document using AsciiDoc
http://www.methods.co.nz/asciidoc/userguide.html#X18[attribute
entries].
[[X3]]
The Adventures of Sherlock Holmes
---------------------------------
This book includes a front cover image and a customized page design.
To generate the `adventures-of-sherlock-holmes.epub` EPUB file run
this command:
a2x adventures-of-sherlock-holmes.txt
[frame="topbot",options="header",caption=""]
.Sherlock Holmes source files and eBooks
|====================================================================
|EPUB |PDF |AsciiDoc source |Project Gutenburg text
|{examples-url}adventures-of-sherlock-holmes.epub[adventures-of-sherlock-holmes.epub]
|{examples-url}adventures-of-sherlock-holmes.pdf[adventures-of-sherlock-holmes.pdf]
|{examples-url}adventures-of-sherlock-holmes.zip[adventures-of-sherlock-holmes.zip]
|http://www.gutenberg.org/etext/1661
|====================================================================
Here's a screenshot of the first page of the first chapter (rendered
by the http://www.epubread.com/en/[Firefox EPUBReader addon]):
image::images/epub.png[]
The {examples-url}adventures-of-sherlock-holmes.zip[AsciiDoc source
Zip file] contains the following files:
`adventures-of-sherlock-holmes.txt`::
The AsciiDoc source (derived from the
http://www.gutenberg.org/etext/1661[Project Gutenberg plain text
source]).
`adventures-of-sherlock-holmes.jpg`::
The front cover image.
`adventures-of-sherlock-holmes-docinfo.xml`::
A http://www.methods.co.nz/asciidoc/userguide.html#X87[docinfo] file
containing DocBook markup for the front cover image and the Project
Gutenberg frontmatter. DocBook XSL Stylesheets identifies the book
cover image by the `role="cover"` attribute in the DocBook
`mediaobject` element.
`adventures-of-sherlock-holmes.css`::
CSS rules for styling the page layout. The design is based on the
http://epubzengarden.com[ePub Zen Garden] 'Gbs' style. Because this
file is not named `docbook-xsl.css` the name must be specified
explicitly using the 'a2x' `--stylesheet` option.
`underline.png`::
A title underline image that is used by the CSS stylesheet. This
resource has to be explicitly passed to 'a2x' because 'a2x' only
searches HTML files for resources.
Here's the start of the AsciiDoc source file showing the AsciiDoc
specific meta-data:
---------------------------------------------------------------------
//
// Text from Project Gutenburg http://www.gutenberg.org/etext/1661
//
// Formatted for AsciiDoc by Stuart Rackham.
//
// a2x default options.
// a2x: -f epub -d book -a docinfo --epubcheck
// a2x: --stylesheet adventures-of-sherlock-holmes.css
// Suppress revision history in dblatex outputs.
// a2x: --dblatex-opts "-P latex.output.revhistory=0"
// Suppress book part, chapter and section numbering in DocBook XSL outputs.
// a2x: --xsltproc-opts
// a2x: "--stringparam part.autolabel 0
// a2x: --stringparam chapter.autolabel 0
// a2x: --stringparam section.autolabel.max.depth 0"
// Additional resources.
// a2x: --resource underline.png
//
= The Adventures of Sherlock Holmes
:author: Sir Arthur Conan Doyle
:encoding: iso-8859-1
:plaintext:
== A Scandal in Bohemia
To Sherlock Holmes she is always THE woman. I have seldom heard
...
---------------------------------------------------------------------
The manual editing of imported plain text involves formatting the
title and chapter names as
http://www.methods.co.nz/asciidoc/userguide.html#X17[AsciiDoc titles]
(in this example we've used the 'single line' title format). Sherlock
Holmes only has two title levels:
---------------------------------------------------------------------
= The Adventures of Sherlock Holmes
== A Scandal in Bohemia
== The Red-Headed League
== A Case of Identity
== The Boscombe Valley Mystery
== The Five Orange Pips
== The Man with the Twisted Lip
== The Adventure of the Blue Carbuncle
== The Adventure of the Speckled Band
== The Adventure of the Engineer's Thumb
== The Adventure of the Noble Bachelor
== The Adventure of the Beryl Coronet
== The Adventure of the Copper Beeches
== Colophon
---------------------------------------------------------------------
Styling your books
------------------
You can customize the appearance of a document with CSS. CSS file.
Either create your own or copy and edit the existing default
`docbook-xsl.css` file (located in the AsciiDoc `stylesheets`
configuration directory) then place it in the same directory as your
AsciiDoc source file. Use the 'a2x' `--stylesheet` option if you want
to use a different stylesheet file. Take a look at the
`adventures-of-sherlock-holmes.css` CSS file.
There are some great examples of EPUB book styles at
http://epubzengarden.com/[ePub Zen Garden].
Including embedded fonts
------------------------
See http://www.methods.co.nz/asciidoc/faq.html#X5[this FAQ].
Reading EPUB documents
----------------------
My current favorite software epub reader is the
http://www.epubread.com/en/[Firefox EPUBReader addon]. EPUBReader
honors the book's CSS styling rules and renders the page as the author
intended (many EPUB readers only process a sub-set of CSS styling
rules).
Browsers are a natural fit for EPUB (EPUB is just a bunch of zipped
XHTML files) -- I'd love to see browsers support EPUB natively.
As of writing this article most eBook readers (with the notable
exception of Amazon's Kindle) support the EPUB format.
Non-fiction Books and Manuals
-----------------------------
AsciiDoc supports a rich set of markup conventions and can generate
reference works and technical manuals complete with tables,
illustrations, indexes, bibliographies and appendices. All the
examples on the http:///www.methods.co.nz/asciidoc/[AsciiDoc web site]
can be formatted as EPUB eBooks.

View File

@ -1,167 +0,0 @@
Slidy Example Slideshow
=======================
:author: Joe Bloggs
:copyright: Foobar Inc.
:backend: slidy
:max-width: 45em
:data-uri:
:icons:
This preamble will appear on a separate slide.
AsciiDoc Elements
-----------------
Sagittis in vestibulum. Habitasse ante nulla enim bibendum nulla. Odio
sed pede litora.
[float]
=== Titles inside delimited blocks must be floated
Porta nisl metus. Justo porttitor vel. Cras consequat tincidunt id sed
conubia. Feugiat felis justo. Nunc amet nulla. Eu ac orci mollis.
.Tiger
image::images/tiger.png[]
Incremental Elements
--------------------
The remaining elements on this page are incremental, press the space
bar to reveal them.
[role="incremental"]
- Rhoncus pede justo.
- Velit pede dolor.
- Iaculis commodo et.
- Volutpat tristique nec.
[role="incremental"]
--
Sagittis in vestibulum. Habitasse ante nulla enim bibendum nulla. Odio
sed pede litora.
--
[role="incremental"]
. Rhoncus pede justo.
. Velit pede dolor.
. Iaculis commodo et.
. Volutpat tristique nec.
Outline Elements
----------------
The following list is a Slidy 'outline' list -- nested bulleted or
numbered lists are expanded when the enclosing list item (the ones
with blue bullet points or numbers) are clicked.
[role="outline"]
- Rhoncus pede justo.
* Rhoncus pede justo.
* Velit pede dolor.
- Velit pede dolor.
* Iaculis commodo et.
+
NOTE: 'Note' admonition paragraph.
* Volutpat tristique nec.
+
image::images/tiger.png[]
* Iaculis commodo et.
* Volutpat tristique nec.
- Iaculis commodo et.
[role="outline"]
. Rhoncus pede justo.
** Velit pede dolor.
** Iaculis commodo et.
. Volutpat tristique nec.
- Volutpat tristique nec.
AsciiDoc Elements
-----------------
NOTE: 'Note' admonition paragraph.
IMPORTANT: 'Important' admonition paragraph.
.Sidebar
*********************************************************************
Faucibus sagittis commodo sed et eu. Quam nullam ornare. Sed vel est.
Mauris urna lobortis interdum placerat per id magnis enim.
*********************************************************************
AsciiDoc Elements
-----------------
A quote block:
[quote, Bertrand Russell, The World of Mathematics (1956)]
____________________________________________________________________
A good notation has subtlety and suggestiveness which at times makes
it almost seem like a live teacher.
____________________________________________________________________
A verse block:
[verse, William Blake, from Auguries of Innocence]
__________________________________________________
To see a world in a grain of sand,
And a heaven in a wild flower,
Hold infinity in the palm of your hand,
And eternity in an hour.
__________________________________________________
AsciiDoc Elements
-----------------
.Horizontal and vertical source data
[width="80%",cols="3,^2,^2,10",options="header"]
|=========================================================
|Date |Duration |Avg HR |Notes
|22-Aug-08 |10:24 | 157 |
Worked out MSHR (max sustainable heart rate) by going hard
for this interval.
|22-Aug-08 |23:03 | 152 |
Back-to-back with previous interval.
|24-Aug-08 |40:00 | 145 |
Moderately hard interspersed with 3x 3min intervals (2min
hard + 1min really hard taking the HR up to 160).
|=========================================================
Filters
-------
[source,python]
.Python source
---------------------------------------------------------------------
''' A multi-line
comment.'''
def sub_word(mo):
''' Single line comment.'''
word = mo.group('word') # Inline comment
if word in keywords[language]:
return quote + word + quote
else:
return word
---------------------------------------------------------------------
[music]
.Music
---------------------------------------------------------------------
\version "2.10.0"
\paper {
ragged-right = ##t
}
{
\time 3/4
\clef bass
c2 e4 g2. f4 e d c2 r4
}
---------------------------------------------------------------------

View File

@ -1,113 +0,0 @@
Slidy backend for AsciiDoc
==========================
:author: Stuart Rackham
:backend: slidy
:max-width: 45em
:data-uri:
:icons:
Use the following command to create this document (`slidy.html`):
asciidoc slidy.txt
Press the 'Space' key or the 'Left Arrow' key to continue the
slideshow.
Overview
--------
AsciiDoc has a 'slidy' backend for generating self contained 'Slidy'
HTML slideshows.
- An overview of 'Slidy' can be found here:
http://www.w3.org/Talks/Tools/Slidy2/
- AsciiDoc ships with the Slidy JavaScript a customised Slidy CSS
file.
- Use the 'asciidoc' `--backend slidy` command-line option to generate
browser viewable HTML slideshow. Example:
asciidoc --backend slidy slidy-example.txt
- By default, 'asciidoc' creates a self contained distributable HTML
document which includes all necessary CSS and JavaScripts. Use the
'asciidoc' `--attribute linkcss` command-line option if you prefer
to link (rather than embed) external CSS and JavaScript files.
How Slidy uses AsciiDoc markup
------------------------------
- The document header is displayed as the first page of the slideshow.
- If the document has a 'preamble' (the content between the header and
the first section) it will be displayed on the second page.
- Each top level section is displayed as a separate slide.
- If the AsciiDoc 'incremental' attribute is defined then all lists
and OpenBlock elements are treated as 'incremental' i.e. Slidy
exposes their child elements one at a time as you progress through
the slideshow.
- You can explicitly set an element as incremental by setting its
'role' attribute to 'incremental'. Example:
[role="incremental"]
Sagittis in vestibulum. Habitasse ante nulla enim bibendum nulla.
Odio sed pede litora.
Slidy Specific Attributes
-------------------------
incremental::
If this attribute is defined then all lists and OpenBlock elements are
classed as incremental i.e. Slidy will expose them one at a time as
you progress through the slideshow. The default behavior is for the
show to progress a full slide at at time. Elements that have been
explicitly classed as 'incremental' with the 'role' attribute are
always displayed incrementally.
duration::
Set this to the estimated number of minutes that your presentation
will take and Slidy will display a countdown timer at the bottom right
of the slideshow. For example, this 'asciidoc' command-line option
`--attribute duration=5` sets the duration to five minutes.
copyright::
If you set the 'copyright' attribute it will be displayed in the Slidy
menu bar at the bottom of the slide. If the 'copyright' attribute is
not define then the author name, if it is defined, will be displayed.
outline::
Setting the 'role' attribute to 'outline' in a bulleted or numbered
list allows nested lists to be expanded and collapsed using the mouse.
Nested lists are expanded when an enclosing list item (the ones with
blue bullet points or numbers) is clicked.
Stylesheets
-----------
- 'slidy' loads the 'asciidoc.css' stylesheet followed by 'slidy.css':
* `asciidoc.css` contains content presentational styles.
* The customized `slidy.css` stylesheet contains Slidy specific
styles (table of contents, menu and transition related).
- You can use AsciiDoc CSS themes. For example, the 'asciidoc'
`--attribute theme=volnitsky` command-line option will substitute
the `asciidoc.css` stylesheet for the distributed Volnitsky
`volnitsky.css` stylesheet.
- An additional stylesheet can be specified by setting the
'stylesheet' attribute. For example, the `--attribute
stylesheet=myslidy.css` will load `myslidy.css` after the standard
CSS files.
Tips
----
- The Slidy 'help?' and 'contents?' links at the bottom left are your
friends.
- Use the AsciiDoc 'data-uri' attribute to embed images in your
slideshow -- add this attribute entry to your document's header:
:data-uri:
- Use the AsciiDoc 'max-width' attribute to set the document display
width. For example, add this attribute entry to your document's
header:
:max-width: 45em

View File

@ -1,270 +0,0 @@
Source Code Highlight Filter
============================
The AsciiDoc distribution includes a 'source' filter for highlighting
code syntax.
DocBook Outputs
---------------
AsciiDoc encloses the source code in a DocBook 'programlisting'
element and leaves source code highlighting to the DocBook toolchain
(dblatex has a particularly nice programlisting highlighter). The
DocBook programlisting element is assigned two attributes:
. The 'language' attribute is set to the AsciiDoc 'language'
attribute.
. The 'linenumbering' attribute is set to the AsciiDoc 'src_numbered'
attribute ('numbered' or 'unnumbered').
HTML Outputs
------------
You have the choice of three HTML source code highlighters, your
selection is determined by the 'source-highlighter' attribute (defaults
to 'source-highlight'):
NOTE: Set the 'source-highlighter' attribute from the asciidoc(1)
command-line or in the document header (not in the document body,
because the configuration file conditional macros are processed at
load time).
=== GNU Source Highlight
The default highlighter is the
http://www.gnu.org/software/src-highlite/[GNU source-highlight] which
can highlight 'html4', 'html5' and 'xhtml11' outputs. The GNU
source-highlight must be installed and the 'source-highlight' command
must reside in the shell search 'PATH'.
=== Highlight
You can use
http://www.andre-simon.de/doku/highlight/en/highlight.html[Highlight]
syntax highlighter for 'xhtml11', 'html5' and 'html4' outputs (set the
'source-highlighter' attribute to 'highlighter').
- The 'highlight' command must reside in the shell search 'PATH'.
- To make Highlighter your default highlighter put the following line
your `~/.asciidoc/asciidoc.conf` file:
source-highlighter=highlight
- The AsciiDoc 'encoding' attribute is passed to Highlighter using the
`--encoding` command-line option.
=== Pygments
The http://pygments.org/[Pygments] syntax highlighter can be used for
'xhtml11' and 'html5' outputs (set the 'source-highlighter' attribute
to 'pygments').
- The 'pygmentize' command must reside in the shell search 'PATH'.
- You can customize Pygments CSS styles by editing
`./stylesheets/pygments.css`.
- To make Pygments your default highlighter put the following line
your `~/.asciidoc/asciidoc.conf` file:
source-highlighter=pygments
- The AsciiDoc 'encoding' attribute is passed to Pygments using the
`-O` command-line option.
Block attributes
----------------
The following attributes can be included in source code block
attribute lists.
- 'style' and 'language' are mandatory.
- 'style', 'language' and 'src_numbered' are the first three
positional attributes in that order.
- The 'args' attribute allows the inclusion of arbitrary (highlighter
dependent) command options.
//
style::
Set to 'source'.
language::
The source code language name.
+
NOTE: The language names vary between highlighters -- consult the
selected highlighter manual.
src_numbered::
Set to 'numbered' to include line numbers.
src_tab::
Set tab size (GNU source-highlight only).
args::
Include this attribute value in the highlighter command-line (HTML
outputs) or in the `programlisting` element (DocBook).
Testing
-------
Test the filter by converting the test file to HTML with AsciiDoc:
$ asciidoc -v ./filters/source/source-highlight-filter-test.txt
$ firefox ./filters/source/source-highlight-filter-test.html &
Examples
--------
Source code paragraphs
~~~~~~~~~~~~~~~~~~~~~~
The `source` paragraph style will highlight a paragraph of source
code. These three code paragraphs:
---------------------------------------------------------------------
[source,python]
if n < 0: print 'Hello World!'
:language: python
[source]
if n < 0: print 'Hello World!'
[source,ruby,numbered]
[true, false].cycle([0, 1, 2, 3, 4]) do |a, b|
puts "#{a.inspect} => #{b.inspect}"
---------------------------------------------------------------------
Render this highlighted source code:
[source,python]
if n < 0: print 'Hello World!'
:language: python
[source]
if n < 0: print 'Hello World!'
[source,ruby,numbered]
[true, false].cycle([0, 1, 2, 3, 4]) do |a, b|
puts "#{a.inspect} => #{b.inspect}"
Unnumbered source code listing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This source-highlight filtered block:
---------------------------------------------------------------------
[source,python]
---------------------------------------------------------------------
''' A multi-line
comment.'''
def sub_word(mo):
''' Single line comment.'''
word = mo.group('word') # Inline comment
if word in keywords[language]:
return quote + word + quote
else:
return word
---------------------------------------------------------------------
---------------------------------------------------------------------
Renders this highlighted source code:
[source,python]
---------------------------------------------------------------------
''' A multi-line
comment.'''
def sub_word(mo):
''' Single line comment.'''
word = mo.group('word') # Inline comment
if word in keywords[language]:
return quote + word + quote
else:
return word
---------------------------------------------------------------------
Numbered source code listing with callouts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This source-highlight filtered block:
---------------------------------------------------------------------
[source,ruby,numbered]
---------------------------------------------------------------------
#
# Useful Ruby base class extensions.
#
class Array
# Execute a block passing it corresponding items in
# +self+ and +other_array+.
# If self has less items than other_array it is repeated.
def cycle(other_array) # :yields: item, other_item
other_array.each_with_index do |item, index|
yield(self[index % self.length], item)
end
end
end
if $0 == __FILE__ # \<1>
# Array#cycle test
# true => 0
# false => 1
# true => 2
# false => 3
# true => 4
puts 'Array#cycle test' # \<2>
[true, false].cycle([0, 1, 2, 3, 4]) do |a, b|
puts "#{a.inspect} => #{b.inspect}"
end
end
---------------------------------------------------------------------
\<1> First callout.
\<2> Second callout.
---------------------------------------------------------------------
Renders this highlighted source code:
[source,ruby,numbered]
---------------------------------------------------------------------
#
# Useful Ruby base class extensions.
#
class Array
# Execute a block passing it corresponding items in
# +self+ and +other_array+.
# If self has less items than other_array it is repeated.
def cycle(other_array) # :yields: item, other_item
other_array.each_with_index do |item, index|
yield(self[index % self.length], item)
end
end
end
if $0 == __FILE__ # <1>
# Array#cycle test
# true => 0
# false => 1
# true => 2
# false => 3
# true => 4
puts 'Array#cycle test' # <2>
[true, false].cycle([0, 1, 2, 3, 4]) do |a, b|
puts "#{a.inspect} => #{b.inspect}"
end
end
---------------------------------------------------------------------
<1> First callout.
<2> Second callout.
[TIP]
=====
- If the source 'language' attribute has been set (using an
'AttributeEntry' or from the command-line) you don't have to specify
it in each source code block.
- You should place callout markers inside source code comments to
ensure they are not misinterpreted and mangled by the highlighter.
=====

View File

@ -1,231 +0,0 @@
AsciiDoc Tests
==============
AsciiDoc includes 'testasciidoc', a Python script runs a set of
AsciiDoc conformance tests. 'testasciidoc' runs through a list of
AsciiDoc source files, generates backend outputs and then compares
them to expected result files. The whole process is driven by a
configuration file containing a list of user configurable test
specifications.
Rationale
---------
When modifying AsciiDoc configuration files or source code it's very
easy to introduce regression errors. 'testasciidoc' is a tool for
writing many and varied test cases that can be run after changes have
been made in order to verify that existing behavior has not been
broken.
The 'testasciidoc' 'update' command automates the (re)generation of
expected test result data. Result data regeneration has to be
performed after changes to test case source files or after legitimate
changes to the AsciiDoc output formats -- doing this manually is
prohibitively tedious.
Running testasciidoc
--------------------
The `testasciidoc.py` script and the default `testasciidoc.conf`
configuration file are located in the AsciiDoc distribution `tests`
directory.
To view the command usage run:
---------------------------------------------------------------------
$ python tests/testasciidoc.py
Usage: testasciidoc.py [OPTIONS] COMMAND
Run AsciiDoc conformance tests specified in configuration FILE.
Commands:
list List tests
run [NUMBER] [BACKEND] Execute tests
update [NUMBER] [BACKEND] Regenerate and update test data
Options:
-f, --conf-file=CONF_FILE
Use configuration file CONF_FILE (default configuration file is
testasciidoc.conf in testasciidoc.py directory)
--force
Update all test data overwriting existing data
---------------------------------------------------------------------
To view the list of tests in the default `testasciidoc.conf`
configuration file run the 'list' command:
---------------------------------------------------------------------
$ python tests/testasciidoc.py list
1: Test cases
2: Tables
3: Source highlighter
4: Example article
5: Example book
6: Example multi-part book
7: !User Guide
---------------------------------------------------------------------
The '!' prefix signals that a test is currently disabled.
Before running the tests you will need to regenerate the expected
outputs by running the 'update' command:
---------------------------------------------------------------------
$ python tests/testasciidoc.py update
WRITING: tests/data/testcases-html4.html
WRITING: tests/data/testcases-xhtml11.html
WRITING: tests/data/testcases-docbook.xml
:
WRITING: tests/data/book-multi-docbook.xml
---------------------------------------------------------------------
Now you can run the tests:
---------------------------------------------------------------------
$ python tests/testasciidoc.py run
1: Test cases
SOURCE: asciidoc: tests/data/testcases.txt
PASSED: html4: tests/data/testcases-html4.html
PASSED: xhtml11: tests/data/testcases-xhtml11.html
PASSED: docbook: tests/data/testcases-docbook.xml
:
6: Example multi-part book
SOURCE: asciidoc: doc/book-multi.txt
PASSED: html4: tests/data/book-multi-html4.html
PASSED: xhtml11: tests/data/book-multi-xhtml11.html
PASSED: docbook: tests/data/book-multi-docbook.xml
TOTAL PASSED: 18
---------------------------------------------------------------------
[NOTE]
=====================================================================
- 'testasciidoc' requires AsciiDoc is located in your environment
search path, if not you'll need to set the `ASCIIDOC_PY` environment
variable to point to `asciidoc.py`.
- If you don't have GNU source-highlight installed you should disable
the 'Tables' and 'Source highlighter' tests in the
`tests/testasciidoc.conf` configuration file.
=====================================================================
testasciidoc commands
---------------------
'list'::
List test numbers and titles. A '!' title prefix signals that a
test is currently disabled.
'run'::
Read and execute tests from the test configuration file. A test
specifies AsciiDoc test case source file and command options. The
test compares generated outputs to expected outputs and any
differences displayed as a diff. You can run selected tests by
specifying the test number and/or backend after the `run` command.
Examples:
python tests/testasciidoc.py run
python tests/testasciidoc.py run 3
python tests/testasciidoc.py run html4
python tests/testasciidoc.py run 3 html4
'update'::
Generates and updates missing and out of date test output data
files, this eliminates one of the most time consuming aspect of test
management. Use the `--force` option to force updates.
Examples:
python tests/testasciidoc.py update
python tests/testasciidoc.py --force update 4
NOTE: You can run or update disabled tests by explicitly specifying
the test number.
Test configuration file
-----------------------
The tests configuration file format consists of one or more test specs
separated by a line of one or more percent characters. Each test spec
consists of an optional test title and description followed by one or
more optional directives (a directive starts with a percent
character). A 'directive' consists begins with a line containing a '%'
character followed by a directive name followed by zero or more lines
of directive data.
Test spec format
~~~~~~~~~~~~~~~~
---------------------------------------------------------------------
Optional test title
Optional test description...
% name
Optional base output file name. Defaults to base source file name.
% source
AsciiDoc source file name.
% backends
Optional list of backends to be tested(default is all backends).
% options
Optional list of command-line option tuples.
% attributes
Optional dictionary of attribute values.
---------------------------------------------------------------------
Example test spec:
---------------------------------------------------------------------
Example book
% options
['--section-numbers',('--doctype','book')]
% attributes
# Exclude date from document footer.
{'docdate':None}
% source
../doc/book.txt
---------------------------------------------------------------------
TIP: Take a look at the default `tests/testasciidoc.conf`
configuration file that comes with AsciiDoc.
- Tests can be disabled by prefixing the test title with an
exclamation '!' character.
- All relative file names are relative to the configuration file
directory.
- Multiple tests must by separated by a `%` separator line (one or
more percent characters).
- Lines starting with a percent character specify a test 'directive'
and may be followed by zero or more lines of directive data.
- Directive data lines cannot start with a percent character.
- Lines starting with a `#` hash character are ignored.
- The 'source' directive data is a single line containing the
AsciiDoc source file name.
- The 'options' directive data is a Python list of `(name,value)`
tuples specifying AsciiDoc command-line options. A string item is
equivalent to a `(name,None)` tuple.
- The 'attributes' directive data specifies a Python dictionary
containing AsciiDoc attributes to be passed to AsciiDoc.
globals directive
~~~~~~~~~~~~~~~~~
An optional 'globals' directive can precede all test specs, the
globals directive data is a Python dictionary containing global
values. Currently the only global is 'datadir', the directory
containing expected output files (defaults to configuration file
directory). For example:
---------------------------------------------------------------------
% globals
{'datadir': 'data'}
---------------------------------------------------------------------
Expected output test data files are stored in the 'datadir' and are
named after the corresponding AsciiDoc input source file. For example
if the AsciiDoc file name is `article.txt` then the corresponding
backend output files will be `article-html4.html`,
`article-xhtml11.html`, `article-docbook.xml` (stored in the 'datadir'
directory).

View File

@ -1,65 +0,0 @@
AsciiDoc DocBook XSL Stylesheets Notes
======================================
Output file customisation is achieved by tweaking the DocBook XSL
stylesheets. I've tried to keep customization to a minimum and
confine it to the separate XSL driver files in the distribution
`./docbook-xsl/` directory (see the User Guide for details).
To polish some rough edges I've written some patches for the DocBook
XSL stylesheets -- you don't need them but they're documented below
and included in the distribution `./docbook-xsl/` directory.
Manually upgrading Debian to the latest DocBook XSL stylesheets
---------------------------------------------------------------
The DocBook XSL Stylesheets distribution is just a directory full of
text files and you can switch between releases by changing the
directory name in the system XML catalog.
To upgrade to the latest docbook-xsl stylesheets without having to
wait for the Debian `docbook-xsl` package:
- Download the latest docbook-xsl tarball from
http://sourceforge.net/projects/docbook/. Bleeding edge snapshots
can be found at http://docbook.sourceforge.net/snapshots/
- Unzip the tarball to `/usr/share/xml/docbook/stylesheet/`:
$ cd /usr/share/xml/docbook/stylesheet
$ sudo tar -xzf /tmp/docbook-xsl-1.72.0.tar.gz
- Edit `/etc/xml/docbook-xsl.xml` catalog and replace occurences of
the current stylesheets directory with the new one (in our example
it would be `/usr/share/xml/docbook/stylesheet/docbook-xsl-1.72.0`.
$ cd /etc/xml/
$ sudo cp -p docbook-xsl.xml docbook-xsl.xml.ORIG
$ sudo vi docbook-xsl.xml
Customizing Generated Text
--------------------------
An example
http://www.sagehill.net/docbookxsl/CustomGentext.html#CustomGenText[DocBook
XSL Stylesheets customization file] for formatting chapter titles
without chapter numbering.
.custom-chapter.xml
---------------------------------------------------------------------
<!-- Customize chapter title -->
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="en">
<l:context name="title">
<l:template name="chapter" text="%t"/>
</l:context>
</l:l10n>
</l:i18n>
---------------------------------------------------------------------
Executed with this 'xsltproc' parameter:
--param local.l10n.xml document\(\'custom-chapter.xml\'\)
NOTE: This example is hypothetical -- use the 'xsltproc'
`--stringparam chapter.autolabel 0` option to do the same job.

View File

@ -1,17 +0,0 @@
<!--
Generates chunked XHTML documents from DocBook XML source using DocBook XSL
stylesheets.
NOTE: The URL reference to the current DocBook XSL stylesheets is
rewritten to point to the copy on the local disk drive by the XML catalog
rewrite directives so it doesn't need to go out to the Internet for the
stylesheets. This means you don't need to edit the <xsl:import> elements on
a machine by machine basis.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
<xsl:import href="common.xsl"/>
<xsl:param name="navig.graphics.path">images/icons/</xsl:param>
<xsl:param name="admon.graphics.path">images/icons/</xsl:param>
<xsl:param name="callout.graphics.path" select="'images/icons/callouts/'"/>
</xsl:stylesheet>

View File

@ -1,106 +0,0 @@
<!--
Inlcuded in xhtml.xsl, xhtml.chunked.xsl, htmlhelp.xsl.
Contains common XSL stylesheets parameters.
Output documents styled by docbook.css.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="html.stylesheet" select="'docbook-xsl.css'"/>
<xsl:param name="htmlhelp.chm" select="'htmlhelp.chm'"/>
<xsl:param name="htmlhelp.hhc.section.depth" select="5"/>
<xsl:param name="section.autolabel">
<xsl:choose>
<xsl:when test="/processing-instruction('asciidoc-numbered')">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="suppress.navigation" select="0"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/>
<xsl:param name="navig.graphics" select="0"/>
<xsl:param name="navig.graphics.path">images/icons/</xsl:param>
<xsl:param name="navig.showtitles">0</xsl:param>
<xsl:param name="shade.verbatim" select="0"/>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="admon.graphics.path">images/icons/</xsl:param>
<xsl:param name="admon.graphics.extension" select="'.png'"/>
<xsl:param name="admon.style">
<xsl:text>margin-left: 0; margin-right: 10%;</xsl:text>
</xsl:param>
<xsl:param name="admon.textlabel" select="1"/>
<xsl:param name="callout.defaultcolumn" select="'60'"/>
<xsl:param name="callout.graphics.extension" select="'.png'"/>
<xsl:param name="callout.graphics" select="'1'"/>
<xsl:param name="callout.graphics.number.limit" select="'10'"/>
<xsl:param name="callout.graphics.path" select="'images/icons/callouts/'"/>
<xsl:param name="callout.list.table" select="'1'"/>
<!-- This does not seem to work. -->
<xsl:param name="section.autolabel.max.depth" select="2"/>
<xsl:param name="chunk.first.sections" select="1"/>
<xsl:param name="chunk.section.depth" select="1"/>
<xsl:param name="chunk.quietly" select="0"/>
<xsl:param name="chunk.toc" select="''"/>
<xsl:param name="chunk.tocs.and.lots" select="0"/>
<xsl:param name="html.cellpadding" select="'4px'"/>
<xsl:param name="html.cellspacing" select="''"/>
<xsl:param name="table.borders.with.css" select="1"/>
<xsl:param name="table.cell.border.color" select="'#527bbd'"/>
<xsl:param name="table.cell.border.style" select="'solid'"/>
<xsl:param name="table.cell.border.thickness" select="'1px'"/>
<xsl:param name="table.footnote.number.format" select="'a'"/>
<xsl:param name="table.footnote.number.symbols" select="''"/>
<xsl:param name="table.frame.border.color" select="'#527bbd'"/>
<xsl:param name="table.frame.border.style" select="'solid'"/>
<xsl:param name="table.frame.border.thickness" select="'3px'"/>
<xsl:param name="tablecolumns.extension" select="'1'"/>
<xsl:param name="highlight.source" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<!--
Table of contents inserted by <?asciidoc-toc?> processing instruction.
-->
<xsl:param name="generate.toc">
<xsl:choose>
<xsl:when test="/processing-instruction('asciidoc-toc')">
article toc,title
book toc,title,figure,table,example,equation
<!-- The only way I could find that suppressed book chapter TOCs -->
<xsl:if test="$generate.section.toc.level != 0">
chapter toc,title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
sect1 toc
sect2 toc
sect3 toc
sect4 toc
sect5 toc
section toc
set toc,title
</xsl:if>
</xsl:when>
<xsl:otherwise>
article nop
book nop
</xsl:otherwise>
</xsl:choose>
</xsl:param>
</xsl:stylesheet>

View File

@ -1,35 +0,0 @@
<!--
Generates EPUB XHTML documents from DocBook XML source using DocBook XSL
stylesheets.
NOTE: The URL reference to the current DocBook XSL stylesheets is
rewritten to point to the copy on the local disk drive by the XML catalog
rewrite directives so it doesn't need to go out to the Internet for the
stylesheets. This means you don't need to edit the <xsl:import> elements on
a machine by machine basis.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/epub/docbook.xsl"/>
<xsl:import href="common.xsl"/>
<!--
DocBook XSL 1.75.2: Nav headers are invalid XHTML (table width element).
Suppressed by default in Docbook XSL 1.76.1 epub.xsl.
-->
<xsl:param name="suppress.navigation" select="1"/>
<!--
DocBook XLS 1.75.2 doesn't handle TOCs
-->
<xsl:param name="generate.toc">
<xsl:choose>
<xsl:when test="/article">
/article nop
</xsl:when>
<xsl:when test="/book">
/book nop
</xsl:when>
</xsl:choose>
</xsl:param>
</xsl:stylesheet>

View File

@ -1,152 +0,0 @@
<!--
Generates single FO document from DocBook XML source using DocBook XSL
stylesheets.
See xsl-stylesheets/fo/param.xsl for all parameters.
NOTE: The URL reference to the current DocBook XSL stylesheets is
rewritten to point to the copy on the local disk drive by the XML catalog
rewrite directives so it doesn't need to go out to the Internet for the
stylesheets. This means you don't need to edit the <xsl:import> elements on
a machine by machine basis.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
<xsl:import href="common.xsl"/>
<xsl:param name="fop1.extensions" select="1" />
<xsl:param name="variablelist.as.blocks" select="1" />
<xsl:param name="paper.type" select="'A4'"/>
<!--
<xsl:param name="paper.type" select="'USletter'"/>
-->
<xsl:param name="hyphenate">false</xsl:param>
<!-- justify, left or right -->
<xsl:param name="alignment">left</xsl:param>
<xsl:param name="body.font.family" select="'serif'"/>
<xsl:param name="body.font.master">12</xsl:param>
<xsl:param name="body.font.size">
<xsl:value-of select="$body.font.master"/><xsl:text>pt</xsl:text>
</xsl:param>
<xsl:param name="body.margin.bottom" select="'0.5in'"/>
<xsl:param name="body.margin.top" select="'0.5in'"/>
<xsl:param name="bridgehead.in.toc" select="0"/>
<!-- overide setting in common.xsl -->
<xsl:param name="table.frame.border.thickness" select="'2px'"/>
<!-- Default fetches image from Internet (long timeouts) -->
<xsl:param name="draft.watermark.image" select="''"/>
<!-- Line break -->
<xsl:template match="processing-instruction('asciidoc-br')">
<fo:block/>
</xsl:template>
<!-- Horizontal ruler -->
<xsl:template match="processing-instruction('asciidoc-hr')">
<fo:block space-after="1em">
<fo:leader leader-pattern="rule" rule-thickness="0.5pt" rule-style="solid" leader-length.minimum="100%"/>
</fo:block>
</xsl:template>
<!-- Hard page break -->
<xsl:template match="processing-instruction('asciidoc-pagebreak')">
<fo:block break-after='page'/>
</xsl:template>
<!-- Sets title to body text indent -->
<xsl:param name="body.start.indent">
<xsl:choose>
<xsl:when test="$fop.extensions != 0">0pt</xsl:when>
<xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
<xsl:otherwise>1pc</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="title.margin.left">
<xsl:choose>
<xsl:when test="$fop.extensions != 0">-1pc</xsl:when>
<xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
<xsl:otherwise>0pt</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="page.margin.bottom" select="'0.25in'"/>
<xsl:param name="page.margin.inner">
<xsl:choose>
<xsl:when test="$double.sided != 0">0.75in</xsl:when>
<xsl:otherwise>0.75in</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="page.margin.outer">
<xsl:choose>
<xsl:when test="$double.sided != 0">0.5in</xsl:when>
<xsl:otherwise>0.5in</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="page.margin.top" select="'0.5in'"/>
<xsl:param name="page.orientation" select="'portrait'"/>
<xsl:param name="page.width">
<xsl:choose>
<xsl:when test="$page.orientation = 'portrait'">
<xsl:value-of select="$page.width.portrait"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$page.height.portrait"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:attribute-set name="monospace.properties">
<xsl:attribute name="font-size">10pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="admonition.title.properties">
<xsl:attribute name="font-size">14pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
<xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="sidebar.properties" use-attribute-sets="formal.object.properties">
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-width">1pt</xsl:attribute>
<xsl:attribute name="border-color">silver</xsl:attribute>
<xsl:attribute name="background-color">#ffffee</xsl:attribute>
<xsl:attribute name="padding-left">12pt</xsl:attribute>
<xsl:attribute name="padding-right">12pt</xsl:attribute>
<xsl:attribute name="padding-top">6pt</xsl:attribute>
<xsl:attribute name="padding-bottom">6pt</xsl:attribute>
<xsl:attribute name="margin-left">0pt</xsl:attribute>
<xsl:attribute name="margin-right">12pt</xsl:attribute>
<xsl:attribute name="margin-top">6pt</xsl:attribute>
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="callout.graphics" select="'1'"/>
<!-- Only shade programlisting and screen verbatim elements -->
<xsl:param name="shade.verbatim" select="1"/>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="background-color">
<xsl:choose>
<xsl:when test="self::programlisting|self::screen">#E0E0E0</xsl:when>
<xsl:otherwise>inherit</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>
<!--
Force XSL Stylesheets 1.72 default table breaks to be the same as the current
version (1.74) default which (for tables) is keep-together="auto".
-->
<xsl:attribute-set name="table.properties">
<xsl:attribute name="keep-together.within-column">auto</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>

View File

@ -1,16 +0,0 @@
<!--
Generates chunked HTML Help HTML documents from DocBook XML source using
DocBook XSL stylesheets.
NOTE: The URL reference to the current DocBook XSL stylesheets is
rewritten to point to the copy on the local disk drive by the XML catalog
rewrite directives so it doesn't need to go out to the Internet for the
stylesheets. This means you don't need to edit the <xsl:import> elements on
a machine by machine basis.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl"/>
<xsl:import href="common.xsl"/>
<xsl:param name="htmlhelp.hhp" select="'asciidoc.hhp'"/>
<xsl:param name="suppress.navigation" select="1"/>
</xsl:stylesheet>

View File

@ -1,31 +0,0 @@
<!--
Generates single roff manpage document from DocBook XML source using DocBook
XSL stylesheets.
NOTE: The URL reference to the current DocBook XSL stylesheets is
rewritten to point to the copy on the local disk drive by the XML catalog
rewrite directives so it doesn't need to go out to the Internet for the
stylesheets. This means you don't need to edit the <xsl:import> elements on
a machine by machine basis.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
<xsl:import href="common.xsl"/>
<!-- Only render the link text -->
<xsl:template match="ulink">
<xsl:variable name="content">
<xsl:apply-templates/>
</xsl:variable>
<xsl:value-of select="$content"/>
</xsl:template>
<!-- Don't automatically generate the REFERENCES section -->
<xsl:template name="endnotes.list">
</xsl:template>
<!-- Next entry for backward compatibility with old docbook-xsl versions -->
<xsl:template name="format.links.list">
</xsl:template>
</xsl:stylesheet>

View File

@ -1,55 +0,0 @@
<?xml version="1.0"?>
<!--
Used by AsciiDoc a2x(1) for w3m(1) based text generation.
NOTE: The URL reference to the current DocBook XSL stylesheets is
rewritten to point to the copy on the local disk drive by the XML catalog
rewrite directives so it doesn't need to go out to the Internet for the
stylesheets. This means you don't need to edit the <xsl:import> elements on
a machine by machine basis.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import
href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
<!-- parameters for optimal text output -->
<xsl:param name="callout.graphics" select="0"/>
<xsl:param name="callout.unicode" select="0"/>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<xsl:param name="generate.toc">
appendix title
article/appendix nop
article toc,title
book toc,title,figure,table,example,equation
chapter title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
section toc
set toc,title
</xsl:param>
<xsl:template match="book/bookinfo/title | article/articleinfo/title" mode="titlepage.mode">
<hr />
<xsl:apply-imports/>
<hr />
</xsl:template>
<xsl:template match="book/*/title | article/*/title" mode="titlepage.mode">
<br /><hr />
<xsl:apply-imports/>
<hr />
</xsl:template>
<xsl:template match="book/chapter/*/title | article/section/*/title" mode="titlepage.mode">
<br />
<xsl:apply-imports/>
<hr width="100" align="left" />
</xsl:template>
</xsl:stylesheet>

View File

@ -1,14 +0,0 @@
<!--
Generates single XHTML document from DocBook XML source using DocBook XSL
stylesheets.
NOTE: The URL reference to the current DocBook XSL stylesheets is
rewritten to point to the copy on the local disk drive by the XML catalog
rewrite directives so it doesn't need to go out to the Internet for the
stylesheets. This means you don't need to edit the <xsl:import> elements on
a machine by machine basis.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
<xsl:import href="common.xsl"/>
</xsl:stylesheet>

View File

@ -1,802 +0,0 @@
#
# docbook45.conf
#
# Asciidoc DocBook 4.5 configuration file.
#
[miscellaneous]
outfilesuffix=.xml
# Printable page width and units.
# Used to calculate DocBook CALS tables absolute column and table widths.
pagewidth=425
pageunits=*
[attributes]
basebackend=docbook
basebackend-docbook=
basebackend-docbook45=
# For backward compatibility (docbook backend was renamed to docbook45 at 8.6.2)
backend-docbook=
# toc and numbered are set to maintain original default behavior.
toc=
numbered=
[replacements2]
# Line break markup. Custom processing instruction in fo.xsl.
(?m)^(.*)\s\+$=\1<?asciidoc-br?>
[replacements]
ifdef::asciidoc7compatible[]
# Superscripts.
\^(.+?)\^=<superscript>\1</superscript>
# Subscripts.
~(.+?)~=<subscript>\1</subscript>
endif::asciidoc7compatible[]
[ruler-blockmacro]
# Uses custom processing instructions in fo.xsl and asciidoc-dblatex.xsl.
<simpara><?asciidoc-hr?></simpara>
[pagebreak-blockmacro]
# Uses custom processing instructions in fo.xsl and asciidoc-dblatex.xsl.
<simpara><?asciidoc-pagebreak?></simpara>
[blockdef-pass]
latexmath-style=template="latexmathblock",subs=()
[macros]
# math macros.
(?su)[\\]?(?P<name>latexmath):(?P<subslist>\S*?)\[(?P<passtext>.*?)(?<!\\)\]=[]
(?u)^(?P<name>latexmath)::(?P<subslist>\S*?)(\[(?P<passtext>.*?)\])$=#[]
[latexmath-inlinemacro]
<inlineequation>
<alt><![CDATA[{passtext}]]></alt>
<inlinemediaobject><textobject><phrase></phrase></textobject></inlinemediaobject>
</inlineequation>
[latexmath-blockmacro]
<informalequation>
<alt><![CDATA[{passtext}]]></alt>
<mediaobject><textobject><phrase></phrase></textobject></mediaobject>
</informalequation>
[latexmathblock]
<equation{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><title>{title}</title>
{title%}<informalequation{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<alt><![CDATA[|]]></alt>
<mediaobject><textobject><phrase></phrase></textobject></mediaobject>
{title#}</equation>
{title%}</informalequation>
[image-inlinemacro]
<inlinemediaobject>
<imageobject>
<imagedata fileref="{imagesdir=}{imagesdir?/}{target}"{width? contentwidth="{width}"}{height? contentdepth="{height}"}{scale? scale="{scale}"}/>
</imageobject>
<textobject><phrase>{alt={target}}</phrase></textobject>
</inlinemediaobject>
[image-blockmacro]
<figure{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}{pgwide-option? pgwide="1"}><title>{title}</title>
{title%}<informalfigure{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>{pgwide-option?<?dbfo pgwide="1"?>}
# DocBook XSL Stylesheets custom processing instructions.
<?dbfo keep-together="{breakable-option#auto}"?>
<?dbfo keep-together="{unbreakable-option#always}"?>
<mediaobject>
<imageobject>
<imagedata fileref="{imagesdir=}{imagesdir?/}{target}"{width? contentwidth="{width}"}{height? contentdepth="{height}"}{scale? scale="{scale}"}{scaledwidth? width="{scaledwidth}" scalefit="1"}{align? align="{align}"}/>
</imageobject>
<textobject><phrase>{alt={target}}</phrase></textobject>
</mediaobject>
{title#}</figure>
{title%}</informalfigure>
[indexterm-inlinemacro]
# Index term.
# Generate separate index entries for primary, secondary and tertiary
# descriptions.
# Primary only.
{2%}<indexterm>
{2%} <primary>{1}</primary>
{2%}</indexterm>
# Primary and secondary.
{2#}{3%}<indexterm>
{2#}{3%} <primary>{1}</primary><secondary>{2}</secondary>
{2#}{3%}</indexterm>
{2#}{3%}<indexterm>
{2#}{3%} <primary>{2}</primary>
{2#}{3%}</indexterm>
# Primary, secondary and tertiary.
{3#}<indexterm>
<primary>{1}</primary><secondary>{2}</secondary><tertiary>{3}</tertiary>
{3#}</indexterm>
{3#}<indexterm>
<primary>{2}</primary><secondary>{3}</secondary>
{3#}</indexterm>
{3#}<indexterm>
<primary>{3}</primary>
{3#}</indexterm>
[indexterm2-inlinemacro]
# Index term.
# Single entry index term that is visible in the primary text flow.
<indexterm><primary>{1}</primary></indexterm>{1}
[footnote-inlinemacro]
# Footnote.
<footnote><simpara>{0}</simpara></footnote>
[footnoteref-inlinemacro]
# Footnote reference.
{2#}<footnote id="{1}"><simpara>{2}</simpara></footnote>
{2%}<footnoteref linkend="{1}" />
[callout-inlinemacro]
# Callout.
<co id="{coid}"/>
# List tags.
[listtags-bulleted]
list=<itemizedlist{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}{compact-option? spacing="compact"}>{unbreakable-option? <?dbfo keep-together="always"?>}{title?<title>{title}</title>}|</itemizedlist>
item=<listitem>|</listitem>
text=<simpara>|</simpara>
[listtags-numbered]
list=<orderedlist{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"} numeration="{style}"{compact-option? spacing="compact"}>{unbreakable-option? <?dbfo keep-together="always"?>}{title?<title>{title}</title>}{start?<?dbfo start="{start}"?><?dbhtml start="{start}"?>}|</orderedlist>
item=<listitem>|</listitem>
text=<simpara>|</simpara>
[listtags-labeled]
list=<variablelist{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>{title?<title>{title}</title>}|</variablelist>
entry=<varlistentry>|</varlistentry>
label=
term=<term>|</term>
item=<listitem>|</listitem>
text=<simpara>|</simpara>
[listtags-horizontal]
# Horizontal labeled list (implemented with two column table).
# Hardwired column widths to 30%,70% because the current crop of PDF
# generators do not auto calculate column widths.
list=<{title?table}{title!informaltable}{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}{style? tabstyle="{style}"}{pgwide-option? pgwide="1"} frame="none" colsep="0" rowsep="0">{title?<title>{title}</title>}<tgroup cols="2"><colspec colwidth="{labelwidth=15}*"/><colspec colwidth="{itemwidth=85}*"/><tbody valign="top">|</tbody></tgroup><{title?/table}{title!/informaltable}>
entry=<row>|</row>
label=<entry>|</entry>
term=<simpara>|</simpara>
item=<entry>|</entry>
text=<simpara>|</simpara>
[listtags-callout]
list=<calloutlist{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>{title?<title>{title}</title>}|</calloutlist>
item=<callout arearefs="{coids}">|</callout>
text=<para>|</para>
[listtags-qanda]
list=<qandaset{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>{title?<title>{title}</title>}|</qandaset>
entry=<qandaentry>|</qandaentry>
label=<question>|</question>
term=<simpara>|</simpara>
item=<answer>|</answer>
text=<simpara>|</simpara>
[listtags-bibliography]
list=<bibliodiv{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>{title?<title>{title}</title>}|</bibliodiv>
item=<bibliomixed>|</bibliomixed>
text=<bibliomisc>|</bibliomisc>
[listtags-glossary]
list=
entry=<glossentry>|</glossentry>
label=
term=<glossterm>|</glossterm>
item=<glossdef>|</glossdef>
text=<simpara>|</simpara>
[tags]
# Quoted text
emphasis=<emphasis>{1?<phrase role="{1}">}|{1?</phrase>}</emphasis>
strong=<emphasis role="strong">{1?<phrase role="{1}">}|{1?</phrase>}</emphasis>
monospaced=<literal>{1?<phrase role="{1}">}|{1?</phrase>}</literal>
singlequoted={lsquo}{1?<phrase role="{1}">}|{1?</phrase>}{rsquo}
doublequoted={ldquo}{1?<phrase role="{1}">}|{1?</phrase>}{rdquo}
unquoted={1?<phrase role="{1}">}|{1?</phrase>}
subscript=<subscript>{1?<phrase role="{1}">}|{1?</phrase>}</subscript>
superscript=<superscript>{1?<phrase role="{1}">}|{1?</phrase>}</superscript>
ifdef::deprecated-quotes[]
# Override with deprecated quote attributes.
emphasis={role?<phrase role="{role}">}<emphasis>|</emphasis>{role?</phrase>}
strong={role?<phrase role="{role}">}<emphasis role="strong">|</emphasis>{role?</phrase>}
monospaced={role?<phrase role="{role}">}<literal>|</literal>{role?</phrase>}
singlequoted={role?<phrase role="{role}">}{amp}#8216;|{amp}#8217;{role?</phrase>}
doublequoted={role?<phrase role="{role}">}{amp}#8220;|{amp}#8221;{role?</phrase>}
unquoted={role?<phrase role="{role}">}|{role?</phrase>}
subscript={role?<phrase role="{role}">}<subscript>|</subscript>{role?</phrase>}
superscript={role?<phrase role="{role}">}<superscript>|</superscript>{role?</phrase>}
endif::deprecated-quotes[]
# Inline macros
[http-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[https-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[ftp-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[file-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[irc-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[mailto-inlinemacro]
<ulink url="mailto:{target}">{0={target}}</ulink>
[callto-inlinemacro]
<ulink url="{name}:{target}">{0={target}}</ulink>
[link-inlinemacro]
<ulink url="{target}">{0={target}}</ulink>
# anchor:id[text]
[anchor-inlinemacro]
<anchor id="{target}" xreflabel="{0=[{target}]}"/>
# [[id,text]]
[anchor2-inlinemacro]
<anchor id="{1}" xreflabel="{2=[{1}]}"/>
# [[[id]]]
[anchor3-inlinemacro]
<anchor id="{1}" xreflabel="[{1}]"/>[{1}]
# xref:id[text]
[xref-inlinemacro]
<link linkend="{target}">{0}</link>
{2%}<xref linkend="{target}"/>
# <<id,text>>
[xref2-inlinemacro]
<link linkend="{1}">{2}</link>
{2%}<xref linkend="{1}"/>
# // comment line
[comment-inlinemacro]
{showcomments#}<remark>{passtext}</remark>
[comment-blockmacro]
{showcomments#}<remark>{passtext}</remark>
[literal-inlinemacro]
# Inline literal.
<literal>{passtext}</literal>
# Special word macros
[emphasizedwords]
<emphasis>{words}</emphasis>
[monospacedwords]
<literal>{words}</literal>
[strongwords]
<emphasis role="strong">{words}</emphasis>
# Paragraph substitution.
[paragraph]
<formalpara{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><title>{title}</title><para>
{title%}<simpara{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
|
{title%}</simpara>
{title#}</para></formalpara>
{empty}
[admonitionparagraph]
<{name}{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><simpara>|</simpara></{name}>
# Delimited blocks.
[literalblock]
<formalpara{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><title>{title}</title><para>
{title#}<literallayout class="monospaced">
{title%}<literallayout{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"} class="monospaced">
|
</literallayout>
{title#}</para></formalpara>
[listingblock]
<formalpara{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><title>{title}</title><para>
{title#}<screen>
{title%}<screen{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
|
</screen>
{title#}</para></formalpara>
[sidebarblock-open]
<sidebar{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
[sidebarblock-close]
</sidebar>
[sidebarblock]
template::[sidebarblock-open]
|
template::[sidebarblock-close]
[sidebarparagraph]
template::[sidebarblock-open]
<simpara>|</simpara>
template::[sidebarblock-close]
[abstractblock-open]
<abstract{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
[abstractblock-close]
</abstract>
[abstractblock]
template::[abstractblock-open]
|
template::[abstractblock-close]
[abstractparagraph]
template::[abstractblock-open]
<simpara>|</simpara>
template::[abstractblock-close]
[openblock]
|
[partintroblock-open]
<partintro{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
[partintroblock-close]
</partintro>
[partintroblock]
template::[partintroblock-open]
|
template::[partintroblock-close]
[partintroparagraph]
template::[partintroblock-open]
<simpara>|</simpara>
template::[partintroblock-close]
[quote-open]
# Common quote and verse element template.
<blockquote{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
# Include attribution only if either {attribution} or {citetitle} is defined.
{attribution#}<attribution>
{attribution%}{citetitle#}<attribution>
{attribution}
<citetitle>{citetitle}</citetitle>
{attribution#}</attribution>
{attribution%}{citetitle#}</attribution>
[quote-close]
</blockquote>
[quoteblock]
template::[quote-open]
|
template::[quote-close]
[verseblock]
template::[quote-open]
<literallayout>|</literallayout>
template::[quote-close]
[quoteparagraph]
template::[quote-open]
<simpara>|</simpara>
template::[quote-close]
[exampleblock-open]
<{title?example}{title!informalexample}{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
# DocBook XSL Stylesheets custom processing instructions.
<?dbfo keep-together="{breakable-option#auto}"?>
<?dbfo keep-together="{unbreakable-option#always}"?>
<title>{title}</title>
[exampleblock-close]
</{title?example}{title!informalexample}>
[exampleblock]
template::[exampleblock-open]
|
template::[exampleblock-close]
[exampleparagraph]
template::[exampleblock-open]
<simpara>|</simpara>
template::[exampleblock-close]
[admonitionblock]
<{name}{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</{name}>
# Tables.
[tabletags-default]
colspec=<colspec colname="col_{colnumber}" colwidth="{width!{colpcwidth}*}{width?{colabswidth}{pageunits}}"/>
bodyrow=<row>|</row>
headdata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}>|</entry>
bodydata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}>|</entry>
paragraph=<simpara>|</simpara>
[tabletags-emphasis]
paragraph=<simpara><emphasis>|</emphasis></simpara>
[tabletags-header]
paragraph=<simpara><emphasis role="strong">|</emphasis></simpara>
[tabletags-strong]
paragraph=<simpara><emphasis role="strong">|</emphasis></simpara>
[tabletags-monospaced]
paragraph=<simpara><literal>|</literal></simpara>
[tabletags-verse]
bodydata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}><literallayout>|</literallayout></entry>
paragraph=
[tabletags-literal]
bodydata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}><literallayout class="monospaced">|</literallayout></entry>
paragraph=
[tabletags-asciidoc]
paragraph=
[table]
<{title?table}{title!informaltable}{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}{pgwide-option? pgwide="1"}
frame="{frame=all}"
{grid%rowsep="1" colsep="1"}
rowsep="{grid@none|cols:0:1}" colsep="{grid@none|rows:0:1}"
>
<title>{title}</title>
# DocBook XSL Stylesheets custom processing instructions.
<?dbhtml table-width="{width}"?>
<?dbfo table-width="{width}"?>
<?dblatex table-width="{width}"?>
<?dbfo keep-together="{breakable-option#auto}"?>
<?dbfo keep-together="{unbreakable-option#always}"?>
<tgroup cols="{colcount}">
{colspecs}
{headrows#}<thead>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot>
{footrows}
{footrows#}</tfoot>
<tbody>
{bodyrows}
</tbody>
</tgroup>
</{title?table}{title!informaltable}>
#--------------------------------------------------------------------
# Deprecated old table definitions.
#
[old_tabledef-default]
template=old_table
colspec=<colspec colwidth="{colwidth}{pageunits}" align="{colalign}"/>
bodyrow=<row>|</row>
bodydata=<entry>|</entry>
[old_table]
<{title?table}{title!informaltable}{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"} pgwide="0"
frame="{frame=topbot}"
{grid%rowsep="0" colsep="0"}
rowsep="{grid@none|cols:0:1}" colsep="{grid@none|rows:0:1}"
>
<title>{title}</title>
<tgroup cols="{cols}">
{colspecs}
{headrows#}<thead>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot>
{footrows}
{footrows#}</tfoot>
<tbody>
{bodyrows}
</tbody>
</tgroup>
</{title?table}{title!informaltable}>
# End of deprecated old table definitions.
#--------------------------------------------------------------------
# Special sections.
[preface]
<preface{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title=}</title>
|
</preface>
[index]
<index{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</index>
[bibliography]
<bibliography{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</bibliography>
[glossary]
<glossary{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</glossary>
[appendix]
<appendix{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</appendix>
[floatingtitle]
<bridgehead{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"} renderas="sect{level}">{title}</bridgehead>
[header-declarations]
<?xml version="1.0" encoding="{encoding}"?>
<!DOCTYPE {doctype-article?article}{doctype-book?book}{doctype-manpage?refentry} PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
{toc#}<?asciidoc-toc?>
{numbered#}<?asciidoc-numbered?>
[+docinfo]
{notitle%} <title>{doctitle}</title>
<date>{revdate}</date>
# To ensure valid articleinfo/bookinfo when there is no AsciiDoc header.
{doctitle%}{revdate%}<date>{docdate}</date>
{authored#}<author>
<firstname>{firstname}</firstname>
<othername>{middlename}</othername>
<surname>{lastname}</surname>
<email>{email}</email>
{authored#}</author>
<authorinitials>{authorinitials}</authorinitials>
<revhistory><revision>{revnumber?<revnumber>{revnumber}</revnumber>}<date>{revdate}</date>{authorinitials?<authorinitials>{authorinitials}</authorinitials>}{revremark?<revremark>{revremark}</revremark>}</revision></revhistory>
{docinfo1,docinfo2#}{include:{docdir}/docinfo.xml}
{docinfo,docinfo2#}{include:{docdir}/{docname}-docinfo.xml}
# DEPRECATED: Use docinfo.
{revisionhistory#}{include:{docdir}/{docname}-revhistory.xml}
# DEPRECATED: Use orgname in preference to companyname.
<orgname>{companyname}</orgname>
# DEPRECATED: Use orgname in preference to corpname.
<orgname>{corpname}</orgname>
<orgname>{orgname}</orgname>
#-------------------------
# article document type
#-------------------------
ifdef::doctype-article[]
[header]
template::[header-declarations]
<article lang="{lang=en}">
<articleinfo>
template::[docinfo]
</articleinfo>
[footer]
</article>
[preamble]
# Untitled elements between header and first section title.
|
[abstract]
<abstract{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
|
</abstract>
[sect1]
<section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</section>
[sect2]
<section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</section>
[sect3]
<section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</section>
[sect4]
<section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</section>
endif::doctype-article[]
#-------------------------
# manpage document type
#-------------------------
ifdef::doctype-manpage[]
[replacements]
# The roff format does not substitute special characters so just print them as
# text.
\(C\)=(C)
\(TM\)=(TM)
[header]
template::[header-declarations]
<refentry lang="{lang=en}">
<refentryinfo>
template::[docinfo]
</refentryinfo>
<refmeta>
<refentrytitle>{mantitle}</refentrytitle>
<manvolnum>{manvolnum}</manvolnum>
# Default source and manual to suppress DocBook XSL warnings.
<refmiscinfo class="source">{mansource=&#160;}</refmiscinfo>
<refmiscinfo class="manual">{manmanual=&#160;}</refmiscinfo>
<refmiscinfo class="version">{manversion={revnumber}}</refmiscinfo>
</refmeta>
<refnamediv>
<refname>{manname1}</refname>
<refname>{manname2}</refname>
<refname>{manname3}</refname>
<refname>{manname4}</refname>
<refname>{manname5}</refname>
<refname>{manname6}</refname>
<refname>{manname7}</refname>
<refname>{manname8}</refname>
<refname>{manname9}</refname>
<refpurpose>{manpurpose}</refpurpose>
</refnamediv>
[footer]
</refentry>
# Section macros
[synopsis]
<refsynopsisdiv{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
|
</refsynopsisdiv>
[sect1]
<refsect1{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</refsect1>
[sect2]
<refsect2{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</refsect2>
[sect3]
<refsect3{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</refsect3>
endif::doctype-manpage[]
#-------------------------
# book document type
#-------------------------
ifdef::doctype-book[]
[header]
template::[header-declarations]
<book lang="{lang=en}">
<bookinfo>
template::[docinfo]
</bookinfo>
[footer]
</book>
[preamble]
# Preamble is not allowed in DocBook book so wrap it in a preface.
<preface{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title=}</title>
|
</preface>
[dedication]
<dedication{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</dedication>
[colophon]
<colophon{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</colophon>
[sect0]
<part{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</part>
[sect1]
<chapter{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</chapter>
[sect2]
<section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</section>
[sect3]
<section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</section>
[sect4]
<section{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}>
<title>{title}</title>
|
</section>
endif::doctype-book[]
ifdef::sgml[]
#
# Optional DocBook SGML.
#
# Most of the differences between DocBook XML and DocBook SGML boils
# down to the empty element syntax: SGML does not like the XML empty
# element <.../> syntax, use <...> instead.
#
[miscellaneous]
outfilesuffix=.sgml
[header-declarations]
<!DOCTYPE {doctype-article?article}{doctype-book?book}{doctype-manpage?refentry} PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
[tabledef-default]
colspec=<colspec colwidth="{colabswidth}{pageunits}" align="{colalign}">
[image-inlinemacro]
<inlinemediaobject>
<imageobject>
<imagedata fileref="{imagesdir=}{imagesdir?/}{target}"{width? width="{width}"}{height? depth="{height}"}>
</imageobject>
<textobject><phrase>{alt={target}}</phrase></textobject>
</inlinemediaobject>
[image-blockmacro]
<figure><title>{title}</title>
{title%}<informalfigure>
<mediaobject>
<imageobject>
<imagedata fileref="{imagesdir=}{imagesdir?/}{target}"{width? width="{width}"}{height? depth="{height}"}>
</imageobject>
<textobject><phrase>{alt={target}}</phrase></textobject>
</mediaobject>
{title#}</figure>
{title%}</informalfigure>
# Inline macros
[xref-inlinemacro]
<link linkend="{target}">{0}</link>
{2%}<xref linkend="{target}">
[xref2-inlinemacro]
# <<id,text>>
<link linkend="{1}">{2}</link>
{2%}<xref linkend="{1}">
[anchor-inlinemacro]
<anchor id="{target}" xreflabel="{0=[{target}]}">
[anchor2-inlinemacro]
# [[id,text]]
<anchor id="{1}" xreflabel="{2=[{1}]}">
endif::sgml[]

View File

@ -1,938 +0,0 @@
/*
ASCIIMathML.js
==============
This file contains JavaScript functions to convert ASCII math notation
to Presentation MathML. The conversion is done while the (X)HTML page
loads, and should work with Firefox/Mozilla/Netscape 7+ and Internet
Explorer 6+MathPlayer (http://www.dessci.com/en/products/mathplayer/).
Just add the next line to your (X)HTML page with this file in the same folder:
This is a convenient and inexpensive solution for authoring MathML.
Version 1.4.7 Dec 15, 2005, (c) Peter Jipsen http://www.chapman.edu/~jipsen
Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js
For changes see http://www.chapman.edu/~jipsen/mathml/asciimathchanges.txt
If you use it on a webpage, please send the URL to jipsen@chapman.edu
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License (at http://www.gnu.org/copyleft/gpl.html)
for more details.
*/
var checkForMathML = true; // check if browser can display MathML
var notifyIfNoMathML = true; // display note if no MathML capability
var alertIfNoMathML = false; // show alert box if no MathML capability
var mathcolor = ""; // change it to "" (to inherit) or any other color
var mathfontfamily = "serif"; // change to "" to inherit (works in IE)
// or another family (e.g. "arial")
var displaystyle = true; // puts limits above and below large operators
var showasciiformulaonhover = true; // helps students learn ASCIIMath
var decimalsign = "."; // change to "," if you like, beware of `(1,2)`!
var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters
var AMdelimiter2 = "$", AMescape2 = "\\\\\\$", AMdelimiter2regexp = "\\$";
var doubleblankmathdelimiter = false; // if true, x+1 is equal to `x+1`
// for IE this works only in <!-- -->
//var separatetokens;// has been removed (email me if this is a problem)
var isIE = document.createElementNS==null;
if (document.getElementById==null)
alert("This webpage requires a recent browser such as\
\nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")
// all further global variables start with "AM"
function AMcreateElementXHTML(t) {
if (isIE) return document.createElement(t);
else return document.createElementNS("http://www.w3.org/1999/xhtml",t);
}
function AMnoMathMLNote() {
var nd = AMcreateElementXHTML("h3");
nd.setAttribute("align","center")
nd.appendChild(AMcreateElementXHTML("p"));
nd.appendChild(document.createTextNode("To view the "));
var an = AMcreateElementXHTML("a");
an.appendChild(document.createTextNode("ASCIIMathML"));
an.setAttribute("href","http://www.chapman.edu/~jipsen/asciimath.html");
nd.appendChild(an);
nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
an = AMcreateElementXHTML("a");
an.appendChild(document.createTextNode("MathPlayer"));
an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
nd.appendChild(an);
nd.appendChild(document.createTextNode(" or Netscape/Mozilla/Firefox"));
nd.appendChild(AMcreateElementXHTML("p"));
return nd;
}
function AMisMathMLavailable() {
if (navigator.appName.slice(0,8)=="Netscape")
if (navigator.appVersion.slice(0,1)>="5") return null;
else return AMnoMathMLNote();
else if (navigator.appName.slice(0,9)=="Microsoft")
try {
var ActiveX = new ActiveXObject("MathPlayer.Factory.1");
return null;
} catch (e) {
return AMnoMathMLNote();
}
else return AMnoMathMLNote();
}
// character lists for Mozilla/Netscape fonts
var AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46];
var AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];
var AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8,
LEFTRIGHT = 9, TEXT = 10; // token types
var AMsqrt = {input:"sqrt", tag:"msqrt", output:"sqrt", tex:null, ttype:UNARY},
AMroot = {input:"root", tag:"mroot", output:"root", tex:null, ttype:BINARY},
AMfrac = {input:"frac", tag:"mfrac", output:"/", tex:null, ttype:BINARY},
AMdiv = {input:"/", tag:"mfrac", output:"/", tex:null, ttype:INFIX},
AMover = {input:"stackrel", tag:"mover", output:"stackrel", tex:null, ttype:BINARY},
AMsub = {input:"_", tag:"msub", output:"_", tex:null, ttype:INFIX},
AMsup = {input:"^", tag:"msup", output:"^", tex:null, ttype:INFIX},
AMtext = {input:"text", tag:"mtext", output:"text", tex:null, ttype:TEXT},
AMmbox = {input:"mbox", tag:"mtext", output:"mbox", tex:null, ttype:TEXT},
AMquote = {input:"\"", tag:"mtext", output:"mbox", tex:null, ttype:TEXT};
var AMsymbols = [
//some greek symbols
{input:"alpha", tag:"mi", output:"\u03B1", tex:null, ttype:CONST},
{input:"beta", tag:"mi", output:"\u03B2", tex:null, ttype:CONST},
{input:"chi", tag:"mi", output:"\u03C7", tex:null, ttype:CONST},
{input:"delta", tag:"mi", output:"\u03B4", tex:null, ttype:CONST},
{input:"Delta", tag:"mo", output:"\u0394", tex:null, ttype:CONST},
{input:"epsi", tag:"mi", output:"\u03B5", tex:"epsilon", ttype:CONST},
{input:"varepsilon", tag:"mi", output:"\u025B", tex:null, ttype:CONST},
{input:"eta", tag:"mi", output:"\u03B7", tex:null, ttype:CONST},
{input:"gamma", tag:"mi", output:"\u03B3", tex:null, ttype:CONST},
{input:"Gamma", tag:"mo", output:"\u0393", tex:null, ttype:CONST},
{input:"iota", tag:"mi", output:"\u03B9", tex:null, ttype:CONST},
{input:"kappa", tag:"mi", output:"\u03BA", tex:null, ttype:CONST},
{input:"lambda", tag:"mi", output:"\u03BB", tex:null, ttype:CONST},
{input:"Lambda", tag:"mo", output:"\u039B", tex:null, ttype:CONST},
{input:"mu", tag:"mi", output:"\u03BC", tex:null, ttype:CONST},
{input:"nu", tag:"mi", output:"\u03BD", tex:null, ttype:CONST},
{input:"omega", tag:"mi", output:"\u03C9", tex:null, ttype:CONST},
{input:"Omega", tag:"mo", output:"\u03A9", tex:null, ttype:CONST},
{input:"phi", tag:"mi", output:"\u03C6", tex:null, ttype:CONST},
{input:"varphi", tag:"mi", output:"\u03D5", tex:null, ttype:CONST},
{input:"Phi", tag:"mo", output:"\u03A6", tex:null, ttype:CONST},
{input:"pi", tag:"mi", output:"\u03C0", tex:null, ttype:CONST},
{input:"Pi", tag:"mo", output:"\u03A0", tex:null, ttype:CONST},
{input:"psi", tag:"mi", output:"\u03C8", tex:null, ttype:CONST},
{input:"Psi", tag:"mi", output:"\u03A8", tex:null, ttype:CONST},
{input:"rho", tag:"mi", output:"\u03C1", tex:null, ttype:CONST},
{input:"sigma", tag:"mi", output:"\u03C3", tex:null, ttype:CONST},
{input:"Sigma", tag:"mo", output:"\u03A3", tex:null, ttype:CONST},
{input:"tau", tag:"mi", output:"\u03C4", tex:null, ttype:CONST},
{input:"theta", tag:"mi", output:"\u03B8", tex:null, ttype:CONST},
{input:"vartheta", tag:"mi", output:"\u03D1", tex:null, ttype:CONST},
{input:"Theta", tag:"mo", output:"\u0398", tex:null, ttype:CONST},
{input:"upsilon", tag:"mi", output:"\u03C5", tex:null, ttype:CONST},
{input:"xi", tag:"mi", output:"\u03BE", tex:null, ttype:CONST},
{input:"Xi", tag:"mo", output:"\u039E", tex:null, ttype:CONST},
{input:"zeta", tag:"mi", output:"\u03B6", tex:null, ttype:CONST},
//binary operation symbols
{input:"*", tag:"mo", output:"\u22C5", tex:"cdot", ttype:CONST},
{input:"**", tag:"mo", output:"\u22C6", tex:"star", ttype:CONST},
{input:"//", tag:"mo", output:"/", tex:null, ttype:CONST},
{input:"\\\\", tag:"mo", output:"\\", tex:"backslash", ttype:CONST},
{input:"setminus", tag:"mo", output:"\\", tex:null, ttype:CONST},
{input:"xx", tag:"mo", output:"\u00D7", tex:"times", ttype:CONST},
{input:"-:", tag:"mo", output:"\u00F7", tex:"divide", ttype:CONST},
{input:"@", tag:"mo", output:"\u2218", tex:"circ", ttype:CONST},
{input:"o+", tag:"mo", output:"\u2295", tex:"oplus", ttype:CONST},
{input:"ox", tag:"mo", output:"\u2297", tex:"otimes", ttype:CONST},
{input:"o.", tag:"mo", output:"\u2299", tex:"odot", ttype:CONST},
{input:"sum", tag:"mo", output:"\u2211", tex:null, ttype:UNDEROVER},
{input:"prod", tag:"mo", output:"\u220F", tex:null, ttype:UNDEROVER},
{input:"^^", tag:"mo", output:"\u2227", tex:"wedge", ttype:CONST},
{input:"^^^", tag:"mo", output:"\u22C0", tex:"bigwedge", ttype:UNDEROVER},
{input:"vv", tag:"mo", output:"\u2228", tex:"vee", ttype:CONST},
{input:"vvv", tag:"mo", output:"\u22C1", tex:"bigvee", ttype:UNDEROVER},
{input:"nn", tag:"mo", output:"\u2229", tex:"cap", ttype:CONST},
{input:"nnn", tag:"mo", output:"\u22C2", tex:"bigcap", ttype:UNDEROVER},
{input:"uu", tag:"mo", output:"\u222A", tex:"cup", ttype:CONST},
{input:"uuu", tag:"mo", output:"\u22C3", tex:"bigcup", ttype:UNDEROVER},
//binary relation symbols
{input:"!=", tag:"mo", output:"\u2260", tex:"ne", ttype:CONST},
{input:":=", tag:"mo", output:":=", tex:null, ttype:CONST},
{input:"lt", tag:"mo", output:"<", tex:null, ttype:CONST},
{input:"<=", tag:"mo", output:"\u2264", tex:"le", ttype:CONST},
{input:"lt=", tag:"mo", output:"\u2264", tex:"leq", ttype:CONST},
{input:">=", tag:"mo", output:"\u2265", tex:"ge", ttype:CONST},
{input:"geq", tag:"mo", output:"\u2265", tex:null, ttype:CONST},
{input:"-<", tag:"mo", output:"\u227A", tex:"prec", ttype:CONST},
{input:"-lt", tag:"mo", output:"\u227A", tex:null, ttype:CONST},
{input:">-", tag:"mo", output:"\u227B", tex:"succ", ttype:CONST},
{input:"-<=", tag:"mo", output:"\u2AAF", tex:"preceq", ttype:CONST},
{input:">-=", tag:"mo", output:"\u2AB0", tex:"succeq", ttype:CONST},
{input:"in", tag:"mo", output:"\u2208", tex:null, ttype:CONST},
{input:"!in", tag:"mo", output:"\u2209", tex:"notin", ttype:CONST},
{input:"sub", tag:"mo", output:"\u2282", tex:"subset", ttype:CONST},
{input:"sup", tag:"mo", output:"\u2283", tex:"supset", ttype:CONST},
{input:"sube", tag:"mo", output:"\u2286", tex:"subseteq", ttype:CONST},
{input:"supe", tag:"mo", output:"\u2287", tex:"supseteq", ttype:CONST},
{input:"-=", tag:"mo", output:"\u2261", tex:"equiv", ttype:CONST},
{input:"~=", tag:"mo", output:"\u2245", tex:"cong", ttype:CONST},
{input:"~~", tag:"mo", output:"\u2248", tex:"approx", ttype:CONST},
{input:"prop", tag:"mo", output:"\u221D", tex:"propto", ttype:CONST},
//logical symbols
{input:"and", tag:"mtext", output:"and", tex:null, ttype:SPACE},
{input:"or", tag:"mtext", output:"or", tex:null, ttype:SPACE},
{input:"not", tag:"mo", output:"\u00AC", tex:"neg", ttype:CONST},
{input:"=>", tag:"mo", output:"\u21D2", tex:"implies", ttype:CONST},
{input:"if", tag:"mo", output:"if", tex:null, ttype:SPACE},
{input:"<=>", tag:"mo", output:"\u21D4", tex:"iff", ttype:CONST},
{input:"AA", tag:"mo", output:"\u2200", tex:"forall", ttype:CONST},
{input:"EE", tag:"mo", output:"\u2203", tex:"exists", ttype:CONST},
{input:"_|_", tag:"mo", output:"\u22A5", tex:"bot", ttype:CONST},
{input:"TT", tag:"mo", output:"\u22A4", tex:"top", ttype:CONST},
{input:"|--", tag:"mo", output:"\u22A2", tex:"vdash", ttype:CONST},
{input:"|==", tag:"mo", output:"\u22A8", tex:"models", ttype:CONST},
//grouping brackets
{input:"(", tag:"mo", output:"(", tex:null, ttype:LEFTBRACKET},
{input:")", tag:"mo", output:")", tex:null, ttype:RIGHTBRACKET},
{input:"[", tag:"mo", output:"[", tex:null, ttype:LEFTBRACKET},
{input:"]", tag:"mo", output:"]", tex:null, ttype:RIGHTBRACKET},
{input:"{", tag:"mo", output:"{", tex:null, ttype:LEFTBRACKET},
{input:"}", tag:"mo", output:"}", tex:null, ttype:RIGHTBRACKET},
{input:"|", tag:"mo", output:"|", tex:null, ttype:LEFTRIGHT},
//{input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT},
{input:"(:", tag:"mo", output:"\u2329", tex:"langle", ttype:LEFTBRACKET},
{input:":)", tag:"mo", output:"\u232A", tex:"rangle", ttype:RIGHTBRACKET},
{input:"<<", tag:"mo", output:"\u2329", tex:null, ttype:LEFTBRACKET},
{input:">>", tag:"mo", output:"\u232A", tex:null, ttype:RIGHTBRACKET},
{input:"{:", tag:"mo", output:"{:", tex:null, ttype:LEFTBRACKET, invisible:true},
{input:":}", tag:"mo", output:":}", tex:null, ttype:RIGHTBRACKET, invisible:true},
//miscellaneous symbols
{input:"int", tag:"mo", output:"\u222B", tex:null, ttype:CONST},
{input:"dx", tag:"mi", output:"{:d x:}", tex:null, ttype:DEFINITION},
{input:"dy", tag:"mi", output:"{:d y:}", tex:null, ttype:DEFINITION},
{input:"dz", tag:"mi", output:"{:d z:}", tex:null, ttype:DEFINITION},
{input:"dt", tag:"mi", output:"{:d t:}", tex:null, ttype:DEFINITION},
{input:"oint", tag:"mo", output:"\u222E", tex:null, ttype:CONST},
{input:"del", tag:"mo", output:"\u2202", tex:"partial", ttype:CONST},
{input:"grad", tag:"mo", output:"\u2207", tex:"nabla", ttype:CONST},
{input:"+-", tag:"mo", output:"\u00B1", tex:"pm", ttype:CONST},
{input:"O/", tag:"mo", output:"\u2205", tex:"emptyset", ttype:CONST},
{input:"oo", tag:"mo", output:"\u221E", tex:"infty", ttype:CONST},
{input:"aleph", tag:"mo", output:"\u2135", tex:null, ttype:CONST},
{input:"...", tag:"mo", output:"...", tex:"ldots", ttype:CONST},
{input:":.", tag:"mo", output:"\u2234", tex:"therefore", ttype:CONST},
{input:"/_", tag:"mo", output:"\u2220", tex:"angle", ttype:CONST},
{input:"\\ ", tag:"mo", output:"\u00A0", tex:null, ttype:CONST},
{input:"quad", tag:"mo", output:"\u00A0\u00A0", tex:null, ttype:CONST},
{input:"qquad", tag:"mo", output:"\u00A0\u00A0\u00A0\u00A0", tex:null, ttype:CONST},
{input:"cdots", tag:"mo", output:"\u22EF", tex:null, ttype:CONST},
{input:"vdots", tag:"mo", output:"\u22EE", tex:null, ttype:CONST},
{input:"ddots", tag:"mo", output:"\u22F1", tex:null, ttype:CONST},
{input:"diamond", tag:"mo", output:"\u22C4", tex:null, ttype:CONST},
{input:"square", tag:"mo", output:"\u25A1", tex:null, ttype:CONST},
{input:"|__", tag:"mo", output:"\u230A", tex:"lfloor", ttype:CONST},
{input:"__|", tag:"mo", output:"\u230B", tex:"rfloor", ttype:CONST},
{input:"|~", tag:"mo", output:"\u2308", tex:"lceiling", ttype:CONST},
{input:"~|", tag:"mo", output:"\u2309", tex:"rceiling", ttype:CONST},
{input:"CC", tag:"mo", output:"\u2102", tex:null, ttype:CONST},
{input:"NN", tag:"mo", output:"\u2115", tex:null, ttype:CONST},
{input:"QQ", tag:"mo", output:"\u211A", tex:null, ttype:CONST},
{input:"RR", tag:"mo", output:"\u211D", tex:null, ttype:CONST},
{input:"ZZ", tag:"mo", output:"\u2124", tex:null, ttype:CONST},
{input:"f", tag:"mi", output:"f", tex:null, ttype:UNARY, func:true},
{input:"g", tag:"mi", output:"g", tex:null, ttype:UNARY, func:true},
//standard functions
{input:"lim", tag:"mo", output:"lim", tex:null, ttype:UNDEROVER},
{input:"Lim", tag:"mo", output:"Lim", tex:null, ttype:UNDEROVER},
{input:"sin", tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true},
{input:"cos", tag:"mo", output:"cos", tex:null, ttype:UNARY, func:true},
{input:"tan", tag:"mo", output:"tan", tex:null, ttype:UNARY, func:true},
{input:"sinh", tag:"mo", output:"sinh", tex:null, ttype:UNARY, func:true},
{input:"cosh", tag:"mo", output:"cosh", tex:null, ttype:UNARY, func:true},
{input:"tanh", tag:"mo", output:"tanh", tex:null, ttype:UNARY, func:true},
{input:"cot", tag:"mo", output:"cot", tex:null, ttype:UNARY, func:true},
{input:"sec", tag:"mo", output:"sec", tex:null, ttype:UNARY, func:true},
{input:"csc", tag:"mo", output:"csc", tex:null, ttype:UNARY, func:true},
{input:"log", tag:"mo", output:"log", tex:null, ttype:UNARY, func:true},
{input:"ln", tag:"mo", output:"ln", tex:null, ttype:UNARY, func:true},
{input:"det", tag:"mo", output:"det", tex:null, ttype:UNARY, func:true},
{input:"dim", tag:"mo", output:"dim", tex:null, ttype:CONST},
{input:"mod", tag:"mo", output:"mod", tex:null, ttype:CONST},
{input:"gcd", tag:"mo", output:"gcd", tex:null, ttype:UNARY, func:true},
{input:"lcm", tag:"mo", output:"lcm", tex:null, ttype:UNARY, func:true},
{input:"lub", tag:"mo", output:"lub", tex:null, ttype:CONST},
{input:"glb", tag:"mo", output:"glb", tex:null, ttype:CONST},
{input:"min", tag:"mo", output:"min", tex:null, ttype:UNDEROVER},
{input:"max", tag:"mo", output:"max", tex:null, ttype:UNDEROVER},
//arrows
{input:"uarr", tag:"mo", output:"\u2191", tex:"uparrow", ttype:CONST},
{input:"darr", tag:"mo", output:"\u2193", tex:"downarrow", ttype:CONST},
{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST},
{input:"->", tag:"mo", output:"\u2192", tex:"to", ttype:CONST},
{input:"|->", tag:"mo", output:"\u21A6", tex:"mapsto", ttype:CONST},
{input:"larr", tag:"mo", output:"\u2190", tex:"leftarrow", ttype:CONST},
{input:"harr", tag:"mo", output:"\u2194", tex:"leftrightarrow", ttype:CONST},
{input:"rArr", tag:"mo", output:"\u21D2", tex:"Rightarrow", ttype:CONST},
{input:"lArr", tag:"mo", output:"\u21D0", tex:"Leftarrow", ttype:CONST},
{input:"hArr", tag:"mo", output:"\u21D4", tex:"Leftrightarrow", ttype:CONST},
//commands with argument
AMsqrt, AMroot, AMfrac, AMdiv, AMover, AMsub, AMsup,
{input:"hat", tag:"mover", output:"\u005E", tex:null, ttype:UNARY, acc:true},
{input:"bar", tag:"mover", output:"\u00AF", tex:"overline", ttype:UNARY, acc:true},
{input:"vec", tag:"mover", output:"\u2192", tex:null, ttype:UNARY, acc:true},
{input:"dot", tag:"mover", output:".", tex:null, ttype:UNARY, acc:true},
{input:"ddot", tag:"mover", output:"..", tex:null, ttype:UNARY, acc:true},
{input:"ul", tag:"munder", output:"\u0332", tex:"underline", ttype:UNARY, acc:true},
AMtext, AMmbox, AMquote,
{input:"bb", tag:"mstyle", atname:"fontweight", atval:"bold", output:"bb", tex:null, ttype:UNARY},
{input:"mathbf", tag:"mstyle", atname:"fontweight", atval:"bold", output:"mathbf", tex:null, ttype:UNARY},
{input:"sf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"sf", tex:null, ttype:UNARY},
{input:"mathsf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"mathsf", tex:null, ttype:UNARY},
{input:"bbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"bbb", tex:null, ttype:UNARY, codes:AMbbb},
{input:"mathbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"mathbb", tex:null, ttype:UNARY, codes:AMbbb},
{input:"cc", tag:"mstyle", atname:"mathvariant", atval:"script", output:"cc", tex:null, ttype:UNARY, codes:AMcal},
{input:"mathcal", tag:"mstyle", atname:"mathvariant", atval:"script", output:"mathcal", tex:null, ttype:UNARY, codes:AMcal},
{input:"tt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"tt", tex:null, ttype:UNARY},
{input:"mathtt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"mathtt", tex:null, ttype:UNARY},
{input:"fr", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"fr", tex:null, ttype:UNARY, codes:AMfrk},
{input:"mathfrak", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"mathfrak", tex:null, ttype:UNARY, codes:AMfrk}
];
function compareNames(s1,s2) {
if (s1.input > s2.input) return 1
else return -1;
}
var AMnames = []; //list of input symbols
function AMinitSymbols() {
var texsymbols = [], i;
for (i=0; i<AMsymbols.length; i++)
if (AMsymbols[i].tex)
texsymbols[texsymbols.length] = {input:AMsymbols[i].tex,
tag:AMsymbols[i].tag, output:AMsymbols[i].output, ttype:AMsymbols[i].ttype};
AMsymbols = AMsymbols.concat(texsymbols);
AMsymbols.sort(compareNames);
for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
}
var AMmathml = "http://www.w3.org/1998/Math/MathML";
function AMcreateElementMathML(t) {
if (isIE) return document.createElement("m:"+t);
else return document.createElementNS(AMmathml,t);
}
function AMcreateMmlNode(t,frag) {
// var node = AMcreateElementMathML(name);
if (isIE) var node = document.createElement("m:"+t);
else var node = document.createElementNS(AMmathml,t);
node.appendChild(frag);
return node;
}
function newcommand(oldstr,newstr) {
AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr,
tex:null, ttype:DEFINITION}]);
}
function AMremoveCharsAndBlanks(str,n) {
//remove n characters and any following blanks
var st;
if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ")
st = str.slice(n+1);
else st = str.slice(n);
for (var i=0; i<st.length && st.charCodeAt(i)<=32; i=i+1);
return st.slice(i);
}
function AMposition(arr, str, n) {
// return position >=n where str appears or would be inserted
// assumes arr is sorted
if (n==0) {
var h,m;
n = -1;
h = arr.length;
while (n+1<h) {
m = (n+h) >> 1;
if (arr[m]<str) n = m; else h = m;
}
return h;
} else
for (var i=n; i<arr.length && arr[i]<str; i++);
return i; // i=arr.length || arr[i]>=str
}
function AMgetSymbol(str) {
//return maximal initial substring of str that appears in names
//return null if there is none
var k = 0; //new pos
var j = 0; //old pos
var mk; //match pos
var st;
var tagst;
var match = "";
var more = true;
for (var i=1; i<=str.length && more; i++) {
st = str.slice(0,i); //initial substring of length i
j = k;
k = AMposition(AMnames, st, j);
if (k<AMnames.length && str.slice(0,AMnames[k].length)==AMnames[k]){
match = AMnames[k];
mk = k;
i = match.length;
}
more = k<AMnames.length && str.slice(0,AMnames[k].length)>=AMnames[k];
}
AMpreviousSymbol=AMcurrentSymbol;
if (match!=""){
AMcurrentSymbol=AMsymbols[mk].ttype;
return AMsymbols[mk];
}
// if str[0] is a digit or - return maxsubstring of digits.digits
AMcurrentSymbol=CONST;
k = 1;
st = str.slice(0,1);
var integ = true;
while ("0"<=st && st<="9" && k<=str.length) {
st = str.slice(k,k+1);
k++;
}
if (st == decimalsign) {
st = str.slice(k,k+1);
if ("0"<=st && st<="9") {
integ = false;
k++;
while ("0"<=st && st<="9" && k<=str.length) {
st = str.slice(k,k+1);
k++;
}
}
}
if ((integ && k>1) || k>2) {
st = str.slice(0,k-1);
tagst = "mn";
} else {
k = 2;
st = str.slice(0,1); //take 1 character
tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi");
}
if (st=="-" && AMpreviousSymbol==INFIX) {
AMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on second parse
return {input:st, tag:tagst, output:st, ttype:UNARY, func:true};
}
return {input:st, tag:tagst, output:st, ttype:CONST};
}
function AMremoveBrackets(node) {
var st;
if (node.nodeName=="mrow") {
st = node.firstChild.firstChild.nodeValue;
if (st=="(" || st=="[" || st=="{") node.removeChild(node.firstChild);
}
if (node.nodeName=="mrow") {
st = node.lastChild.firstChild.nodeValue;
if (st==")" || st=="]" || st=="}") node.removeChild(node.lastChild);
}
}
/*Parsing ASCII math expressions with the following grammar
v ::= [A-Za-z] | greek letters | numbers | other constant symbols
u ::= sqrt | text | bb | other unary symbols for font commands
b ::= frac | root | stackrel binary symbols
l ::= ( | [ | { | (: | {: left brackets
r ::= ) | ] | } | :) | :} right brackets
S ::= v | lEr | uS | bSS Simple expression
I ::= S_S | S^S | S_S^S | S Intermediate expression
E ::= IE | I/I Expression
Each terminal symbol is translated into a corresponding mathml node.*/
var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol;
function AMparseSexpr(str) { //parses str and returns [node,tailstr]
var symbol, node, result, i, st,// rightvert = false,
newFrag = document.createDocumentFragment();
str = AMremoveCharsAndBlanks(str,0);
symbol = AMgetSymbol(str); //either a token or a bracket or empty
if (symbol == null || symbol.ttype == RIGHTBRACKET && AMnestingDepth > 0) {
return [null,str];
}
if (symbol.ttype == DEFINITION) {
str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);
symbol = AMgetSymbol(str);
}
switch (symbol.ttype) {
case UNDEROVER:
case CONST:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return [AMcreateMmlNode(symbol.tag, //its a constant
document.createTextNode(symbol.output)),str];
case LEFTBRACKET: //read (expr+)
AMnestingDepth++;
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseExpr(str,true);
AMnestingDepth--;
if (typeof symbol.invisible == "boolean" && symbol.invisible)
node = AMcreateMmlNode("mrow",result[0]);
else {
node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
node = AMcreateMmlNode("mrow",node);
node.appendChild(result[0]);
}
return [node,result[1]];
case TEXT:
if (symbol!=AMquote) str = AMremoveCharsAndBlanks(str,symbol.input.length);
if (str.charAt(0)=="{") i=str.indexOf("}");
else if (str.charAt(0)=="(") i=str.indexOf(")");
else if (str.charAt(0)=="[") i=str.indexOf("]");
else if (symbol==AMquote) i=str.slice(1).indexOf("\"")+1;
else i = 0;
if (i==-1) i = str.length;
st = str.slice(1,i);
if (st.charAt(0) == " ") {
node = AMcreateElementMathML("mspace");
node.setAttribute("width","1ex");
newFrag.appendChild(node);
}
newFrag.appendChild(
AMcreateMmlNode(symbol.tag,document.createTextNode(st)));
if (st.charAt(st.length-1) == " ") {
node = AMcreateElementMathML("mspace");
node.setAttribute("width","1ex");
newFrag.appendChild(node);
}
str = AMremoveCharsAndBlanks(str,i+1);
return [AMcreateMmlNode("mrow",newFrag),str];
case UNARY:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseSexpr(str);
if (result[0]==null) return [AMcreateMmlNode(symbol.tag,
document.createTextNode(symbol.output)),str];
if (typeof symbol.func == "boolean" && symbol.func) { // functions hack
st = str.charAt(0);
if (st=="^" || st=="_" || st=="/" || st=="|" || st==",") {
return [AMcreateMmlNode(symbol.tag,
document.createTextNode(symbol.output)),str];
} else {
node = AMcreateMmlNode("mrow",
AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
node.appendChild(result[0]);
return [node,result[1]];
}
}
AMremoveBrackets(result[0]);
if (symbol.input == "sqrt") { // sqrt
return [AMcreateMmlNode(symbol.tag,result[0]),result[1]];
} else if (typeof symbol.acc == "boolean" && symbol.acc) { // accent
node = AMcreateMmlNode(symbol.tag,result[0]);
node.appendChild(AMcreateMmlNode("mo",document.createTextNode(symbol.output)));
return [node,result[1]];
} else { // font change command
if (!isIE && typeof symbol.codes != "undefined") {
for (i=0; i<result[0].childNodes.length; i++)
if (result[0].childNodes[i].nodeName=="mi" || result[0].nodeName=="mi") {
st = (result[0].nodeName=="mi"?result[0].firstChild.nodeValue:
result[0].childNodes[i].firstChild.nodeValue);
var newst = [];
for (var j=0; j<st.length; j++)
if (st.charCodeAt(j)>64 && st.charCodeAt(j)<91) newst = newst +
String.fromCharCode(symbol.codes[st.charCodeAt(j)-65]);
else newst = newst + st.charAt(j);
if (result[0].nodeName=="mi")
result[0]=AMcreateElementMathML("mo").
appendChild(document.createTextNode(newst));
else result[0].replaceChild(AMcreateElementMathML("mo").
appendChild(document.createTextNode(newst)),result[0].childNodes[i]);
}
}
node = AMcreateMmlNode(symbol.tag,result[0]);
node.setAttribute(symbol.atname,symbol.atval);
return [node,result[1]];
}
case BINARY:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseSexpr(str);
if (result[0]==null) return [AMcreateMmlNode("mo",
document.createTextNode(symbol.input)),str];
AMremoveBrackets(result[0]);
var result2 = AMparseSexpr(result[1]);
if (result2[0]==null) return [AMcreateMmlNode("mo",
document.createTextNode(symbol.input)),str];
AMremoveBrackets(result2[0]);
if (symbol.input=="root" || symbol.input=="stackrel")
newFrag.appendChild(result2[0]);
newFrag.appendChild(result[0]);
if (symbol.input=="frac") newFrag.appendChild(result2[0]);
return [AMcreateMmlNode(symbol.tag,newFrag),result2[1]];
case INFIX:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return [AMcreateMmlNode("mo",document.createTextNode(symbol.output)),str];
case SPACE:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
node = AMcreateElementMathML("mspace");
node.setAttribute("width","1ex");
newFrag.appendChild(node);
newFrag.appendChild(
AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
node = AMcreateElementMathML("mspace");
node.setAttribute("width","1ex");
newFrag.appendChild(node);
return [AMcreateMmlNode("mrow",newFrag),str];
case LEFTRIGHT:
// if (rightvert) return [null,str]; else rightvert = true;
AMnestingDepth++;
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseExpr(str,false);
AMnestingDepth--;
var st = "";
if (result[0].lastChild!=null)
st = result[0].lastChild.firstChild.nodeValue;
if (st == "|") { // its an absolute value subterm
node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
node = AMcreateMmlNode("mrow",node);
node.appendChild(result[0]);
return [node,result[1]];
} else { // the "|" is a \mid
node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
node = AMcreateMmlNode("mrow",node);
return [node,str];
}
default:
//alert("default");
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return [AMcreateMmlNode(symbol.tag, //its a constant
document.createTextNode(symbol.output)),str];
}
}
function AMparseIexpr(str) {
var symbol, sym1, sym2, node, result, underover;
str = AMremoveCharsAndBlanks(str,0);
sym1 = AMgetSymbol(str);
result = AMparseSexpr(str);
node = result[0];
str = result[1];
symbol = AMgetSymbol(str);
if (symbol.ttype == INFIX && symbol.input != "/") {
str = AMremoveCharsAndBlanks(str,symbol.input.length);
// if (symbol.input == "/") result = AMparseIexpr(str); else ...
result = AMparseSexpr(str);
if (result[0] == null) // show box in place of missing argument
result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));
else AMremoveBrackets(result[0]);
str = result[1];
// if (symbol.input == "/") AMremoveBrackets(node);
if (symbol.input == "_") {
sym2 = AMgetSymbol(str);
underover = (sym1.ttype == UNDEROVER);
if (sym2.input == "^") {
str = AMremoveCharsAndBlanks(str,sym2.input.length);
var res2 = AMparseSexpr(str);
AMremoveBrackets(res2[0]);
str = res2[1];
node = AMcreateMmlNode((underover?"munderover":"msubsup"),node);
node.appendChild(result[0]);
node.appendChild(res2[0]);
node = AMcreateMmlNode("mrow",node); // so sum does not stretch
} else {
node = AMcreateMmlNode((underover?"munder":"msub"),node);
node.appendChild(result[0]);
}
} else {
node = AMcreateMmlNode(symbol.tag,node);
node.appendChild(result[0]);
}
}
return [node,str];
}
function AMparseExpr(str,rightbracket) {
var symbol, node, result, i, nodeList = [],
newFrag = document.createDocumentFragment();
do {
str = AMremoveCharsAndBlanks(str,0);
result = AMparseIexpr(str);
node = result[0];
str = result[1];
symbol = AMgetSymbol(str);
if (symbol.ttype == INFIX && symbol.input == "/") {
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMparseIexpr(str);
if (result[0] == null) // show box in place of missing argument
result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));
else AMremoveBrackets(result[0]);
str = result[1];
AMremoveBrackets(node);
node = AMcreateMmlNode(symbol.tag,node);
node.appendChild(result[0]);
newFrag.appendChild(node);
symbol = AMgetSymbol(str);
}
else if (node!=undefined) newFrag.appendChild(node);
} while ((symbol.ttype != RIGHTBRACKET &&
(symbol.ttype != LEFTRIGHT || rightbracket)
|| AMnestingDepth == 0) && symbol!=null && symbol.output!="");
if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {
// if (AMnestingDepth > 0) AMnestingDepth--;
var len = newFrag.childNodes.length;
if (len>0 && newFrag.childNodes[len-1].nodeName == "mrow" && len>1 &&
newFrag.childNodes[len-2].nodeName == "mo" &&
newFrag.childNodes[len-2].firstChild.nodeValue == ",") { //matrix
var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue;
if (right==")" || right=="]") {
var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue;
if (left=="(" && right==")" && symbol.output != "}" ||
left=="[" && right=="]") {
var pos = []; // positions of commas
var matrix = true;
var m = newFrag.childNodes.length;
for (i=0; matrix && i<m; i=i+2) {
pos[i] = [];
node = newFrag.childNodes[i];
if (matrix) matrix = node.nodeName=="mrow" &&
(i==m-1 || node.nextSibling.nodeName=="mo" &&
node.nextSibling.firstChild.nodeValue==",")&&
node.firstChild.firstChild.nodeValue==left &&
node.lastChild.firstChild.nodeValue==right;
if (matrix)
for (var j=0; j<node.childNodes.length; j++)
if (node.childNodes[j].firstChild.nodeValue==",")
pos[i][pos[i].length]=j;
if (matrix && i>1) matrix = pos[i].length == pos[i-2].length;
}
if (matrix) {
var row, frag, n, k, table = document.createDocumentFragment();
for (i=0; i<m; i=i+2) {
row = document.createDocumentFragment();
frag = document.createDocumentFragment();
node = newFrag.firstChild; // <mrow>(-,-,...,-,-)</mrow>
n = node.childNodes.length;
k = 0;
node.removeChild(node.firstChild); //remove (
for (j=1; j<n-1; j++) {
if (typeof pos[i][k] != "undefined" && j==pos[i][k]){
node.removeChild(node.firstChild); //remove ,
row.appendChild(AMcreateMmlNode("mtd",frag));
k++;
} else frag.appendChild(node.firstChild);
}
row.appendChild(AMcreateMmlNode("mtd",frag));
if (newFrag.childNodes.length>2) {
newFrag.removeChild(newFrag.firstChild); //remove <mrow>)</mrow>
newFrag.removeChild(newFrag.firstChild); //remove <mo>,</mo>
}
table.appendChild(AMcreateMmlNode("mtr",row));
}
node = AMcreateMmlNode("mtable",table);
if (typeof symbol.invisible == "boolean" && symbol.invisible) node.setAttribute("columnalign","left");
newFrag.replaceChild(node,newFrag.firstChild);
}
}
}
}
str = AMremoveCharsAndBlanks(str,symbol.input.length);
if (typeof symbol.invisible != "boolean" || !symbol.invisible) {
node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
newFrag.appendChild(node);
}
}
return [newFrag,str];
}
function AMparseMath(str) {
var result, node = AMcreateElementMathML("mstyle");
if (mathcolor != "") node.setAttribute("mathcolor",mathcolor);
if (displaystyle) node.setAttribute("displaystyle","true");
if (mathfontfamily != "") node.setAttribute("fontfamily",mathfontfamily);
AMnestingDepth = 0;
node.appendChild(AMparseExpr(str.replace(/^\s+/g,""),false)[0]);
node = AMcreateMmlNode("math",node);
if (showasciiformulaonhover) //fixed by djhsu so newline
node.setAttribute("title",str.replace(/\s+/g," "));//does not show in Gecko
if (mathfontfamily != "" && (isIE || mathfontfamily != "serif")) {
var fnode = AMcreateElementXHTML("font");
fnode.setAttribute("face",mathfontfamily);
fnode.appendChild(node);
return fnode;
}
return node;
}
function AMstrarr2docFrag(arr, linebreaks) {
var newFrag=document.createDocumentFragment();
var expr = false;
for (var i=0; i<arr.length; i++) {
if (expr) newFrag.appendChild(AMparseMath(arr[i]));
else {
var arri = (linebreaks ? arr[i].split("\n\n") : [arr[i]]);
newFrag.appendChild(AMcreateElementXHTML("span").
appendChild(document.createTextNode(arri[0])));
for (var j=1; j<arri.length; j++) {
newFrag.appendChild(AMcreateElementXHTML("p"));
newFrag.appendChild(AMcreateElementXHTML("span").
appendChild(document.createTextNode(arri[j])));
}
}
expr = !expr;
}
return newFrag;
}
function AMprocessNodeR(n, linebreaks) {
var mtch, str, arr, frg, i;
if (n.childNodes.length == 0) {
if ((n.nodeType!=8 || linebreaks) &&
n.parentNode.nodeName!="form" && n.parentNode.nodeName!="FORM" &&
n.parentNode.nodeName!="textarea" && n.parentNode.nodeName!="TEXTAREA" &&
n.parentNode.nodeName!="pre" && n.parentNode.nodeName!="PRE") {
str = n.nodeValue;
if (!(str == null)) {
str = str.replace(/\r\n\r\n/g,"\n\n");
if (doubleblankmathdelimiter) {
str = str.replace(/\x20\x20\./g," "+AMdelimiter1+".");
str = str.replace(/\x20\x20,/g," "+AMdelimiter1+",");
str = str.replace(/\x20\x20/g," "+AMdelimiter1+" ");
}
str = str.replace(/\x20+/g," ");
str = str.replace(/\s*\r\n/g," ");
mtch = false;
str = str.replace(new RegExp(AMescape2, "g"),
function(st){mtch=true;return "AMescape2"});
str = str.replace(new RegExp(AMescape1, "g"),
function(st){mtch=true;return "AMescape1"});
str = str.replace(new RegExp(AMdelimiter2regexp, "g"),AMdelimiter1);
arr = str.split(AMdelimiter1);
for (i=0; i<arr.length; i++)
arr[i]=arr[i].replace(/AMescape2/g,AMdelimiter2).
replace(/AMescape1/g,AMdelimiter1);
if (arr.length>1 || mtch) {
if (checkForMathML) {
checkForMathML = false;
var nd = AMisMathMLavailable();
AMnoMathML = nd != null;
if (AMnoMathML && notifyIfNoMathML)
if (alertIfNoMathML)
alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n\
or Firefox/Mozilla/Netscape");
else AMbody.insertBefore(nd,AMbody.childNodes[0]);
}
if (!AMnoMathML) {
frg = AMstrarr2docFrag(arr,n.nodeType==8);
var len = frg.childNodes.length;
n.parentNode.replaceChild(frg,n);
return len-1;
} else return 0;
}
}
} else return 0;
} else if (n.nodeName!="math") {
for (i=0; i<n.childNodes.length; i++)
i += AMprocessNodeR(n.childNodes[i], linebreaks);
}
return 0;
}
function AMprocessNode(n, linebreaks, spanclassAM) {
var frag,st;
if (spanclassAM!=null) {
frag = document.getElementsByTagName("span")
for (var i=0;i<frag.length;i++)
if (frag[i].className == "AM")
AMprocessNodeR(frag[i],linebreaks);
} else {
try {
st = n.innerHTML;
} catch(err) {}
if (st==null ||
st.indexOf(AMdelimiter1)!=-1 || st.indexOf(AMdelimiter2)!=-1)
AMprocessNodeR(n,linebreaks);
}
if (isIE) { //needed to match size and font of formula to surrounding text
frag = document.getElementsByTagName('math');
for (var i=0;i<frag.length;i++) frag[i].update()
}
}
var AMbody;
var AMnoMathML = false, AMtranslated = false;
function translate(spanclassAM) {
if (!AMtranslated) { // run this only once
AMtranslated = true;
AMinitSymbols();
AMbody = document.getElementsByTagName("body")[0];
AMprocessNode(AMbody, false, spanclassAM);
}
}
if (isIE) { // avoid adding MathPlayer info explicitly to each webpage
document.write("<object id=\"mathplayer\"\
classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");
document.write("<?import namespace=\"m\" implementation=\"#mathplayer\"?>");
}
// GO1.1 Generic onload by Brothercake
// http://www.brothercake.com/
//onload function (replaces the onload="translate()" in the <body> tag)
function generic()
{
translate();
};
//setup onload function
if(typeof window.addEventListener != 'undefined')
{
//.. gecko, safari, konqueror and standard
window.addEventListener('load', generic, false);
}
else if(typeof document.addEventListener != 'undefined')
{
//.. opera 7
document.addEventListener('load', generic, false);
}
else if(typeof window.attachEvent != 'undefined')
{
//.. win/ie
window.attachEvent('onload', generic);
}
//** remove this condition to degrade older browsers
else
{
//.. mac/ie5 and anything else that gets this far
//if there's an existing onload function
if(typeof window.onload == 'function')
{
//store it
var existing = onload;
//add new onload handler
window.onload = function()
{
//call existing onload function
existing();
//call generic onload function
generic();
};
}
else
{
//setup onload function
window.onload = generic;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,227 +0,0 @@
AsciiDoc Installation
=====================
NOTE: The current version of AsciiDoc requires *Python 2.4 or newer*
to run. If you don't already have an up-to-date version of Python
installed it can be downloaded from the official Python website
http://www.python.org/.
Prerequisites
-------------
See the link:README.html[README] page.
Installing from the Mercurial repository
----------------------------------------
The AsciiDoc http://www.selenic.com/mercurial/[Mercurial] repository
is hosted by http://code.google.com/[Google Code].
To browse the repository go to
http://code.google.com/p/asciidoc/source/browse/.
You can install AsciiDoc from the repository if you don't have an up to
date packaged version or want to get the latest version from the trunk:
- Make sure you have http://www.selenic.com/mercurial/[Mercurial]
installed, you can check with:
$ hg --version
- Go to the directory you want to install AsciiDoc into and download
the repository. This example gets the {revnumber} tagged release:
[subs="attributes"]
$ cd ~/bin
$ hg clone -r {revnumber} https://asciidoc.googlecode.com/hg/ asciidoc-{revnumber}
You now have two choices: you can run asciidoc locally from your
repository or you can use 'autoconf(1)' and 'make(1)' to perform a
system-wide install.
Running asciidoc from your local copy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a symlink to the AsciiDoc script in a search `PATH` directory
so it's easy to execute `asciidoc` from the command-line, for example:
[subs="attributes"]
$ ln -s ~/bin/asciidoc-{revnumber}/asciidoc.py ~/bin/asciidoc
$ ln -s ~/bin/asciidoc-{revnumber}/a2x.py ~/bin/a2x
Use the Mercurial `pull` command to update your local AsciiDoc repository.
Installing asciidoc for all users
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create `configure` using 'autoconf(1)'; use `configure` to create the
`Makefile`; run 'make(1)'; build the man pages; install:
---------------------------------------------
$ autoconf
$ ./configure
$ make
$ sudo make install
---------------------------------------------
To uninstall:
---------------------------------------------
$ sudo make uninstall
---------------------------------------------
[[X1]]
Distribution tarball installation
---------------------------------
The distribution source tarballs can be downloaded from the
SourceForge http://sourceforge.net/projects/asciidoc/.
NOTE: Unless you are <<X3,installing on Microsoft Windows>> you should
use the tarball and not the zip file to install the the distribution
(the tarball contains symlinks).
If your flavor or UNIX or Linux does not have a packaged AsciiDoc
distribution or if you prefer to install the latest AsciiDoc version
from source use the `configure` shell script in the tarball root
directory.
The `autoconf(1)` generated `configure` script creates a make file
that is tailored for your system. To install:
[subs="attributes"]
$ tar -xzf asciidoc-{revnumber}.tar.gz
$ cd asciidoc-{revnumber}
$ ./configure
$ sudo make install
To install the documentation:
$ sudo make docs
To uninstall AsciiDoc:
$ sudo make uninstall
If Vim is installed on your system the AsciiDoc Vim syntax highlighter
and filetype detection scripts will be install in the global Vim
configuration file directory (`asciidoc.vim` in the `syntax` directory
and `asciidoc_filetype.vim` in the `ftdetect` directory).
[[X3]]
Microsoft Windows installation
------------------------------
AsciiDoc is developed and tested on Linux but there seem to be quite a
few people using it on Windows. To install AsciiDoc on Windows unzip
the distribution Zip file contents:
[subs="attributes"]
$ unzip asciidoc-{revnumber}.zip
This will create the folder +asciidoc-{revnumber}+ containing the
`asciidoc.py` and `a2x.py` executables along with configuration files
and documentation.
To generate DocBook based outputs (e.g. PDFs) you will also need a
working DocBook toolchain. Installing and configuring a DocBook
toolchain on Windows can be a challenge -- this blog post explains
http://blog.rainwebs.net/2010/02/25/how-to-create-handsome-pdf-documents-without-frustration/[How
to Create Handsome PDF Documents Without Frustration] using
http://www.cygwin.com/[Cygwin],
http://dblatex.sourceforge.net/[dblatex] and AsciiDoc.
Testing your installation
-------------------------
Test out asciidoc by changing to the AsciiDoc application directory
and convert the User Guide document (`./doc/asciidoc.txt`) to XHTML
(`./doc/asciidoc.html`):
$ python asciidoc.py doc/asciidoc.txt
link:testasciidoc.html[testasciidoc] offers a more extensive set of
conformance tests, though you do need to create the test data before
running the tests (this in itself is a good post-install test):
$ python ./tests/testasciidoc.py update
Now you can run the tests by executing this command:
$ python ./tests/testasciidoc.py run
A full battery of tests can be run from the `main.aap` script in the
distribution root directory:
$ aap test
Building the distribution
-------------------------
The AsciiDoc distribution is built using http://www.a-a-p.org/[A-A-P]
(a software build system written by Bram Moolenaar). The AsciiDoc
A-A-P scripts are:
`./main.aap`:: Builds the distribution tarball and zip files,
documentation and example website.
`./doc/main.aap`:: Builds distribution documentation.
`./examples/website/main.aap`:: Builds AsciiDoc website.
`./common.aap`:: Included in all scripts.
To build the distribution tarball and zip files, documentation and
example website run A-A-P from the distribution root directory:
$ aap
[[X2]]
Prepackaged AsciiDoc installation
---------------------------------
The following platform specific AsciiDoc packages are available:
*Debian GNU/Linux*::
If you use Debian or a Debian based distribution there's an
http://packages.debian.org/asciidoc[AsciiDoc Debian package]
available. Thanks to mailto:stone@debian.org[Fredrik Steen] who
built and maintains the Debian AsciiDoc package.
*Gentoo Linux*::
If you use Gentoo Linux there's a
http://packages.gentoo.org/package/app-text/asciidoc[Gentoo AsciiDoc
package] available. Thanks to mailto:brandon@ifup.org[Brandon
Philips] for writing the ebuild.
*Fedora Linux*::
With help from Terje Røsten, Chris Wright added asciidoc to Fedora
Extras which is available in the default installation. To install
asciidoc execute the following command:
$ yum install asciidoc
*Slackware Linux*::
John Calixto has created a Slackware package for AsciiDoc which can
be downloaded from http://linuxpackages.net/.
*Ark Linux*::
mailto:bero@arklinux.org[Bernhard Rosenkraenzer] added AsciiDoc to
Ark Linux -- the package is available from the Ark Linux repository
at http://arklinux.osuosl.org/dockyard-devel/, so Ark Linux users
should just run `apt-get install asciidoc`.
*T2 Linux*::
mailto:cw@ixplanet.de[Christian Wiese] added AsciiDoc to the
http://www.t2-project.org/[T2 Linux] repository at
http://svn.exactcode.de/t2/trunk/package/textproc/asciidoc/. To
build and install the package on a T2 system, run
`./scripts/Emerge-Pkg asciidoc` from within your T2 source directory
(default: `/usr/src/t2-src`).
*Red Hat Enterprise Linux, Fedora and CentOS packages*::
Dag Wieers has built AsciiDoc RPMs for a number of Red Hat based
distributions, they can be downloaded from
http://dag.wieers.com/rpm/packages/asciidoc/.
*CSW Package for Sun Solaris*::
Ben Walton has created a CSW package for AsciiDoc, you can find it
here: http://opencsw.org/packages/asciidoc.
See also link:userguide.html#X38[Packager Notes] in the 'AsciiDoc User
Guide'.

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
AsciiDoc Website
================
The AsciiDoc website source is included in the AsciiDoc distribution
(in `./examples/website/`) as an example of using AsciiDoc to build a
website.
A simple shell script (`./examples/website/build-website.sh`) will
build the site's web pages -- just set the `LAYOUT` variable to the
desired layout.
Website Layouts
---------------
The website layout is determined by the layout configuration file
(`layout1.conf` or `layout2.conf`) and corresponding layout CSS file
(`layout1.css` or `layout2.css`). The example website comes with the
following layouts:
[width="80%",cols="1,4",options="header"]
|====================================================================
|Layout | Description
|layout1 | Table based layout
|layout2 | CSS based layout (this is the default layout)
|====================================================================
The default tables based layout (layout1) works with most modern
browsers.
NOTE: The simulated frames layout (layout2) does not work with IE6.

View File

@ -1,35 +0,0 @@
AsciiDoc README File
====================
Prerequisites
-------------
AsciiDoc is written in Python so you need a Python interpreter
(version 2.4 or later) to execute asciidoc(1). Python is installed by
default in most Linux distributions. You can download Python from the
official Python website http://www.python.org.
Obtaining AsciiDoc
------------------
Documentation and installation instructions are on the AsciiDoc
website http://www.methods.co.nz/asciidoc/
Tools
-----
Current AsciiDoc version tested on Xubuntu Linux 10.04 with:
- Python 2.6.5
- DocBook XSL Stylesheets 1.76.1
- xsltproc (libxml 20706, libxslt 10126 and libexslt 815).
- w3m 0.5.2
- dblatex 0.3
- FOP 0.95
- A-A-P 1.091
Copying
-------
Copyright (C) 2002-2011 Stuart Rackham. Free use of this software is
granted under the terms of the GNU General Public License version 2
(GPLv2).

Some files were not shown because too many files have changed in this diff Show More