doc: Remove in source documentation and the asciidoc package

The RSB documentation is now in ReST format and part of the RTEMS
Documentation project. See https://docs.rtems.org/.

Remove support for the GPL based asciidoc tool and remove the
asciidoc package from the RSB.

Add the Python Markdown package and update the reporter to use
Markdown for HTML generation. The resuling HTML report is a single
self contained file.

Closes #3047.
This commit is contained in:
Chris Johns 2017-08-07 09:59:49 +10:00
parent 295c197b51
commit 8b96e17c8a
342 changed files with 6347 additions and 73893 deletions

24
LICENSE Normal file
View File

@ -0,0 +1,24 @@
RTEMS Tools Project (http://www.rtems.org/)
Copyright 2010-2017 Chris Johns (chrisj@rtems.org)
All rights reserved.
This package is part of the RTEMS Tools Project.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Additions Packages
------------------
This package includes the follow imported software:
Markdown: See source-builder/sb/markdown/LICENSE.md.

18
README
View File

@ -11,11 +11,21 @@ set'. The RTEMS Source Builder is not limited to this role but designed to fit
with-in this specific niche. It can be used outside of the RTEMS project and we
welcome this happening in other open source or commercial projects.
The project is part of the RTEMS Project. See http://www.rtems.org/ for
details. The master repositiory is
http://git.rtems.org/rtems-source-builder.git/.
The project is part of the RTEMS Project. The project's websites are:
Documentation is in the 'doc' directory and available as HTML at https://docs.rtems.org/rsb/.
RTEMS Project Website:
https://www.rtems.org/
GIT Source Repository:
https://git.rtems.org/rtems-source-builder.git/
Documentation:
https://docs.rtems.org/branches/master/rsb/index.html
Bugs:
https://devel.rtems.org/query?component=RSB
Please refer to the LICENSE file for license details.
Contributions, suggestions, and bug reports are welcome.

2
doc/.gitignore vendored
View File

@ -1,2 +0,0 @@
.lock-*
build

View File

@ -1,3 +0,0 @@
FreeBSD 9,FreeBSD kaka 9.1-RELEASE amd64, Build clean, Build clean,AVR fails (CFLAGS for build),
Windows 7,CYGWIN_NT-6.1-WOW64 popov 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin,,ARM,ARM fails (GCC PR56771),Needs more testers and after hardware.
Fedora 17,Linux rtbf64a 3.7.3-101.fc17.x86_64, Build clean,,,
1 FreeBSD 9 FreeBSD kaka 9.1-RELEASE amd64 Build clean Build clean AVR fails (CFLAGS for build)
2 Windows 7 CYGWIN_NT-6.1-WOW64 popov 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin ARM ARM fails (GCC PR56771) Needs more testers and after hardware.
3 Fedora 17 Linux rtbf64a 3.7.3-101.fc17.x86_64 Build clean

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: 115 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +0,0 @@
#
# Waf build script to build the Source Builder Documentation.
#
import os.path
version = "1.0.0"
asciidoc = os.path.join(os.getcwd(),
'..', 'source-builder', 'sb', 'asciidoc')
def configure(ctx):
ctx.env.ASCIIDOC = ctx.find_program(['asciidoc.py'],
path_list = [asciidoc],
mandatory = True)
ctx.env.ASCIIDOC_FLAGS = ['-b', 'html5', '-a', 'data-uri',
'-a', 'icons', '-a', 'max-width=55em-a']
def build(ctx):
ctx(target = 'source-builder.html', source = 'source-builder.txt')
ctx.add_manual_dependency(ctx.path.find_node('source-builder.txt'),
ctx.path.find_node('host-results.csv'))
import waflib.TaskGen
waflib.TaskGen.declare_chain(name = 'html',
rule = '${ASCIIDOC} ${ASCIIDOC_FLAGS} -o ${TGT} ${SRC}',
shell = False,
ext_in = '.txt',
ext_out = '.html',
reentrant = False)

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

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