Imported asciidoc, jam builds and some docs.

This commit is contained in:
Sanel Zukan
2007-07-18 13:21:52 +00:00
parent f87d09b841
commit 6399af2498
106 changed files with 12171 additions and 131 deletions

27
docs/asciidoc/README Normal file
View File

@@ -0,0 +1,27 @@
This is stripped version of asciidoc with some additions, and is not meant
to be used outside EDE package. It will not be installed, and build scripts expect it
in this directory, so do not move it.
Original copyright is below.
Sanel Zukan
-----------------------------------------------------
asciidoc is copyright (C) 2000-2007 by Stuart Rackham
Email: srackham@methods.co.nz
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.

587
docs/asciidoc/a2x Executable file
View File

@@ -0,0 +1,587 @@
#!/usr/bin/env bash
#
# a2x - convert Asciidoc text file to PDF, XHTML, HTML Help, manpage
# or plain text
#
# Copyright (C) 2006 Stuart Rackham. Free use of this software is granted
# under the terms of the GNU General Public License (GPL).
#
VERSION=1.0.0
BASENAME=$(basename "$0")
REALNAME="$0"
if [ ! -e "$REALNAME" ]; then
REALNAME=$(which "$REALNAME")
fi
REALNAME="$(readlink -f "$REALNAME")"
GLOBAL_CONF_DIR=/etc/asciidoc
#--------------------------------------------------------------------
# Constants.
#--------------------------------------------------------------------
# These are mostly related to command options and are set by parse_options().
ASCIIDOC_OPTS=
COPY=no
DESTINATION_DIR=
DOCTYPE=
DRY_RUN=no
FORMAT=xhtml
ICONS=no
ICONS_DIR=./images/icons
SKIP_ASCIIDOC=no
SRC_DIR=
SRC_FILE=
SRC_NAME= # Source file name sans path and file name extension.
STYLESHEET=./docbook-xsl.css
VERBOSE_2=no
VERBOSE=no
XSLTPROC_OPTS=
#--------------------------------------------------------------------
# General purpose functions
#--------------------------------------------------------------------
# Write $1 to stderr with backslash-escaped characters and no trailing newline.
function write_console()
{
echo -ne "$1" >&2
}
# Write newline to stderr.
function newline()
{
echo >&2
}
# Write $1 message to stderr.
function console_msg()
{
echo "$BASENAME: $1" >&2
}
# Write $1 to stderr if verbose or dry-run options set.
function verbose_msg()
{
if isyes "$VERBOSE" || isyes "$DRY_RUN"; then
console_msg "$1"
fi
}
# Return 0 if $1 is interpreted as an affirmative string.
function isyes()
{
case "$1" in
y|Y|yes|YES|Yes|true|TRUE|True) return 0;;
esac
return 1
}
# Log message $1 and exit with status $2 (default 1).
function quit()
{
local err tmp
err=${2:-1}
if [ $err -ne 0 ]; then
tmp="$VERBOSE"
VERBOSE=yes # Force console error exit message.
console_msg "failed: $1"
VERBOSE="$tmp"
else
console_msg "$1"
fi
cleanup
exit $err
}
# Execute the $1 command in the current shell subject to VERBOSE, DRY_RUN shell
# variables.
function execute_command()
{
if isyes "$VERBOSE" || isyes "$DRY_RUN"; then
console_msg "eval: $1"
fi
if isyes "$DRY_RUN"; then
return 0
else
eval $1
return $?
fi
}
# Same as execute_command() but if error occurs prints optional $2 message and
# exits program.
function execute_command_2()
{
local msg
execute_command "$1"
if [ $? -ne 0 ]; then
if [ -n "$2" ]; then
msg="$2"
else
msg="$1"
fi
quit "$msg"
fi
}
# Return 127 if $1 is not in search path else return 0.
function require()
{
if ! which "$1" >/dev/null 2>&1; then
quit "cannot find required program: $1" 127
fi
}
# Join path $1 to path $2.
function join()
{
if [ -n "$1" ]; then
echo "$1/$2"
else
echo "$2"
fi
}
# Echo the total size in bytes of file name arguments.
function file_size()
{
echo $(du -cb "$@" | tail -1 | awk '{print $1}')
}
#--------------------------------------------------------------------
# Application specific functions
#--------------------------------------------------------------------
# Trap interrupts.
function set_trap()
{
# By convention exit code is 128 + signal number.
trap "newline; quit 'exiting: SIGINT' 130" SIGINT
trap "newline; quit 'exiting: SIGQUIT' 131" SIGQUIT
trap "quit 'exiting: SIGHUP' 129" SIGHUP
trap "quit 'exiting: SIGTERM' 143" SIGTERM
}
# Called at program exit.
function cleanup()
{
if [ "$(pwd)" != "$PWD" ]; then
execute_command "cd \"$PWD\""
fi
}
# Print help summary.
function help()
{
cat <<EOF
synopsis:
$BASENAME [OPTIONS] FILE
options:
--asciidoc-opts=ASCIIDOC_OPTS asciidoc(1) options
--copy copy icons or HTML stylesheet
-D, --destination-dir=PATH output directory (defaults to FILE directory)
-d, --doctype=DOCTYPE article, manpage, book
-f, --format=FORMAT chunked,htmlhelp,manpage,odt,pdf,text,xhtml
-h, --help print command syntax summary
--icons use admonition and navigation icons
--icons-dir=PATH admonition and navigation icon directory
-n, --dry-run don't do anything just print the commands
-s, --skip-asciidoc skip asciidoc(1) execution
--stylesheet=PATH target HTML CSS stylesheet file name.
--version print program version to stdout
-v, --verbose print operational details to stderr
--xsltproc-opts=XSLTPROC_OPTS xsltproc(1) options
EOF
}
# Print full path name of file $1 searching first in the directory containing
# the asciidoc executable and then in the global configuration directory.
function conf_file()
{
local result dir
# First look in same directory as asciidoc executable.
dir="$(dirname "$REALNAME")"
if [ ! -f "$dir/$1" -a -d $GLOBAL_CONF_DIR ]; then
dir=$GLOBAL_CONF_DIR
fi
result="$dir/$1"
echo $result
}
#--------------------------------------------------------------------
# Process command-line arguments $@
#--------------------------------------------------------------------
function parse_options()
{
if [ -z "$*" ]; then
help; exit 0
fi
require "getopt"
getopt -T >/dev/null
if [ $? -ne 4 ]; then
quit "enhanced getopt(1) required"
fi
short_opts="d:D:f:hnsv"
long_opts="asciidoc-opts:,destination-dir:,doctype:,help,icons-dir:,dry-run,format:,copy,icons,skip-asciidoc,stylesheet:,version,verbose,xsltproc-opts:"
args=$(getopt -o $short_opts -l $long_opts -n $BASENAME -- "$@" 2>/dev/null)
if [ $? -ne 0 ]; then
quit "invalid command options, run: a2x --help"
fi
eval set -- "$args" # Set positional variables.
while true ; do
case "$1" in
--asciidoc-opts)
ASCIIDOC_OPTS=$2
shift 2 ;;
--copy)
COPY=yes;
shift ;;
-d|--doctype)
DOCTYPE=$2
shift 2 ;;
-D|--destination-dir)
DESTINATION_DIR=$2
shift 2 ;;
-f|--format)
FORMAT=$2
shift 2 ;;
-h|--help)
help; exit 0 ;;
--icons)
ICONS=yes;
shift ;;
--icons-dir)
ICONS_DIR=$2
shift 2 ;;
-n|--dry-run)
DRY_RUN=yes;
shift ;;
-s|--skip-asciidoc)
SKIP_ASCIIDOC=yes;
shift ;;
--stylesheet)
STYLESHEET=$2
shift 2 ;;
--version)
echo "$BASENAME $VERSION" ; exit 0 ;;
-v|--verbose)
if isyes "$VERBOSE"; then
VERBOSE_2=yes
else
VERBOSE=yes
fi
shift ;;
--xsltproc-opts)
XSLTPROC_OPTS=$2
shift 2 ;;
--)
shift; break ;;
*)
quit "unrecognized option: $1" ;;
esac
done
if isyes "$DRY_RUN"; then
VERBOSE=yes
fi
if [ $# -eq 0 ]; then
quit "source file not specified"
fi
if [ $# -ne 1 ]; then
quit "only one source file allowed"
fi
if [ ! -r "$1" ]; then
quit "source file not found: $1"
fi
SRC_FILE=$1
SRC_DIR=$(dirname "$1")
SRC_NAME=$1
SRC_NAME=${SRC_NAME##*/} # Strip path.
SRC_NAME=${SRC_NAME%.*} # Strip extension.
}
#--------------------------------------------------------------------
# Validate program options.
#--------------------------------------------------------------------
function validate_options()
{
case "$FORMAT" in
chunked|htmlhelp|manpage|odt|pdf|text|xhtml) ;;
*) quit "illegal format: $FORMAT" ;;
esac
if [ -z "$DOCTYPE" ]; then
if [ "$FORMAT" = "manpage" ]; then
DOCTYPE=manpage
else
DOCTYPE=article
fi
fi
case "$DOCTYPE" in
article|book|manpage) ;;
*) quit "illegal doctype: $DOCTYPE" ;;
esac
if [ -z "$ICONS_DIR" ]; then
quit "icons directory not specified"
fi
if [[ "$ICONS_DIR" == /* ]]; then
quit "icons directory must be relative: $ICONS_DIR"
fi
ICONS_DIR=${ICONS_DIR%*/} # Strip trailing backslash.
if [ ! -z "$DESTINATION_DIR" ]; then
if [ ! -d "$DESTINATION_DIR" ]; then
quit "destination directory not found: $DESTINATION_DIR"
fi
else
DESTINATION_DIR="$SRC_DIR"
fi
if [ -z "$STYLESHEET" ]; then
quit "stylesheet cannot be blank"
fi
if [[ "$STYLESHEET" == /* ]]; then
quit "stylesheet path must be relative: $STYLESHEET"
fi
}
# Conditionally copy distribution stylesheet and admonition and navigation
# icons to destination directory $1.
function copy_stylesheet_and_icons()
{
if isyes $COPY; then
copy_stylesheet "$1"
if isyes $ICONS; then
copy_icons "$1/$ICONS_DIR"
fi
fi
}
# Copy distribution stylesheet to destination directory $1.
function copy_stylesheet()
{
local src dst
src=$(conf_file stylesheets/docbook-xsl.css)
if [ ! -r "$src" ]; then
quit "file not found: $src"
fi
dst="$1/$STYLESHEET"
# Check we're not trying to copy the file onto itself.
if [[ "$src" -ef "$dst" ]]; then
return
fi
execute_command_2 "cp -u \"$src\" \"$dst\""
}
# Copy distribution admonition and navigation icons to destination directory
# $1.
function copy_icons()
{
local src dst
dst="$1"
# Set source icons directory.
src=$(conf_file images/icons/home.png)
if [ ! -r "$src" ]; then
quit "file not found: $src"
fi
src=$(dirname "$src")
# Check we're not trying to copy the file onto itself.
if [[ "$src" -ef "$dst" ]]; then
return
fi
if [ -e "$dst" ]; then
if [ ! -d "$dst" ]; then
quit "icon destination must be a directory: $dst"
fi
else
execute_command_2 "mkdir -p \"$dst\""
fi
execute_command_2 "cp -rfu \"$src/\"* \"$dst\""
}
#--------------------------------------------------------------------
# Format conversion functions.
#--------------------------------------------------------------------
# Convert AsciiDoc $SRC_FILE to DocBook XML if it is newer than the
# XML output file. $1 has additional asciidoc(1) options.
function to_docbook()
{
local xml
xml="$SRC_DIR/$SRC_NAME.xml"
if isyes $SKIP_ASCIIDOC; then
if [ ! -r "$xml" ]; then
quit "file not found: $xml"
fi
return
fi
require "asciidoc"
execute_command_2 "asciidoc $ASCIIDOC_OPTS $1 -b docbook \"$SRC_FILE\""
}
function to_xhtml()
{
require "xsltproc"
local xsl xml html
xsl=$(conf_file docbook-xsl/xhtml.xsl)
if [ ! -r "$xsl" ]; then
quit "file not found: $xsl"
fi
to_docbook
xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
html="$SRC_NAME.html"
copy_stylesheet_and_icons "$DESTINATION_DIR"
execute_command_2 "cd \"$DESTINATION_DIR\""
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
\"$xsl\" \"$xml\" >\"$html\""
execute_command_2 "cd - >/dev/null"
}
function to_chunked()
{
require "xsltproc"
local chunkdir xsl xml hhp chm
case "$FORMAT" in
chunked)
chunkdir="$DESTINATION_DIR/$SRC_NAME.chunked"
xsl=chunked.xsl
;;
htmlhelp)
chunkdir="$DESTINATION_DIR/$SRC_NAME.htmlhelp"
hhp="$SRC_NAME.hhp"
chm="$SRC_NAME.chm"
XSLTPROC_OPTS="$XSLTPROC_OPTS \
--stringparam htmlhelp.hhp \"$hhp\"
--stringparam htmlhelp.chm \"$chm\""
xsl=htmlhelp.xsl
;;
esac
xsl=$(conf_file docbook-xsl/$xsl)
if [ ! -r "$xsl" ]; then
quit "file not found: $xsl"
fi
to_docbook
xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
if [ ! -d "$chunkdir" ]; then
execute_command_2 "mkdir \"$chunkdir\""
fi
execute_command_2 "rm -f \"$chunkdir/*.html\""
copy_stylesheet_and_icons "$chunkdir"
execute_command_2 "cd \"$DESTINATION_DIR\""
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
--stringparam base.dir \"$(basename "$chunkdir")/\" \
\"$xsl\" \"$xml\""
execute_command_2 "cd - >/dev/null"
}
function to_manpage()
{
require "xsltproc"
local xsl xml
xsl=$(conf_file docbook-xsl/manpage.xsl)
if [ ! -r "$xsl" ]; then
quit "file not found: $xsl"
fi
to_docbook "-d manpage"
xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
execute_command_2 "cd \"$DESTINATION_DIR\""
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
\"$xsl\" \"$xml\""
execute_command_2 "cd - >/dev/null"
}
function to_pdf()
{
require "xsltproc"
require "fop.sh"
local xsl xml fo pdf
xsl=$(conf_file docbook-xsl/fo.xsl)
if [ ! -r "$xsl" ]; then
quit "file not found: $xsl"
fi
xml="$SRC_DIR/$SRC_NAME.xml"
fo="$SRC_DIR/$SRC_NAME.fo"
pdf="$DESTINATION_DIR/$SRC_NAME.pdf"
to_docbook
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
\"$xsl\" \"$xml\" >\"$fo\""
execute_command_2 "fop.sh \"$fo\" \"$pdf\""
}
function to_odt()
{
require "docbook2odf"
local xml odt opts
xml="$SRC_DIR/$SRC_NAME.xml"
odt="$DESTINATION_DIR/$SRC_NAME.odt"
opts="--force"
if ! isyes $VERBOSE; then
opts="$opts --quiet"
fi
to_docbook
execute_command_2 "docbook2odf $opts --input-file \"$xml\" --output-file \"$odt\""
}
function to_text()
{
require "asciidoc"
require "lynx"
local html text conf
html="$SRC_DIR/$SRC_NAME.html"
text="$DESTINATION_DIR/$SRC_NAME.text"
conf=$(conf_file text.conf)
execute_command_2 "asciidoc $ASCIIDOC_OPTS -f "$conf" -b html4 \
-o - \"$SRC_FILE\" | lynx -dump -stdin >\"$text\""
}
#--------------------------------------------------------------------
# Main
#--------------------------------------------------------------------
PWD=`pwd`
set_trap
parse_options "$@"
validate_options
ASCIIDOC_OPTS="--doctype=$DOCTYPE $ASCIIDOC_OPTS"
if isyes $VERBOSE_2; then
ASCIIDOC_OPTS="$ASCIIDOC_OPTS --verbose"
XSLTPROC_OPTS="$XSLTPROC_OPTS --verbose"
fi
case "$FORMAT" in
xhtml|chunked|htmlhelp)
XSLTPROC_OPTS="$XSLTPROC_OPTS \
--stringparam html.stylesheet \"$STYLESHEET\""
;;
esac
if isyes $ICONS; then
XSLTPROC_OPTS="$XSLTPROC_OPTS --stringparam callout.graphics 1 \
--stringparam navig.graphics 0 \
--stringparam admon.textlabel 0 \
--stringparam admon.graphics 1 \
--stringparam admon.graphics.path \"$ICONS_DIR/\" \
--stringparam callout.graphics.path \"$ICONS_DIR/callouts/\" \
--stringparam navig.graphics.path \"$ICONS_DIR/\""
else
XSLTPROC_OPTS="$XSLTPROC_OPTS --stringparam callout.graphics 0 \
--stringparam navig.graphics 0 \
--stringparam admon.textlabel 1 \
--stringparam admon.graphics 0"
fi
case "$FORMAT" in
chunked|htmlhelp) to_chunked;;
manpage) to_manpage;;
odt) to_odt;;
pdf) to_pdf;;
text) to_text;;
xhtml) to_xhtml;;
esac
cleanup
#--------------------------------------------------------------------
# vim: set et ts=4 sw=4 sts=4:
#--------------------------------------------------------------------

360
docs/asciidoc/asciidoc.conf Normal file
View File

@@ -0,0 +1,360 @@
#
# 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]
iconsdir=./images/icons
encoding=UTF-8
quirks=
empty=
amp=&
lt=<
gt=>
brvbar=|
nbsp=&#160;
backslash=\
# Attribute and AttributeList element patterns.
attributeentry-pattern=^:(?P<attrname>[a-zA-Z].*?):(?P<attrvalue>.*)$
attributelist-pattern=(?u)(^\[\[(?P<id>[\w\-_]+)\]\]$)|(^\[(?P<attrlist>.*)\]$)
[titles]
subs=specialcharacters,quotes,replacements,macros,attributes
# 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.*)$
[specialcharacters]
&=&amp;
<=&lt;
>=&gt;
[quotes]
# Constrained quotes.
*=strong
'=emphasis
`=monospaced
``|''=quoted
ifdef::asciidoc7compatible[]
\##=unquoted
endif::asciidoc7compatible[]
ifndef::asciidoc7compatible[]
\#=unquoted
_=emphasis
+=monospaced
# Unconstrained quotes.
**=#strong
__=#emphasis
++=#monospaced
\##=#unquoted
^=#superscript
~=#subscript
endif::asciidoc7compatible[]
[specialwords]
emphasizedwords=
strongwords=
monospacedwords=
[tags]
# $$ inline passthrough.
passthrough=|
[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 esaped 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;)
# But disallow unspaced in man pages because double-dash option name prefixes
# are pervasive.
ifndef::doctype-manpage[]
(^|[^-\\])--($|[^-])=\1&#8212;\2
endif::doctype-manpage[]
ifdef::doctype-manpage[]
(^|\s*[^\S\\])--($|\s+)=\1&#8212;\2
endif::doctype-manpage[]
\\--(?!-)=--
# ... Ellipsis (entity reference &hellip;)
(?<!\\)\.\.\.=&#8230;
\\\.\.\.=...
##
# The following require non-standard embedded fonts in PDF files so are not
# enabled.
# -> right arrow
#-&gt;=&#8594;
# => right double arrow
#=&gt;=&#8658;
# <- left arrow
#&lt;-=&#8592;
# <= left double arrow
#&lt;\==&#8656;
# Paragraphs.
[paradef-default]
delimiter=(?s)(?P<text>\S.*)
template=paragraph
posattrs=style
verse-style=template="verseparagraph"
NOTE-style=template="admonitionparagraph",name="note",caption="Note"
TIP-style=template="admonitionparagraph",name="tip",caption="Tip"
IMPORTANT-style=template="admonitionparagraph",name="important",caption="Important"
WARNING-style=template="admonitionparagraph",name="warning",caption="Warning"
CAUTION-style=template="admonitionparagraph",name="caution",caption="Caution"
[paradef-literal]
delimiter=(?s)(?P<text>\s+.*)
options=listelement
template=literalparagraph
subs=verbatim
[paradef-admonition]
delimiter=(?s)^\s*(?P<style>NOTE|TIP|IMPORTANT|WARNING|CAUTION):\s+(?P<text>.+)
NOTE-style=template="admonitionparagraph",name="note",caption="Note"
TIP-style=template="admonitionparagraph",name="tip",caption="Tip"
IMPORTANT-style=template="admonitionparagraph",name="important",caption="Important"
WARNING-style=template="admonitionparagraph",name="warning",caption="Warning"
CAUTION-style=template="admonitionparagraph",name="caution",caption="Caution"
[macros]
# Inline macros.
# Backslash prefix required for escape processing.
# (?s) re flag for line spanning.
(?su)[\\]?(?P<name>\w(\w|-)*?):(?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)(?<!\S)[\\]?\(\(\((?P<attrlist>[^(].*?)\)\)\)(?!\))=indexterm
(?su)(?<!\()[\\]?\(\(\((?P<attrlist>[^(].*?)\)\)\)(?!\))=indexterm
# Index term: ((primary))
# Follows (((...))) macro otherwise it will match them.
#(?<!\S)[\\]?\(\((?P<attrlist>[^\s\(][^(].*?)\)\)(?!\))=indexterm2
(?<!\()[\\]?\(\((?P<attrlist>[^\s\(][^(].*?)\)\)(?!\))=indexterm2
endif::asciidoc7compatible[]
# Callout
[\\]?&lt;(?P<index>\d+)&gt;=callout
# Block macros.
(?u)^(?P<name>\w(\w|-)*?)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$=#
^'{4,}$=#ruler
^//([^/].*|)$=#comment
# System macros.
# This default system macro is hardwired into asciidoc.
#(?u)^(?P<name>\w(\w|-)*?)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$=+
# Delimited blocks.
[blockdef-comment]
delimiter=^/{4,}
options=skip
[comment-blockmacro]
# Outputs nothing.
[blockdef-sidebar]
delimiter=^\*{4,}$
template=sidebarblock
options=sectionbody
[blockdef-list]
delimiter=^--$
template=listblock
options=list
[listblock]
|
[blockdef-passthrough]
delimiter=^\+{4,}$
template=passthroughblock
subs=attributes,macros
[blockdef-listing]
delimiter=^-{4,}$
template=listingblock
subs=verbatim
[blockdef-literal]
delimiter=^\.{4,}$
template=literalblock
subs=verbatim
posattrs=style
verse-style=template="verseblock",subs="normal"
[blockdef-quote]
delimiter=^_{4,}$
template=quoteblock
options=sectionbody
subs=normal
posattrs=attribution,citetitle
[blockdef-example]
delimiter=^\={4,}$
template=exampleblock
options=sectionbody
posattrs=style
NOTE-style=template="admonitionblock",name="note",caption="Note"
TIP-style=template="admonitionblock",name="tip",caption="Tip"
IMPORTANT-style=template="admonitionblock",name="important",caption="Important"
WARNING-style=template="admonitionblock",name="warning",caption="Warning"
CAUTION-style=template="admonitionblock",name="caution",caption="Caution"
# Lists.
[listdef-bulleted]
type=bulleted
delimiter=^\s*- +(?P<text>.+)$
listtag=ilist
itemtag=ilistitem
texttag=ilisttext
[listdef-bulleted2]
type=bulleted
delimiter=^\s*\* +(?P<text>.+)$
listtag=ilist
itemtag=ilistitem
texttag=ilisttext
[listdef-numbered]
type=numbered
delimiter=^\s*(?P<index>\d*)\. +(?P<text>.+)$
listtag=olist
itemtag=olistitem
texttag=olisttext
[listdef-numbered2]
type=numbered
delimiter=^\s*(?P<index>[.a-z])\. +(?P<text>.+)$
listtag=olist2
itemtag=olistitem
texttag=olisttext
[listdef-vlabeled]
type=labeled
delimiter=^\s*(?P<label>.*\S)::$
listtag=vlist
itemtag=vlistitem
texttag=vlisttext
entrytag=vlistentry
labeltag=vlistterm
[listdef-vlabeled2]
type=labeled
delimiter=^\s*(?P<label>.*\S);;$
listtag=vlist
itemtag=vlistitem
texttag=vlisttext
entrytag=vlistentry
labeltag=vlistterm
[listdef-hlabeled]
type=labeled
delimiter=^\s*(?P<label>.*\S)((::\s*\\)|(::\s+(?P<text>.+)))$
listtag=hlist
itemtag=hlistitem
texttag=hlisttext
entrytag=hlistentry
labeltag=hlistterm
[listdef-hlabeled2]
type=labeled
delimiter=^\s*(?P<label>.*\S)((;;\s*\\)|(;;\s+(?P<text>.+)))$
listtag=hlist
itemtag=hlistitem
texttag=hlisttext
entrytag=hlistentry
labeltag=hlistterm
# Question and Answer list.
[listdef-qanda]
type=labeled
delimiter=^\s*(?P<label>.*\S)\?\?$
listtag=qlist
itemtag=qlistitem
texttag=qlisttext
entrytag=qlistentry
labeltag=qlistterm
# Bibliography list.
[listdef-bibliography]
type=bulleted
delimiter=^\+ +(?P<text>.+)$
listtag=blist
itemtag=blistitem
texttag=blisttext
# Glossary list.
[listdef-glossary]
type=labeled
delimiter=^(?P<label>.*\S):-$
listtag=glist
itemtag=glistitem
texttag=glisttext
entrytag=glistentry
labeltag=glistterm
# Callout list.
[listdef-callout]
type=callout
delimiter=^<?(?P<index>\d*)> +(?P<text>.+)$
listtag=colist
itemtag=colistitem
texttag=colisttext
# Tables.
[tabledef-default]
fillchar=-
format=fixed
[tabledef-csv]
fillchar=~
format=csv
[tabledef-dsv]
fillchar=_
format=dsv

4170
docs/asciidoc/asciidoc.py Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,84 @@
AsciiDoc DocBook XSL Stylesheets Notes
======================================
*********************************************************************
All current AsciiDoc PDF and manpage documentation has been generated
using *DocBook XSL Stylesheets version 1.72.0*, these notes and
patches relate to this version. The version of FOP used is 0.20.5 (I
did try FOP 0.93 under Ubuntu 6.10, but got a Java exception which I
didn't pursue).
*********************************************************************
My tools of choice for converting AsciiDoc generated DocBook files to
PDF and manpage files are xsltproc(1), FOP and DocBook XSL
Stylesheets. Output file customisation is achieved by tweaking the
DocBook XSL stylesheets. I've tried to keep customization to a minimum
and confine it to the separate XSL driver files in the distribution
`./docbook-xsl/` directory (see the User Guide for details). To polish
a couple of rough edges I've written some patches for the DocBook XSL
stylesheets -- you don't need them but they're documented below and
included in the distribution `./docbook-xsl/` directory.
Manually upgrading Debian to the latest DocBook XSL stylesheets
---------------------------------------------------------------
The DocBook XSL Stylesheets distribution is just a directory full of
text files and you can switch between releases by changing the
directory name in the system XML catalog.
To upgrade to the latest docbook-xsl stylesheets without having to
wait for the Debian `docbook-xsl` package:
- Download the latest docbook-xsl tarball from
http://docbook.sourceforge.net/projects/xsl/[].
- Unzip the tarball to `/usr/share/xml/docbook/stylesheet/`:
# cd /usr/share/xml/docbook/stylesheet
# tar -xzf /tmp/docbook-xsl-1.72.0.tar.gz
- Edit `/etc/xml/docbook-xsl.xml` catalog and replace occurences of
the current stylesheets directory with the new one (in our example
it would be `/usr/share/xml/docbook/stylesheet/docbook-xsl-1.72.0`.
- Apply optional patches (see below).
Patches to DocBook XSL Stylesheets
----------------------------------
Shade Literal Block Patch
~~~~~~~~~~~~~~~~~~~~~~~~~
The processing expectation for AsciiDoc LiteralBlocks and
LiteralParagraphs is that they are not shaded. The
`shaded-literallayout.patch` was devised to allow AciiDoc Listing
blocks to be shaded while leaving Literal paragraphs and Literal
blocks unshaded (the default DocBook XSL Stylesheets behavior is to
shade all verbatim elements).
The patch implements a `shade.literallayout` XSL parameter so that
shading in literal elements could be disabled while other verbatim
elements are left shaded (by setting the XSL `shade.verbatim`
parameter).
The relevant patch file is `shaded-literallayout.patch` and it can be
applied from the DocBook XSL Stylesheets directory with the following
command:
# patch -p0 < shaded-literallayout.patch
Manpage spurious .sp patch
~~~~~~~~~~~~~~~~~~~~~~~~~~
IMPORTANT: Don't apply this patch. It was designed for docbook-xsl
1.69.1 (the previous version of docbook-xsl used with AsciiDoc) and
does not work with 1.72.0. I don't think it's necessary with
docbook-xsl 1.72.0.
Standalone `simpara` and some nested `title` DocBook elements generate
`.sp` groff markup without a preceding newline, the `manpage-sp.patch`
fixes this as well as stripping out extra blank lines generated by
some `.sp` markup elements.
The patch can be applied from the DocBook XSL Stylesheets directory
with the following command:
# patch -p0 < manpage-sp.patch

View File

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

View File

@@ -0,0 +1,61 @@
<!--
Inlcuded in xhtml.xsl, xhtml.chunked.xsl, htmlhelp.xsl.
Contains common XSL stylesheets parameters.
Output documents styled by docbook.css.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="html.stylesheet" select="'./docbook-xsl.css'"/>
<xsl:param name="htmlhelp.chm" select="'htmlhelp.chm'"/>
<xsl:param name="htmlhelp.hhc.section.depth" select="5"/>
<xsl:param name="suppress.navigation" select="0"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/>
<xsl:param name="navig.graphics" select="0"/>
<xsl:param name="navig.graphics.path">./images/icons/</xsl:param>
<xsl:param name="navig.showtitles">0</xsl:param>
<xsl:param name="shade.verbatim" select="0"/>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="bgcolor">#E0E0E0</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="admon.graphics.path">./images/icons/</xsl:param>
<xsl:param name="admon.graphics.extension" select="'.png'"/>
<xsl:param name="admon.style">
<xsl:text>margin-left: 0; margin-right: 10%;</xsl:text>
</xsl:param>
<xsl:param name="admon.textlabel" select="1"/>
<xsl:param name="callout.defaultcolumn" select="'60'"/>
<xsl:param name="callout.graphics.extension" select="'.png'"/>
<xsl:param name="callout.graphics" select="'1'"/>
<xsl:param name="callout.graphics.number.limit" select="'10'"/>
<xsl:param name="callout.graphics.path" select="'./images/icons/callouts/'"/>
<xsl:param name="callout.list.table" select="'1'"/>
<xsl:param name="base.dir" select="'./xhtml/'"/>
<xsl:param name="chunk.first.sections" select="0"/>
<xsl:param name="chunk.quietly" select="0"/>
<xsl:param name="chunk.section.depth" select="1"/>
<xsl:param name="chunk.toc" select="''"/>
<xsl:param name="chunk.tocs.and.lots" select="0"/>
<xsl:param name="html.cellpadding" select="'4px'"/>
<xsl:param name="html.cellspacing" select="''"/>
<xsl:param name="table.borders.with.css" select="1"/>
<xsl:param name="table.cell.border.color" select="''"/>
<xsl:param name="table.cell.border.style" select="'solid'"/>
<xsl:param name="table.cell.border.thickness" select="'1px'"/>
<xsl:param name="table.footnote.number.format" select="'a'"/>
<xsl:param name="table.footnote.number.symbols" select="''"/>
<xsl:param name="table.frame.border.color" select="'#527bbd'"/>
<xsl:param name="table.frame.border.style" select="'solid'"/>
<xsl:param name="table.frame.border.thickness" select="'2px'"/>
<xsl:param name="tablecolumns.extension" select="'1'"/>
</xsl:stylesheet>

View File

@@ -0,0 +1,112 @@
<!--
Generates single FO document from DocBook XML source using DocBook XSL
stylesheets.
See xsl-stylesheets/fo/param.xsl for all parameters.
NOTE: The URL reference to the current DocBook XSL stylesheets is
rewritten to point to the copy on the local disk drive by the XML catalog
rewrite directives so it doesn't need to go out to the Internet for the
stylesheets. This means you don't need to edit the <xsl:import> elements on
a machine by machine basis.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
<xsl:import href="common.xsl"/>
<xsl:param name="fop.extensions" select="1" />
<xsl:param name="variablelist.as.blocks" select="1" />
<xsl:param name="paper.type" select="'A4'"/>
<!--
<xsl:param name="paper.type" select="'USletter'"/>
-->
<xsl:param name="hyphenate">false</xsl:param>
<!-- justify, left or right -->
<xsl:param name="alignment">left</xsl:param>
<xsl:param name="body.font.family" select="'serif'"/>
<xsl:param name="body.font.master">12</xsl:param>
<xsl:param name="body.font.size">
<xsl:value-of select="$body.font.master"/><xsl:text>pt</xsl:text>
</xsl:param>
<xsl:param name="body.margin.bottom" select="'0.5in'"/>
<xsl:param name="body.margin.top" select="'0.5in'"/>
<xsl:param name="bridgehead.in.toc" select="0"/>
<!-- Default fetches image from Internet (long timeouts) -->
<xsl:param name="draft.watermark.image" select="''"/>
<!-- Sets title to body text indent -->
<xsl:param name="title.margin.left">
<xsl:choose>
<xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
<xsl:otherwise>-12pt</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="page.margin.bottom" select="'0.25in'"/>
<xsl:param name="page.margin.inner">
<xsl:choose>
<xsl:when test="$double.sided != 0">0.75in</xsl:when>
<xsl:otherwise>0.5in</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="page.margin.outer">
<xsl:choose>
<xsl:when test="$double.sided != 0">0.5in</xsl:when>
<xsl:otherwise>0.5in</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="page.margin.top" select="'0.5in'"/>
<xsl:param name="page.orientation" select="'portrait'"/>
<xsl:param name="page.width">
<xsl:choose>
<xsl:when test="$page.orientation = 'portrait'">
<xsl:value-of select="$page.width.portrait"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$page.height.portrait"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:attribute-set name="monospace.properties">
<xsl:attribute name="font-size">10pt</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="admon.textlabel" select="1"/>
<xsl:attribute-set name="admonition.title.properties">
<xsl:attribute name="font-size">14pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
<xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="sidebar.properties" use-attribute-sets="formal.object.properties">
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-width">1pt</xsl:attribute>
<xsl:attribute name="border-color">silver</xsl:attribute>
<xsl:attribute name="background-color">#ffffee</xsl:attribute>
<xsl:attribute name="padding-left">12pt</xsl:attribute>
<xsl:attribute name="padding-right">12pt</xsl:attribute>
<xsl:attribute name="padding-top">6pt</xsl:attribute>
<xsl:attribute name="padding-bottom">6pt</xsl:attribute>
<xsl:attribute name="margin-left">0pt</xsl:attribute>
<xsl:attribute name="margin-right">12pt</xsl:attribute>
<xsl:attribute name="margin-top">6pt</xsl:attribute>
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="callout.graphics" select="'1'"/>
<xsl:param name="shade.literallayout" select="0"/>
<xsl:param name="shade.verbatim" select="1"/>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="background-color">#F0F0F0</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>

View File

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

View File

@@ -0,0 +1,41 @@
diff -u ./manpages.ORIG/block.xsl ./manpages/block.xsl
--- ./manpages.ORIG/block.xsl 2005-11-30 17:31:23.135642494 +1300
+++ ./manpages/block.xsl 2005-11-30 17:35:59.368886010 +1300
@@ -37,7 +37,7 @@
<xsl:apply-templates/>
</xsl:variable>
<xsl:value-of select="normalize-space($content)"/>
- <xsl:text>.sp&#10;</xsl:text>
+ <xsl:text>&#10;.sp&#10;</xsl:text>
</xsl:template>
<xsl:template match="address|literallayout|programlisting|screen|synopsis">
@@ -56,7 +56,7 @@
<xsl:when test="parent::caption|parent::entry|parent::para|
parent::td|parent::th" /> <!-- do nothing -->
<xsl:otherwise>
- <xsl:text>.sp&#10;</xsl:text>
+ <xsl:text>&#10;.sp&#10;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>.nf&#10;</xsl:text>
diff -u ./manpages.ORIG/param.xsl ./manpages/param.xsl
--- ./manpages.ORIG/param.xsl 2005-11-30 17:31:23.164638883 +1300
+++ ./manpages/param.xsl 2005-11-30 17:58:14.345174391 +1300
@@ -47,6 +47,16 @@
<substitution oldstring="&#xA;&#xA;." newstring="&#xA;."/>
<!-- * remove any .sp occurences that directly follow a .PP -->
<substitution oldstring=".PP&#xA;.sp" newstring=".PP"/>
+
+ <!-- * remove any .sp occurences that directly preceed a .SH -->
+ <substitution oldstring=".sp&#xA;.SH" newstring=".SH"/>
+ <!-- * remove any .sp occurences that directly preceed a .TP -->
+ <substitution oldstring=".sp&#xA;.TP" newstring=".TP"/>
+ <!-- * remove any .sp occurences that directly preceed a .SS -->
+ <substitution oldstring=".sp&#xA;.SS" newstring=".SS"/>
+ <!-- * remove any .sp occurences that directly preceed a .sp -->
+ <substitution oldstring=".sp&#xA;.sp" newstring=".sp"/>
+
<!-- * squeeze multiple newlines after start of no-fill (verbatim) env. -->
<substitution oldstring=".nf&#xA;&#xA;" newstring=".nf&#xA;"/>
<!-- * an apostrophe at the beginning of a line gets interpreted as a -->

View File

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

View File

@@ -0,0 +1,32 @@
diff -u fo.ORIG/param.xsl fo/param.xsl
--- fo.ORIG/param.xsl 2005-11-30 19:22:15.992409173 +1300
+++ fo/param.xsl 2005-11-30 11:25:40.000000000 +1300
@@ -669,6 +669,7 @@
</xsl:attribute-set>
<xsl:param name="segmentedlist.as.table" select="0"/>
<xsl:param name="shade.verbatim" select="0"/>
+<xsl:param name="shade.literallayout" select="0"/>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
diff -u fo.ORIG/verbatim.xsl fo/verbatim.xsl
--- fo.ORIG/verbatim.xsl 2005-11-30 19:22:15.944415115 +1300
+++ fo/verbatim.xsl 2005-11-30 11:26:12.000000000 +1300
@@ -105,7 +105,7 @@
<xsl:choose>
<xsl:when test="@class='monospaced'">
<xsl:choose>
- <xsl:when test="$shade.verbatim != 0">
+ <xsl:when test="$shade.literallayout != 0">
<fo:block id="{$id}"
white-space-collapse='false'
white-space-treatment='preserve'
@@ -128,7 +128,7 @@
</xsl:when>
<xsl:otherwise>
<xsl:choose>
- <xsl:when test="$shade.verbatim != 0">
+ <xsl:when test="$shade.literallayout != 0">
<fo:block id="{$id}"
wrap-option='no-wrap'
white-space-collapse='false'

View File

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

597
docs/asciidoc/docbook.conf Normal file
View File

@@ -0,0 +1,597 @@
#
# docbook.conf
#
# Asciidoc configuration file.
# Default docbook backend.
#
[miscellaneous]
outfilesuffix=.xml
# Printable page width in pts.
pagewidth=380
pageunits=pt
[attributes]
basebackend=docbook
basebackend-docbook=
[replacements]
# Line break markup is dropped (there is no DocBook line break tag).
(?m)^(.*)\s\+$=\1
ifdef::asciidoc7compatible[]
# Superscripts.
\^(.+?)\^=<superscript>\1</superscript>
# Subscripts.
~(.+?)~=<subscript>\1</subscript>
endif::asciidoc7compatible[]
[ruler-blockmacro]
# Only applies to HTML so don't output anything.
[image-inlinemacro]
<inlinemediaobject>
<imageobject>
<imagedata fileref="{target}"{width? contentwidth="{width}pt"}{height? contentdepth="{height}pt"}/>
</imageobject>
<textobject><phrase>{1={target}}</phrase></textobject>
</inlinemediaobject>
[image-blockmacro]
<figure{id? id="{id}"}><title>{title}</title>
{title%}<informalfigure{id? id="{id}"}>
<mediaobject>
<imageobject>
<imagedata fileref="{target}"{width? contentwidth="{width}pt"}{height? contentdepth="{height}pt"}/>
</imageobject>
<textobject><phrase>{1={target}}</phrase></textobject>
</mediaobject>
{title#}</figure>
{title%}</informalfigure>
[indexterm-inlinemacro]
# Inline index term.
# Generate separate index entries for primary, secondary and tertiary
# descriptions.
# Primary only.
{2%}<indexterm>
{2%} <primary>{1}</primary>
{2%}</indexterm>
# Primary and secondary.
{2#}{3%}<indexterm>
{2#}{3%} <primary>{1}</primary><secondary>{2}</secondary>
{2#}{3%}</indexterm>
{2#}{3%}<indexterm>
{2#}{3%} <primary>{2}</primary>
{2#}{3%}</indexterm>
# Primary, secondary and tertiary.
{3#}<indexterm>
<primary>{1}</primary><secondary>{2}</secondary><tertiary>{3}</tertiary>
{3#}</indexterm>
{3#}<indexterm>
<primary>{2}</primary><secondary>{3}</secondary>
{3#}</indexterm>
{3#}<indexterm>
<primary>{3}</primary>
{3#}</indexterm>
[indexterm2-inlinemacro]
# Inline index term.
# Single entry index term that is visible in the primary text flow.
<indexterm>
<primary>{1}</primary>
</indexterm>
{1}
[footnote-inlinemacro]
# Inline footnote.
<footnote><simpara>{0}</simpara></footnote>
[callout-inlinemacro]
# Inline callout.
<co id="{coid}"/>
[tags]
# Bulleted, numbered and labeled list tags.
ilist=<itemizedlist{id? id="{id}"}>{title?<title>{title}</title>}|</itemizedlist>
ilistitem=<listitem>|</listitem>
ilisttext=<simpara>|</simpara>
olist=<orderedlist{id? id="{id}"}>{title?<title>{title}</title>}|</orderedlist>
olist2=<orderedlist{id? id="{id}"} numeration="loweralpha">|</orderedlist>
olistitem=<listitem>|</listitem>
olisttext=<simpara>|</simpara>
vlist=<variablelist{id? id="{id}"}>{title?<title>{title}</title>}|</variablelist>
vlistentry=<varlistentry>|</varlistentry>
vlistterm=<term>|</term>
vlisttext=<simpara>|</simpara>
vlistitem=<listitem>|</listitem>
# Horizontal labeled list (implemented with two column table).
# Hardwired column widths to 30%,70% because the current crop of PDF
# generators do not auto calculate column widths.
hlist=<{title?table}{title!informaltable}{id? id="{id}"} tabstyle="{style=hlabeledlist}" pgwide="0" frame="none" colsep="0" rowsep="0">{title?<title>{title}</title>}<tgroup cols="2"><colspec colwidth="{1=3}*"/><colspec colwidth="{2=7}*"/><tbody valign="top">|</tbody></tgroup><{title?/table}{title!/informaltable}>
hlistentry=<row>|</row>
hlisttext=<simpara>|</simpara>
hlistterm=<entry><simpara>|</simpara></entry>
hlistitem=<entry>|</entry>
# Question and Answer list.
qlist=<qandaset{id? id="{id}"}>{title?<title>{title}</title>}|</qandaset>
qlistentry=<qandaentry>|</qandaentry>
qlistterm=<question><simpara>|</simpara></question>
qlistitem=<answer>|</answer>
qlisttext=<simpara>|</simpara>
# Bibliography list.
blist=|
blistitem=<bibliomixed>|</bibliomixed>
blisttext=<bibliomisc>|</bibliomisc>
# Glossary list.
glist=|
glistentry=<glossentry>|</glossentry>
glistterm=<glossterm>|</glossterm>
glistitem=<glossdef>|</glossdef>
glisttext=<simpara>|</simpara>
# Callout list.
colist=<calloutlist{id? id="{id}"}>{title?<title>{title}</title>}|</calloutlist>
colistitem=<callout arearefs="{coids}">|</callout>
colisttext=<simpara>|</simpara>
# Quoted text
emphasis=<emphasis>|</emphasis>
strong=<emphasis role="strong">|</emphasis>
monospaced=<literal>|</literal>
quoted={amp}#8220;|{amp}#8221;
unquoted=|
subscript=<subscript>|</subscript>
superscript=<superscript>|</superscript>
# $$ inline passthrough.
$$passthrough=|
# Inline macros
[http-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[https-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[ftp-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[file-inlinemacro]
<ulink url="{name}:{target}">{0={name}:{target}}</ulink>
[mailto-inlinemacro]
<ulink url="{name}:{target}">{0={target}}</ulink>
[callto-inlinemacro]
<ulink url="{name}:{target}">{0={target}}</ulink>
[link-inlinemacro]
<ulink url="{target}">{0={target}}</ulink>
# anchor:id[text]
[anchor-inlinemacro]
<anchor id="{target}" xreflabel="{0=[{target}]}"/>
# [[id,text]]
[anchor2-inlinemacro]
<anchor id="{1}" xreflabel="{2=[{1}]}"/>
# [[[id]]]
[anchor3-inlinemacro]
<anchor id="{1}" xreflabel="[{1}]"/>[{1}]
# xref:id[text]
[xref-inlinemacro]
<link linkend="{target}">{0}</link>
{2%}<xref linkend="{target}"/>
# <<id,text>>
[xref2-inlinemacro]
<link linkend="{1}">{2}</link>
{2%}<xref linkend="{1}"/>
# Special word macros
[emphasizedwords]
<emphasis>{words}</emphasis>
[monospacedwords]
<literal>{words}</literal>
[strongwords]
<emphasis role="strong">{words}</emphasis>
# Paragraph substitution.
[paragraph]
<formalpara{id? id="{id}"}><title>{title}</title><para>
{title%}<simpara{id? id="{id}"}>
|
{title%}</simpara>
{title#}</para></formalpara>
{empty}
[admonitionparagraph]
<{name}{id? id="{id}"}><simpara>|</simpara></{name}>
[literalparagraph]
# The literal block employs the same markup.
template::[literalblock]
[verseparagraph]
template::[verseblock]
# Delimited blocks.
[literalblock]
<example><title>{title}</title>
<literallayout{id? id="{id}"} class="{font=monospaced}">
|
</literallayout>
{title#}</example>
[listingblock]
<example><title>{title}</title>
<screen>
|
</screen>
{title#}</example>
[verseblock]
<formalpara{id? id="{id}"}><title>{title}</title><para>
{title%}<literallayout{id? id="{id}"}>
{title#}<literallayout>
|
</literallayout>
{title#}</para></formalpara>
[sidebarblock]
<sidebar{id? id="{id}"}>
<title>{title}</title>
|
</sidebar>
[passthroughblock]
|
[quoteblock]
# The epigraph element may be more appropriate than blockquote.
<blockquote{id? id="{id}"}>
<title>{title}</title>
# Include attribution only if either {attribution} or {citetitle} are defined.
{attribution#}<attribution>
{attribution%}{citetitle#}<attribution>
{attribution}
<citetitle>{citetitle}</citetitle>
{attribution#}</attribution>
{attribution%}{citetitle#}</attribution>
|
</blockquote>
[exampleblock]
<{title?example}{title!informalexample}{id? id="{id}"}>
<title>{title}</title>
|
</{title?example}{title!informalexample}>
[admonitionblock]
<{name}{id? id="{id}"}>
<title>{title}</title>
|
</{name}>
# Tables.
[tabledef-default]
template=table
colspec=<colspec colwidth="{colwidth}{pageunits}" align="{colalign}"/>
bodyrow=<row>|</row>
bodydata=<entry>|</entry>
[table]
<{title?table}{title!informaltable}{id? id="{id}"} pgwide="0"
frame="{frame=topbot}"
{grid%rowsep="0" colsep="0"}
rowsep="{grid@none|cols:0:1}" colsep="{grid@none|rows:0:1}"
>
<title>{title}</title>
<tgroup cols="{cols}">
{colspecs}
{headrows#}<thead>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot>
{footrows}
{footrows#}</tfoot>
<tbody>
{bodyrows}
</tbody>
</tgroup>
</{title?table}{title!informaltable}>
[specialsections]
ifdef::doctype-article[]
^Abstract$=sect-abstract
endif::doctype-article[]
ifdef::doctype-book[]
^Colophon$=sect-colophon
^Dedication$=sect-dedication
^Preface$=sect-preface
endif::doctype-book[]
^Index$=sect-index
^(Bibliography|References)$=sect-bibliography
^Glossary$=sect-glossary
^Appendix [A-Z][:.](?P<title>.*)$=sect-appendix
# Special sections.
[sect-preface]
<preface{id? id="{id}"}>
<title>{title}</title>
|
</preface>
[sect-index]
<index{id? id="{id}"}>
<title>{title}</title>
|
</index>
[sect-bibliography]
<bibliography{id? id="{id}"}>
<title>{title}</title>
|
</bibliography>
[sect-glossary]
<glossary{id? id="{id}"}>
<title>{title}</title>
|
</glossary>
[sect-appendix]
<appendix{id? id="{id}"}>
<title>{title}</title>
|
</appendix>
[header-declarations]
<?xml version="1.0" encoding="{encoding}"?>
<!DOCTYPE {doctype-article?article}{doctype-book?book}{doctype-manpage?refentry} PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
#-------------------------
# article document type
#-------------------------
ifdef::doctype-article[]
[header]
template::[header-declarations]
<article lang="en">
{doctitle#}<articleinfo>
<title>{doctitle}</title>
<date>{date}</date>
{authored#}<author>
<firstname>{firstname}</firstname>
<othername>{middlename}</othername>
<surname>{lastname}</surname>
<affiliation><address><email>{email}</email></address></affiliation>
{authored#}</author>
<authorinitials>{authorinitials}</authorinitials>
# If file named like source document with -revhistory.xml suffix exists
# include it as the document history, otherwise use current revision.
{revisionhistory#}{include:{docdir}/{docname}-revhistory.xml}
{revisionhistory%}<revhistory><revision><revnumber>{revision}</revnumber><date>{date}</date>{authorinitials?<authorinitials>{authorinitials}</authorinitials>}{revremark?<revremark>{revremark}</revremark>}</revision></revhistory>
<corpname>{companyname}</corpname>
{doctitle#}</articleinfo>
[footer]
</article>
[preamble]
# Untitled elements between header and first section title.
|
[sect-abstract]
<abstract{id? id="{id}"}>
|
</abstract>
[sect1]
<section{id? id="{id}"}>
<title>{title}</title>
|
</section>
[sect2]
<section{id? id="{id}"}>
<title>{title}</title>
|
</section>
[sect3]
<section{id? id="{id}"}>
<title>{title}</title>
|
</section>
[sect4]
<section{id? id="{id}"}>
<title>{title}</title>
|
</section>
endif::doctype-article[]
#-------------------------
# manpage document type
#-------------------------
ifdef::doctype-manpage[]
[replacements]
# The roff format does not substitute special characters so just print them as
# text.
\(C\)=(C)
\(TM\)=(TM)
[header]
template::[header-declarations]
<refentry>
<refmeta>
<refentrytitle>{mantitle}</refentrytitle>
<manvolnum>{manvolnum}</manvolnum>
</refmeta>
<refnamediv>
<refname>{manname}</refname>
<refpurpose>{manpurpose}</refpurpose>
</refnamediv>
[footer]
</refentry>
# Section macros
[sect-synopsis]
<refsynopsisdiv{id? id="{id}"}>
|
</refsynopsisdiv>
[sect1]
<refsect1{id? id="{id}"}>
<title>{title}</title>
|
</refsect1>
[sect2]
<refsect2{id? id="{id}"}>
<title>{title}</title>
|
</refsect2>
[sect3]
<refsect3{id? id="{id}"}>
<title>{title}</title>
|
</refsect3>
endif::doctype-manpage[]
#-------------------------
# book document type
#-------------------------
ifdef::doctype-book[]
[header]
template::[header-declarations]
<book lang="en">
{doctitle#}<bookinfo>
<title>{doctitle}</title>
<date>{date}</date>
{authored#}<author>
<firstname>{firstname}</firstname>
<othername>{middlename}</othername>
<surname>{lastname}</surname>
<affiliation><address><email>{email}</email></address></affiliation>
{authored#}</author>
<authorinitials>{authorinitials}</authorinitials>
# If file named like source document with -revhistory.xml suffix exists
# include it as the document history, otherwise use current revision.
{revisionhistory#}{include:{docdir}/{docname}-revhistory.xml}
{revisionhistory%}<revhistory><revision><revnumber>{revision}</revnumber><date>{date}</date>{authorinitials?<authorinitials>{authorinitials}</authorinitials>}{revremark?<revremark>{revremark}</revremark>}</revision></revhistory>
<corpname>{companyname}</corpname>
{doctitle#}</bookinfo>
[footer]
</book>
[preamble]
# Preamble is not allowed in DocBook book so wrap it in a preface.
<preface{id? id="{id}"}>
<title>Preface</title>
|
</preface>
[sect-dedication]
<dedication{id? id="{id}"}>
|
</dedication>
[sect-colophon]
<colophon{id? id="{id}"}>
|
</colophon>
[sect0]
<part{id? id="{id}"}>
<title>{title}</title>
|
</part>
[sect1]
<chapter{id? id="{id}"}>
<title>{title}</title>
|
</chapter>
[sect2]
<section{id? id="{id}"}>
<title>{title}</title>
|
</section>
[sect3]
<section{id? id="{id}"}>
<title>{title}</title>
|
</section>
[sect4]
<section{id? id="{id}"}>
<title>{title}</title>
|
</section>
endif::doctype-book[]
ifdef::sgml[]
#
# Optional DocBook SGML.
#
# Most of the differences between DocBook XML and DocBook SGML boils
# down to the empty element syntax: SGML does not like the XML empty
# element <.../> syntax, use <...> instead.
#
[miscellaneous]
outfilesuffix=.sgml
[header-declarations]
<!DOCTYPE {doctype-article?article}{doctype-book?book}{doctype-manpage?refentry} PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
[tabledef-default]
colspec=<colspec colwidth="{colwidth}{pageunits}" align="{colalign}">
[image-inlinemacro]
<inlinemediaobject>
<imageobject>
<imagedata fileref="{target}"{width? width="{width}pt"}{height? depth="{height}pt"}>
</imageobject>
<textobject><phrase>{1={target}}</phrase></textobject>
</inlinemediaobject>
[image-blockmacro]
<figure><title>{title}</title>
{title%}<informalfigure>
<mediaobject>
<imageobject>
<imagedata fileref="{target}"{width? width="{width}pt"}{height? depth="{height}pt"}>
</imageobject>
<textobject><phrase>{1={target}}</phrase></textobject>
</mediaobject>
{title#}</figure>
{title%}</informalfigure>
# Inline macros
[xref-inlinemacro]
<link linkend="{target}">{0}</link>
{2%}<xref linkend="{target}">
[xref2-inlinemacro]
# <<id,text>>
<link linkend="{1}">{2}</link>
{2%}<xref linkend="{1}">
[anchor-inlinemacro]
<anchor id="{target}" xreflabel="{0=[{target}]}">
[anchor2-inlinemacro]
# [[id,text]]
<anchor id="{1}" xreflabel="{2=[{1}]}">
endif::sgml[]

View File

@@ -0,0 +1,37 @@
AsciiDoc Code Filter
====================
This simple minded filter highlights source code keywords and
comments.
NOTE: The filter is to demonstrate how to write a filter -- it's much
to simplistic to be passed off as a code syntax highlighter. If you
want a full featured highlighter use the 'source highlighter filter.
Files
-----
code-filter.py::
The filter Python script.
code-filter.conf::
The AsciiDoc filter configuration file.
code-filter-test.txt::
Short AsciiDoc document to test the filter.
Installation
------------
The code filter is installed in the distribution `filters` directory
as part of the standard AsciiDoc install.
Test it on the `code-filter-test.txt` file:
$ asciidoc -v code-filter-test.txt
$ firefox code-filter-test.txt &
Help
----
Execute the filter with the help option:
$ ./code-filter.py --help

View File

@@ -0,0 +1,7 @@
The connect.cc Source File
--------------------------
[language="C++"]
code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include1::../../connect/utils.cc[]
code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -0,0 +1,15 @@
Code Filter Test
================
[python]
code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
''' A multi-line
comment.'''
def sub_word(mo):
''' Single line comment.'''
word = mo.group('word') # Inline comment
if word in keywords[language]:
return quote + word + quote
else:
return word
code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -0,0 +1,14 @@
#
# AsciiDoc code filter configuration file.
#
# Documented in code-filter-readme.txt
#
[blockdef-code]
# The leading 'code' is optional for backward compatibility, may be mandatory
# in future versions.
delimiter=^(code)?~{4,}$
template=listingblock
presubs=none
filter=code-filter.py -b {basebackend} -l {language}
posattrs=language

View File

@@ -0,0 +1,239 @@
#!/usr/bin/env python
'''
NAME
code-filter - AsciiDoc filter to highlight language keywords
SYNOPSIS
code-filter -b backend -l language [ -t tabsize ]
[ --help | -h ] [ --version | -v ]
DESCRIPTION
This filter reads source code from the standard input, highlights language
keywords and comments and writes to the standard output.
The purpose of this program is to demonstrate how to write an AsciiDoc
filter -- it's much to simplistic to be passed off as a code syntax
highlighter. Use the 'source-highlight-filter' instead.
OPTIONS
--help, -h
Print this documentation.
-b
Backend output file format: 'docbook', 'linuxdoc', 'html', 'css'.
-l
The name of the source code language: 'python', 'ruby', 'c++', 'c'.
-t tabsize
Expand source tabs to tabsize spaces.
--version, -v
Print program version number.
BUGS
- Code on the same line as a block comment is treated as comment.
Keywords inside literal strings are highlighted.
- There doesn't appear to be an easy way to accomodate linuxdoc so
just pass it through without markup.
AUTHOR
Written by Stuart Rackham, <srackham@methods.co.nz>
URLS
http://sourceforge.net/projects/asciidoc/
http://www.methods.co.nz/asciidoc/
COPYING
Copyright (C) 2002-2006 Stuart Rackham. Free use of this software is
granted under the terms of the GNU General Public License (GPL).
'''
import os, sys, re, string
VERSION = '1.1.2'
# Globals.
language = None
backend = None
tabsize = 8
keywordtags = {
'html':
('<strong>','</strong>'),
'css':
('<strong>','</strong>'),
'docbook':
('<emphasis role="strong">','</emphasis>'),
'linuxdoc':
('','')
}
commenttags = {
'html':
('<i>','</i>'),
'css':
('<i>','</i>'),
'docbook':
('<emphasis>','</emphasis>'),
'linuxdoc':
('','')
}
keywords = {
'python':
('and', 'del', 'for', 'is', 'raise', 'assert', 'elif', 'from',
'lambda', 'return', 'break', 'else', 'global', 'not', 'try', 'class',
'except', 'if', 'or', 'while', 'continue', 'exec', 'import', 'pass',
'yield', 'def', 'finally', 'in', 'print'),
'ruby':
('__FILE__', 'and', 'def', 'end', 'in', 'or', 'self', 'unless',
'__LINE__', 'begin', 'defined?' 'ensure', 'module', 'redo', 'super',
'until', 'BEGIN', 'break', 'do', 'false', 'next', 'rescue', 'then',
'when', 'END', 'case', 'else', 'for', 'nil', 'retry', 'true', 'while',
'alias', 'class', 'elsif', 'if', 'not', 'return', 'undef', 'yield'),
'c++':
('asm', 'auto', 'bool', 'break', 'case', 'catch', 'char', 'class',
'const', 'const_cast', 'continue', 'default', 'delete', 'do', 'double',
'dynamic_cast', 'else', 'enum', 'explicit', 'export', 'extern',
'false', 'float', 'for', 'friend', 'goto', 'if', 'inline', 'int',
'long', 'mutable', 'namespace', 'new', 'operator', 'private',
'protected', 'public', 'register', 'reinterpret_cast', 'return',
'short', 'signed', 'sizeof', 'static', 'static_cast', 'struct',
'switch', 'template', 'this', 'throw', 'true', 'try', 'typedef',
'typeid', 'typename', 'union', 'unsigned', 'using', 'virtual', 'void',
'volatile', 'wchar_t', 'while')
}
block_comments = {
'python': ("'''","'''"),
'ruby': None,
'c++': ('/*','*/')
}
inline_comments = {
'python': '#',
'ruby': '#',
'c++': '//'
}
def print_stderr(line):
sys.stderr.write(line+os.linesep)
def sub_keyword(mo):
'''re.subs() argument to tag keywords.'''
word = mo.group('word')
if word in keywords[language]:
stag,etag = keywordtags[backend]
return stag+word+etag
else:
return word
def code_filter():
'''This function does all the work.'''
global language, backend
inline_comment = inline_comments[language]
blk_comment = block_comments[language]
if blk_comment:
blk_comment = (re.escape(block_comments[language][0]),
re.escape(block_comments[language][1]))
stag,etag = commenttags[backend]
in_comment = 0 # True if we're inside a multi-line block comment.
tag_comment = 0 # True if we should tag the current line as a comment.
line = sys.stdin.readline()
while line:
line = string.rstrip(line)
line = string.expandtabs(line,tabsize)
# Escape special characters.
line = string.replace(line,'&','&amp;')
line = string.replace(line,'<','&lt;')
line = string.replace(line,'>','&gt;')
# Process block comment.
if blk_comment:
if in_comment:
if re.match(r'.*'+blk_comment[1]+r'$',line):
in_comment = 0
else:
if re.match(r'^\s*'+blk_comment[0]+r'.*'+blk_comment[1],line):
# Single line block comment.
tag_comment = 1
elif re.match(r'^\s*'+blk_comment[0],line):
# Start of multi-line block comment.
tag_comment = 1
in_comment = 1
else:
tag_comment = 0
if tag_comment:
if line: line = stag+line+etag
else:
if inline_comment:
pos = string.find(line,inline_comment)
else:
pos = -1
if pos >= 0:
# Process inline comment.
line = re.sub(r'\b(?P<word>\w+)\b',sub_keyword,line[:pos]) \
+ stag + line[pos:] + etag
else:
line = re.sub(r'\b(?P<word>\w+)\b',sub_keyword,line)
sys.stdout.write(line + os.linesep)
line = sys.stdin.readline()
def usage(msg=''):
if msg:
print_stderr(msg)
print_stderr('Usage: code-filter -b backend -l language [ -t tabsize ]')
print_stderr(' [ --help | -h ] [ --version | -v ]')
def main():
global language, backend, tabsize
# Process command line options.
import getopt
opts,args = getopt.getopt(sys.argv[1:],
'b:l:ht:v',
['help','version'])
if len(args) > 0:
usage()
sys.exit(1)
for o,v in opts:
if o in ('--help','-h'):
print __doc__
sys.exit(0)
if o in ('--version','-v'):
print('code-filter version %s' % (VERSION,))
sys.exit(0)
if o == '-b': backend = v
if o == '-l':
v = string.lower(v)
if v == 'c': v = 'c++'
language = v
if o == '-t':
try:
tabsize = int(v)
except:
usage('illegal tabsize')
sys.exit(1)
if tabsize <= 0:
usage('illegal tabsize')
sys.exit(1)
if backend is None:
usage('backend option is mandatory')
sys.exit(1)
if not keywordtags.has_key(backend):
usage('illegal backend option')
sys.exit(1)
if language is None:
usage('language option is mandatory')
sys.exit(1)
if not keywords.has_key(language):
usage('illegal language option')
sys.exit(1)
# Do the work.
code_filter()
if __name__ == "__main__":
try:
main()
except (KeyboardInterrupt, SystemExit):
pass
except:
print_stderr("%s: unexpected exit status: %s" %
(os.path.basename(sys.argv[0]), sys.exc_info()[1]))
# Exit with previous sys.exit() status or zero if no sys.exit().
sys.exit(sys.exc_info()[1])

View File

@@ -0,0 +1,40 @@
Music Filter Test
=================
Details of the filter can be found in `./doc/music-filter.txt`.
A tune generated from ABC notation
----------------------------------
[music1.png]
music~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
T:The Butterfly
R:slip jig
C:Tommy Potts
H:Fiddle player Tommy Potts made this tune from two older slip jigs,
H:one of which is called "Skin the Peelers" in Roche's collection.
D:Bothy Band: 1975.
M:9/8
K:Em
vB2(E G2)(E F3)|B2(E G2)(E F)ED|vB2(E G2)(E F3)|(B2d) d2(uB A)FD:|
|:(vB2c) (e2f) g3|(uB2d) (g2e) (dBA)|(B2c) (e2f) g2(ua|b2a) (g2e) (dBA):|
|:~B3 (B2A) G2A|~B3 BA(uB d)BA|~B3 (B2A) G2(A|B2d) (g2e) (dBA):|
music~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A fragment generated from LilyPond source
------------------------------------------
["music2.png", "ly", link="music2.ly"]
music~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\version "2.6.3"
\paper {
raggedright = ##t
}
{
\time 3/4
\clef bass
c2 e4 g2. f4 e d c2 r4
}
music~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -0,0 +1,30 @@
#
# AsciiDoc music filter configuration file.
#
# Documented in music-filter.txt in AsciiDoc distribution
# ./examples/website/ directory.
#
[blockdef-music]
delimiter=^music~{4,}$
template=music-block
presubs=none
filter=music2png.py {verbose?-v} -m -f {format=abc} -o "{outdir}/{target}" -
posattrs=target,format
ifdef::basebackend-html[]
[music-block]
<div class="musicblock">
<a id="{id}"></a>
<div class="title">{title}</div>
<div class="content">
<a href="{link}">
<img style="border-width: 0;" src="{target}" alt="{target}"{width? width="{width}"}{height? height="{height}"} />
{link#}</a>
</div></div>
endif::basebackend-html[]
ifdef::basebackend-docbook[]
[music-block]
template::[image-blockmacro]
endif::basebackend-docbook[]

View File

@@ -0,0 +1,189 @@
#!/usr/bin/env python
'''
NAME
music2png - Converts textual music notation to classically notated PNG file
SYNOPSIS
music2png [options] INFILE
DESCRIPTION
This filter reads LilyPond or ABC music notation text from the input file
INFILE (or stdin if INFILE is -), converts it to classical music notation
and writes it to a trimmed PNG image file.
This script is a wrapper for LilyPond and ImageMagick commands.
OPTIONS
-f FORMAT
The INFILE music format. 'abc' for ABC notation, 'ly' for LilyPond
notation.
-o OUTFILE
The file name of the output file. If not specified the output file is
named like INFILE but with a .png file name extension.
-m
Skip if the PNG output file is newer that than the INFILE. When
INFILE is - (stdin) previously retained input is compared.
-v
Verbosely print processing information to stderr.
--help, -h
Print this documentation.
--version
Print program version number.
SEE ALSO
lilypond(1), abc2ly(1), convert(1)
AUTHOR
Written by Stuart Rackham, <srackham@methods.co.nz>
COPYING
Copyright (C) 2006 Stuart Rackham. Free use of this software is
granted under the terms of the GNU General Public License (GPL).
'''
import os, sys
VERSION = '0.1.0'
# Globals.
verbose = False
class EApp(Exception): pass # Application specific exception.
def print_stderr(line):
sys.stderr.write(line + os.linesep)
def print_verbose(line):
if verbose:
print_stderr(line)
def run(cmd):
global verbose
if not verbose:
cmd += ' 2>/dev/null'
print_verbose('executing: %s' % cmd)
if os.system(cmd):
raise EApp, 'failed command: %s' % cmd
def music2png(format, infile, outfile, modified):
'''Convert ABC notation in file infile to cropped PNG file named outfile.'''
outfile = os.path.abspath(outfile)
outdir = os.path.dirname(outfile)
if not os.path.isdir(outdir):
raise EApp, 'directory does not exist: %s' % outdir
basefile = os.path.splitext(outfile)[0]
abc = basefile + '.abc'
ly = basefile + '.ly'
temps = [ basefile + ext for ext in ('.abc', '.ly', '.ps', '.midi') ]
# Don't delete files that already exist.
temps = [ f for f in temps if not os.path.exists(f) ]
skip = False
if infile == '-':
lines = sys.stdin.readlines()
if format == 'abc':
f = abc
else:
f = ly
if modified:
if f in temps:
del temps[temps.index(f)] # Don't delete previous source.
if os.path.isfile(outfile) and os.path.isfile(f):
old = open(f, 'r').readlines()
skip = lines == old
if not skip:
open(f, 'w').writelines(lines)
else:
if not os.path.isfile(infile):
raise EApp, 'input file does not exist: %s' % infile
if modified and os.path.isfile(outfile):
skip = os.path.getmtime(infile) <= os.path.getmtime(outfile)
if skip:
print_verbose('skipped: no change: %s' % outfile)
return
saved_pwd = os.getcwd()
os.chdir(outdir)
try:
if format == 'abc':
run('abc2ly "%s"' % abc)
run('lilypond --png "%s"' % ly)
finally:
os.chdir(saved_pwd)
# Chop the bottom 75 pixels off to get rid of the page footer.
run('convert "%s" -gravity South -crop 1000x10000+0+75 "%s"' % (outfile, outfile))
# Trim all blank areas from sides, top and bottom.
run('convert "%s" -trim "%s"' % (outfile, outfile))
for f in temps:
if os.path.isfile(f):
print_verbose('deleting: %s' % f)
os.remove(f)
def usage(msg=''):
if msg:
print_stderr(msg)
print_stderr('\n'
'usage:\n'
' music2png [options] INFILE\n'
'\n'
'options:\n'
' -f FORMAT\n'
' -o OUTFILE\n'
' -m\n'
' -v\n'
' --help\n'
' --version')
def main():
# Process command line options.
global verbose
format = None
outfile = None
modified = False
import getopt
opts,args = getopt.getopt(sys.argv[1:], 'f:o:mhv', ['help','version'])
for o,v in opts:
if o in ('--help','-h'):
print __doc__
sys.exit(0)
if o =='--version':
print('music2png version %s' % (VERSION,))
sys.exit(0)
if o == '-f': format = v
if o == '-o': outfile = v
if o == '-m': modified = True
if o == '-v': verbose = True
if len(args) != 1:
usage()
sys.exit(1)
infile = args[0]
if format is None:
usage('FORMAT must be specified')
sys.exit(1)
if format not in ('abc', 'ly'):
usage('invalid FORMAT')
sys.exit(1)
if outfile is None:
if infile == '-':
usage('OUTFILE must be specified')
sys.exit(1)
outfile = os.path.splitext(infile)[0] + '.png'
# Do the work.
music2png(format, infile, outfile, modified)
# Print something to suppress asciidoc 'no output from filter' warnings.
if infile == '-':
sys.stdout.write(' ')
if __name__ == "__main__":
try:
main()
except SystemExit:
raise
except KeyboardInterrupt:
sys.exit(1)
except Exception, e:
print_stderr("%s: %s" % (os.path.basename(sys.argv[0]), str(e)))
sys.exit(1)

View File

@@ -0,0 +1,19 @@
Source Hightlight Filter Test
=============================
Details of the filter can be found in
`./doc/source-highlight-filter.txt`.
[python]
source~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
''' A multi-line
comment.'''
def sub_word(mo):
''' Single line comment.'''
word = mo.group('word') # Inline comment
if word in keywords[language]:
return quote + word + quote
else:
return word
source~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -0,0 +1,32 @@
#
# AsciiDoc source code highlight filter configuration file.
#
# Documented in source-hightlight-filter.txt in AsciiDoc distribution
# ./examples/website/ directory.
#
# Requires GNU source-highlight
# http://www.gnu.org/software/src-highlite/source-highlight.html
#
[blockdef-source-highlight]
# The old ^ delimiter is for backward compatibility, may be removed from
# in future versions.
delimiter=(^(source)?~{4,}$)|(^\^{4,}$)
template=source-highlight-block
presubs=none
filter=source-highlight -f {backend-xhtml11?xhtml}{backend-html4?html}{backend-docbook?docbook} -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}}
posattrs=language,src_numbered,src_tab
[source-highlight-block]
template::[listingblock]
# Customized listingblock block for xhtml11 to ensure valid XHTML1.1.
ifdef::backend-xhtml11[]
[source-highlight-block]
<div class="listingblock">
<a id="{id}"></a>
<div class="title">{caption=Example: }{title}</div>
<div class="content">
|
</div></div>
endif::backend-xhtml11[]

203
docs/asciidoc/help.conf Normal file
View File

@@ -0,0 +1,203 @@
# AsciiDoc help file.
#
# INI section format, each section contains a topic.
# Displayed with 'asciidoc --help sectionname' command.
#
#
# Default help topic.
#
[default]
Usage: asciidoc [OPTIONS] FILE
Man page: asciidoc -h manpage
Syntax: asciidoc -h syntax
[manpage]
NAME
asciidoc - converts an AsciiDoc text file to DocBook, HTML or LinuxDoc
SYNOPSIS
asciidoc [OPTIONS] FILE
DESCRIPTION
The asciidoc(1) command translates the AsciiDoc text file FILE to a
DocBook, HTML or LinuxDoc file. 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@ (do not
override document or configuration file attributes). Values
containing spaces should be enclosed in double-quote
characters. Multiple instances allowed.
-b, --backend=BACKEND
Backend output file format: docbook, xhtml11 or html4. Defaults
to xhtml11.
-f, --conf-file=CONF_FILE
Use configuration file CONF_FILE. Multiple instances allowed.
Configuration files processed in command-line order (after
implicit configuration files).
-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.
-h, --help[=TOPIC]
Print help TOPIC. --help topics will print a list of help
topics, --help syntax summarises 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 -a
numbered.
--unsafe
Disable safe mode. Safe mode is enabled by default, disabling
it is potentially dangerous.
-v, --verbose
Verbosely print processing information and configuration file
checks to stderr.
--version
Print program version number.
BUGS
See the AsciiDoc distribution BUGS file.
AUTHOR
Written by Stuart Rackham, <srackham@methods.co.nz>
RESOURCES
SourceForge: http://sourceforge.net/projects/asciidoc/
Main web site: http://www.methods.co.nz/asciidoc/
COPYING
Copyright (C) 2002-2007 Stuart Rackham. Free use of this software is
granted under the terms of the GNU General Public License (GPL).
[syntax]
AsciiDoc Markup Syntax Summary
==============================
A summary of the most often used markup.
For a complete reference see the 'AsciiDoc User Guide'.
Text formatting
---------------
*bold text* (boldface font)
_emphasized text_ (normally italics)
'emphasized text'
+monospaced text+ (proportional font)
`monospaced text`
Document links
--------------
[[id]] (define link target)
<<id,caption>> (link to target id)
link:filename#id[caption] (link to external HTML file)
URLs
----
http:address[caption] (link to web page)
mailto:address[caption] (link to mail recipient)
Images
------
image:filename[caption] (inline image)
image::filename[caption] (block image)
Document header
---------------
The Document Title
==================
author <email> (optional)
revision, date (optional)
Section title underlines
------------------------
Level 0 (document title): ======================
Level 1: ----------------------
Level 2: ~~~~~~~~~~~~~~~~~~~~~~
Level 3: ^^^^^^^^^^^^^^^^^^^^^^
Level 4 (bottom level): ++++++++++++++++++++++
Delimited blocks
----------------
Delimiters must begin at left margin.
-------------------
listing block
-------------------
...................
literal block
...................
*******************
sidebar block
*******************
[author, source] (optional)
___________________
quote block
___________________
===================
example block
===================
///////////////////
comment block
///////////////////
More block elements
-------------------
[attributes list] (Note 1)
.Block title (Note 1)
// Comment line (Note 1)
include::filename[] (Note 1)
Note 1: Begin at the left margin.
More inline elements
--------------------
footnote:[footnote text] (document footnote)

358
docs/asciidoc/html4.conf Normal file
View File

@@ -0,0 +1,358 @@
#
# html4.conf
#
# Asciidoc configuration file.
# html backend for generation of legacy HTML 4 markup.
#
[miscellaneous]
outfilesuffix=.html
# Screen width in pixels.
pagewidth=800
pageunits=
[attributes]
basebackend=html
basebackend-html=
[replacements]
# Line break.
(?m)^(.*)\s\+$=\1<br />
ifdef::asciidoc7compatible[]
# Superscripts.
\^(.+?)\^=<sup>\1</sup>
# Subscripts.
~(.+?)~=<sub>\1</sub>
endif::asciidoc7compatible[]
[ruler-blockmacro]
<hr />
[image-inlinemacro]
<a href="{link}">
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"}/>
{link#}</a>
[image-blockmacro]
<a name="{id}"></a>
<a href="{link}">
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"}/>
{link#}</a>
<p><b>{caption=Figure: }{title}</b></p>
[indexterm-inlinemacro]
# Inline index term.
{empty}
[indexterm2-inlinemacro]
# Inline index term.
# Single entry index term that is visible in the primary text flow.
{1}
[footnote-inlinemacro]
# Inline footnote.
<br />[{0}]<br />
[callout-inlinemacro]
# Inline callout.
<b>({index})</b>
[tags]
# Bulleted, numbered and labeled list tags.
ilist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ul>|</ul>
ilistitem=<li>|</li>
ilisttext=<p>|</p>
olist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol>|</ol>
olist2={id?<a name="{id}"></a>}<ol type="a">|</ol>
olistitem=<li>|</li>
olisttext=<p>|</p>
vlist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<dl>|</dl>
vlistentry=|
vlistterm=<dt>|</dt>
vlistitem=<dd>|</dd>
vlisttext=<p>|</p>
# Horizontal labeled list.
hlist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<table cellpadding="4">|</table>
hlistentry=<tr valign="top">|</tr>
hlisttext=|
hlistterm=<td{1? width="{1}%"}>|</td>
hlistitem=<td{2? width="{2}%"}>|</td>
# Question and Answer list.
qlist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol>|</ol>
qlistentry=<li>|</li>
qlistterm=<p><em>|</em></p>
qlistitem=|
qlisttext=<p>|</p>
# Callout list.
colist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol>|</ol>
colistitem=<li>|</li>
colisttext=<p>|</p>
# Quoted text.
emphasis=<em{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</em>
strong=<strong{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</strong>
monospaced=<tt{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</tt>
quoted={0?<span style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?">}{amp}#8220;|{amp}#8221;{0?</span>}
unquoted={0?<span style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?">}|{0?</span>}
superscript=<sup{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</sup>
subscript=<sub{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</sub>
# $$ inline passthrough.
passthrough=<span{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</span>
# Inline macros
[http-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[https-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[ftp-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[file-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[mailto-inlinemacro]
<a href="{name}:{target}">{0={target}}</a>
[callto-inlinemacro]
<a href="{name}:{target}">{0={target}}</a>
[link-inlinemacro]
<a href="{target}">{0={target}}</a>
# anchor:id[text]
[anchor-inlinemacro]
<a name="{target}"></a>
# [[id,text]]
[anchor2-inlinemacro]
<a name="{1}"></a>
# [[[id]]]
[anchor3-inlinemacro]
<a name="{1}"></a>[{1}]
# xref:id[text]
[xref-inlinemacro]
<a href="#{target}">{0=[{target}]}</a>
# <<id,text>>
[xref2-inlinemacro]
<a href="#{1}">{2=[{1}]}</a>
# Special word substitution.
[emphasizedwords]
<em>{words}</em>
[monospacedwords]
<tt>{words}</tt>
[strongwords]
<strong>{words}</strong>
# Paragraph substitution.
[paragraph]
<p>{id?<a name="{id}"></a>}{title?<b>{title}</b><br />}
|
</p>
[literalparagraph]
# The literal block employs the same markup.
template::[literalblock]
[verseparagraph]
# The verse block employs the same markup.
template::[verseblock]
[admonitionparagraph]
<a name="{id}"></a>
<p><b>{caption}:</b> |</p>
# Delimited blocks.
[passthroughblock]
|
[listingblock]
<a name="{id}"></a>
<p><b>{title}</b></p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
<pre>
|
</pre>
</td></tr></table>
[literalblock]
<a name="{id}"></a>
<p><b>{title}</b></p>
<pre>
|
</pre>
[verseblock]
<a name="{id}"></a>
<p><b>{title}</b></p>
# Font inheritance broken in IE6.
<pre style="font-family: inherit;">
|
</pre>
[sidebarblock]
<a name="{id}"></a>
<table frame="border" bgcolor="#ffffee" width="80%" cellpadding="15">
<tr><td>
<p><em>{title}</em></p>
|
</td></tr></table>
[quoteblock]
<a name="{id}"></a>
<blockquote>
<p><b>{title}</b></p>
|
<p align="right">
<em>{citetitle}</em><br />
&#8212; {attribution}
</p>
</blockquote>
[exampleblock]
<a name="{id}"></a>
<p><b>{caption=Example: }{title}</b></p>
<table frame="border" bgcolor="white" width="80%" cellpadding="15">
<tr><td>
|
</td></tr></table>
[admonitionblock]
<a name="{id}"></a>
<table frame="void" bgcolor="white" width="80%" cellpadding="8">
<tr valign="top"><td><p><b>{caption}</b></p></td><td>
<p><b>{title}</b></p>
|
</td></tr></table>
# Bibliography list.
# Same as numbered list.
[listdef-bibliography]
listtag=olist
itemtag=olistitem
texttag=olisttext
# Glossary list.
# Same as labeled list.
[listdef-glossary]
listtag=vlist
itemtag=vlistitem
texttag=vlisttext
entrytag=vlistentry
labeltag=vlistterm
# Tables.
[tabledef-default]
template=table
bodyrow=<tr>|</tr>
headdata=<th align="{colalign}" width="{colwidth}{pageunits}">|</th>
footdata=<td align="{colalign}" width="{colwidth}{pageunits}"><strong>|</strong></td>
bodydata=<td align="{colalign}" width="{colwidth}{pageunits}" valign="top">|</td>
[table]
<p><b>{caption=Table: }</b>{title}</p>
<a name="{id}"></a>
<table rules="{grid=none}"
frame="{frame%hsides}"
frame="{frame@topbot:hsides}{frame@all:border}{frame@none:void}{frame@sides:vsides}"
cellspacing="0" cellpadding="4">
{headrows#}<thead>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot>
{footrows}
{footrows#}</tfoot>
<tbody>
{bodyrows}
</tbody>
</table>
[preamble]
# Untitled elements between header and first section title.
<a name="{id}"></a>
|
[sect0]
{doctype-manpage%}<hr />
<h1>{id?<a name="{id}"></a>}{title}</h1>
|
[sect1]
{doctype-manpage%}<hr />
<h2>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h2>
|
[sect2]
<h3>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h3>
|
[sect3]
<h4>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h4>
|
[sect4]
<h5>{id?<a name="{id}"></a>}{title}</h5>
|
[footer]
<p></p>
<p></p>
<hr /><p><small>
Version {revision}<br />
Last updated {localdate} {localtime}
</small></p>
</body>
</html>
#-------------------------
# article document type
#-------------------------
ifndef::doctype-manpage[]
[header]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={encoding=ISO-8859-1}">
<meta name="generator" content="AsciiDoc {asciidoc-version}">
<title>{doctitle}</title>
</head>
<body>
<h1>{doctitle}</h1>
<p>
<strong>{author}</strong><br />
<tt>&lt;<a href="mailto:{email}">{email}</a>&gt;</tt><br />
version {revision}{date?,}
{date}
</p>
endif::doctype-manpage[]
#-------------------------
# manpage document type
#-------------------------
ifdef::doctype-manpage[]
[tags]
# This is more inline with man page convention.
emphasis=<b>|</b>
vlistterm=<dt><b>|</b></dt>
[header]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={encoding=ISO-8859-1}">
<meta name="generator" content="AsciiDoc {asciidoc-version}">
<title>{mantitle}</title>
</head>
<body>
<hr />
<h1>
{doctitle} Manual Page
</h1>
<hr />
<h2>NAME</h2>
<p>{manname} -
{manpurpose}
</p>
[sect-synopsis]
template::[sect1]
endif::doctype-manpage[]

View File

@@ -0,0 +1,5 @@
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.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

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

View File

@@ -0,0 +1,67 @@
/* Author: Mihai Bazon, September 2002
* http://students.infoiasi.ro/~mishoo
*
* Table Of Content generator
* Version: 0.4
*
* Feel free to use this script under the terms of the GNU General Public
* License, as long as you do not remove or alter this notice.
*/
/* modified by Troy D. Hanson, September 2006. License: GPL */
/* modified by Stuart Rackham, October 2006. License: GPL */
function getText(el) {
var text = "";
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
text += i.data;
else if (i.firstChild != null)
text += getText(i);
}
return text;
}
function TocEntry(el, text, toclevel) {
this.element = el;
this.text = text;
this.toclevel = toclevel;
}
function tocEntries(el, toclevels) {
var result = new Array;
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
var iterate = function (el) {
for (var i = el.firstChild; i != null; i = i.nextSibling) {
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
var mo = re.exec(i.tagName)
if (mo)
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
iterate(i);
}
}
}
iterate(el);
return result;
}
// This function does the work. toclevels = 1..4.
function generateToc(toclevels) {
var toc = document.getElementById("toc");
var entries = tocEntries(document.getElementsByTagName("body")[0], toclevels);
for (var i = 0; i < entries.length; ++i) {
var entry = entries[i];
if (entry.element.id == "")
entry.element.id = "toc" + i;
var a = document.createElement("a");
a.href = "#" + entry.element.id;
a.appendChild(document.createTextNode(entry.text));
var div = document.createElement("div");
div.appendChild(a);
div.className = "toclevel" + entry.toclevel;
toc.appendChild(div);
}
}

663
docs/asciidoc/latex.conf Normal file
View File

@@ -0,0 +1,663 @@
#
# latex.conf
#
# Asciidoc configuration file.
# latex backend, generates LaTeX conformant markup.
#
[titles]
subs=quotes,replacements,attributes,macros,specialcharacters,replacements2
# The listing block uses a LaTeX verbatim environment where special characters don't need to be escaped.
# Hence only "callouts" substitution should be applied.
[blockdef-listing]
subs=callouts
[attributes]
basebackend=latex
basebackend-latex=
latex-table-rowlimit=20
latex-use-bibliography-environment!
latex-indent-paragraphs!
latex-recognize-escaped-unicode!
latex-use-custom-list-items!
latex-use-colored-tables!
latex-use-running-title-headings!
latex-use-colored-sidebar-blocks!
[miscellaneous]
subsnormal=quotes,specialwords,replacements,attributes,macros,passthroughs,specialcharacters,replacements2
subsverbatim=callouts,specialcharacters
outfilesuffix=.tex
# Screen width in pixels.
pagewidth=418
pageunits=pt
[specialcharacters]
{=\{{}
}=\}{}
\\=\textbackslash{}
$=\${}
<=\textless{}
>=\textgreater{}
&=\&{}
_=\_{}
%=\%{}
\#=\#{}
^=\textasciicircum{}
~=\textasciitilde{}
|=\textbar{}
"=\textquotedbl{}
[macros]
# I needed to rewrite some regular expressions because '<' and '>' have not been escaped to '&lt;' and '&gt;'
# Callout
[\\]?<(?P<index>\d+)>=callout
# Link: <<id,text>>
(?su)[\\]?<<(?P<attrlist>[\w"].*?)>>=xref2
[replacements]
# Line break.
(?m)^(.*)\s\+$=\1 !..backslash..!newline!..braceleft..!!..braceright..!
# -- Spaced em dashes (entity reference &mdash;)
(^|[^-\\])--($|[^-])=\1--\2
# (C) Copyright (entity reference &copy;)
(?<!\\)\(C\)=!..backslash..!textcopyright!..braceleft..!!..braceright..!
\\\(C\)=(C)
# (R) registered trade mark (entity reference &reg;
(?<!\\)\(R\)=!..backslash..!textregistered!..braceleft..!!..braceright..!
\\\(R\)=(R)
# (TM) Trademark (entity reference &trade;)
(?<!\\)\(TM\)=!..backslash..!texttrademark!..braceleft..!!..braceright..!
\\\(TM\)=(TM)
# ... Ellipsis (entity reference &hellip;)
(?<!\\)\.\.\.=!..backslash..!dots!..braceleft..!!..braceright..!
\\\.\.\.=...
# Recognize escaped unicode characters
ifdef::latex-recognize-escaped-unicode[]
\{amp\}#([0-9]*);=!..backslash..!unichar!..braceleft..!\1!..braceright..!
\{amp\}#x([0123456789abcdefABCDEF]*);=!..backslash..!unichar!..braceleft..!{eval:0x\1}!..braceright..!
endif::latex-recognize-escaped-unicode[]
# -> right arrow
->=!..backslash..!textrightarrow!..braceleft..!!..braceright..!
# => right double arrow (have to enter math mode)
=>=!..dollar..!!..backslash..!Rightarrow!..braceleft..!!..braceright..!!..dollar..!
# <- left arrow
<-=!..backslash..!textleftarrow!..braceleft..!!..braceright..!
# <= left double arrow (have to enter math mode)
<\==!..dollar..!!..backslash..!Leftarrow!..braceleft..!!..braceright..!!..dollar..!
# --> long right arrow (have to enter math mode)
-->=!..backslash..!textrightarrow!..braceleft..!!..braceright..!
# ==> long right double arrow (have to enter math mode)
=\=>=!..dollar..!!..backslash..!Rightarrow!..braceleft..!!..braceright..!!..dollar..!
# <-- long left arrow (have to enter math mode)
<--=!..backslash..!textleftarrow!..braceleft..!!..braceright..!
# <== long left double arrow (have to enter math mode)
<\=\==!..dollar..!!..backslash..!Leftarrow!..braceleft..!!..braceright..!!..dollar..!
[replacements2]
!..braceleft..!={
!..braceright..!=}
!..backslash..!=\\
!..dollar..!=$
!..lessthan..!=<
!..greaterthan..!=>
!..amp..!=&
!..underline..!=_
!..percent..!=%
!..sharp..!=#
!..circum..!=^
!..tilde..!=~
!..bar..!=|
!..doublequote..!="
# Ruler is interpreted as a page break.
[ruler-blockmacro]
\clearpage
[image-inlinemacro]
!..backslash..!href!..braceleft..!{link}!..braceright..!!..braceleft..!!..percent..!
!..backslash..!includegraphics[{scale?scale={scale},}{width?width={width}pt,}{height? height={height}pt}]!..braceleft..!{target}!..braceright..!
{link#}!..braceright..!
[image-blockmacro]
\begin\{figure\}
\hypertarget\{{id}\}\{\}
\caption\{{title}\}
\href\{{link}\}\{%
\includegraphics[{scale?scale={scale},}{width?width={width}pt,}{height? height={height}pt}]\{{target}\}%
\label\{{id}\}
{link#}\}
\end\{figure\}
[indexterm-inlinemacro]
# Inline index term.
!..backslash..!index!..braceleft..!{1}{2?!{2}}{3?!{3}}!..braceright..!
[indexterm2-inlinemacro]
# Inline index term.
# Single entry index term that is visible in the primary text flow.
!..backslash..!index!..braceleft..!{1}!..braceright..!{1}
[footnote-inlinemacro]
# Inline footnote.
!..backslash..!footnote!..braceleft..!{0}!..braceright..!
[callout-inlinemacro]
# Inline callout.
<{index}>
[listdef-numbered2]
listtag=olist2
itemtag=olist2item
texttag=olist2text
[listdef-bulleted2]
listtag=ilist2
itemtag=ilist2item
texttag=ilist2text
[tags]
# Bulleted, numbered and labeled list tags.
ifdef::latex-use-custom-list-items[]
ilistitem=\item[\textendash] |
ilist2item=\item[\textbullet] |
olist={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{enumerate\}[1)]|\end\{enumerate\}
olist2={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{enumerate\}[a)]|\end\{enumerate\}
endif::latex-use-custom-list-items[]
ifndef::latex-use-custom-list-items[]
ilistitem=\item%|
ilist2item=\item%|
olist={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{enumerate\}|\end\{enumerate\}
olist2={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{enumerate\}|\end\{enumerate\}
endif::latex-use-custom-list-items[]
ilist={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{itemize\}|\end\{itemize\}
ilisttext=|
ilist2={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{itemize\}|\end\{itemize\}
ilist2text=|
olistitem=\item%|
olisttext=|
olist2item=\item%|
olist2text=|
vlist={title?\minisec\{{title}\}} \par{id?\label\{{id}\}\hypertarget\{{id}\}\{\}} |
vlistentry=|
vlistterm=\noindent\textbf\{%|\}
vlistitem=\begin\{quote\}|\end\{quote\}
vlisttext=|
# Horizontal labeled list.
hlist={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{description\}|\end\{description\}
hlistentry=|
hlistterm=\item[%|]
hlistitem=|
hlisttext=|
# Question and Answer list.
qlist={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{enumerate\}|\end\{enumerate\}
qlistentry=\item%|
qlistterm=|
qlistitem=\begin\{quotation\}|\end\{quotation\}
qlisttext=|
# Callout list.
colist={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{enumerate\}|\end\{enumerate\}
colistitem=\item%|
colisttext=|
# Bibliography list.
ifdef::latex-use-bibliography-environment[]
biblist=|
endif::latex-use-bibliography-environment[]
ifndef::latex-use-bibliography-environment[]
biblist={title?\minisec\{{title}\}} {id?\label\{{id}\}\hypertarget\{{id}\}\{\}} \begin\{description\} | \end\{description\}
endif::latex-use-bibliography-environment[]
biblistitem=|
biblisttext=|
superscript=!..backslash..!textsuperscript!..braceleft..!|!..braceright..!
subscript=!..backslash..!textsubscript!..braceleft..!|!..braceright..!
# Quoted text.
emphasis=!..backslash..!emph!..braceleft..!|!..braceright..!
strong=!..backslash..!textbf!..braceleft..!|!..braceright..!
monospaced=!..backslash..!texttt!..braceleft..!|!..braceright..!
quoted=!..backslash..!{language!textquotedblleft}{language?{language@.german:glqq}}{language?{language@english:textquotedblleft}}!..braceleft..!!..braceright..!|!..backslash..!{language?{language@.german:grqq}}{language?{language@english:textquotedblright}}{language!textquotedblright}!..braceleft..!!..braceright..!
unquoted=|
# $$ inline passthrough.
$$passthrough=|
# Inline macros
[http-inlinemacro]
!..backslash..!href!..braceleft..!{name}:{target}!..braceright..!!..braceleft..!{0={name}:{target}}!..braceright..!
[https-inlinemacro]
!..backslash..!href!..braceleft..!{name}:{target}!..braceright..!!..braceleft..!{0={name}:{target}}!..braceright..!
[ftp-inlinemacro]
!..backslash..!href!..braceleft..!{name}:{target}!..braceright..!!..braceleft..!{0={name}:{target}}!..braceright..!
[file-inlinemacro]
!..backslash..!href!..braceleft..!{name}:{target}!..braceright..!!..braceleft..!{0={name}:{target}}!..braceright..!
[mailto-inlinemacro]
!..backslash..!href!..braceleft..!{name}:{target}!..braceright..!!..braceleft..!{0={target}}!..braceright..!
[callto-inlinemacro]
!..backslash..!href!..braceleft..!{name}:{target}!..braceright..!!..braceleft..!{0={target}}!..braceright..!
[link-inlinemacro]
!..backslash..!href!..braceleft..!{target}!..braceright..!!..braceleft..!{0={target}}!..braceright..!
# anchor:id[text]
[anchor-inlinemacro]
!..backslash..!label!..braceleft..!{target}!..braceright..!!..backslash..!hypertarget!..braceleft..!{target}!..braceright..!!..braceleft..!{0={target}}!..braceright..!
# [[id,text]]
[anchor2-inlinemacro]
!..backslash..!label!..braceleft..!{1}!..braceright..!!..backslash..!hypertarget!..braceleft..!{1}!..braceright..!!..braceleft..!{2={1}}!..braceright..!
# [[[id]]]
[anchor3-inlinemacro]
{latex-use-bibliography-environment?!..backslash..!bibitem!..braceleft..!{1}!..braceright..!} {latex-use-bibliography-environment!!..backslash..!item[{1}]} !..backslash..!label!..braceleft..!{1}!..braceright..!!..backslash..!hypertarget!..braceleft..!{1}!..braceright..!!..braceleft..!!..braceright..!
# xref:id[text]
[xref-inlinemacro]
{style#}{style$page:!..backslash..!pageref!..braceleft..!{target}!..braceright..!}
{style#}{style$autoref:!..backslash..!autoref!..braceleft..!{target}!..braceright..!}
{style#}{style$ref:!..backslash..!ref!..braceleft..!{target}!..braceright..!}
{style#}{latex-use-bibliography-environment#}{style$cite:!..backslash..!cite!..braceleft..!{target}!..braceright..!}
{style#}{latex-use-bibliography-environment%}{style$cite:!..backslash..!hyperlink!..braceleft..!{target}!..braceright..!!..braceleft..!{0=[{target}]}!..braceright..!}
{style%}!..backslash..!hyperlink!..braceleft..!{target}!..braceright..!!..braceleft..!{0=[{target}]}!..braceright..!
# <<id,text>>
[xref2-inlinemacro]
{3#}{3$page:!..backslash..!pageref!..braceleft..!{1}!..braceright..!}
{3#}{3$autoref:!..backslash..!autoref!..braceleft..!{1}!..braceright..!}
{3#}{3$ref:!..backslash..!ref!..braceleft..!{1}!..braceright..!}
{3#}{latex-use-bibliography-environment#}{3$cite:!..backslash..!cite!..braceleft..!{1}!..braceright..!}
{3#}{latex-use-bibliography-environment%}{3$cite:!..backslash..!hyperlink!..braceleft..!{1}!..braceright..!!..braceleft..!{2=[{1}]}!..braceright..!}
{3%}!..backslash..!hyperlink!..braceleft..!{1}!..braceright..!!..braceleft..!{2=[{1}]}!..braceright..!
# Special word substitution.
[emphasizedwords]
!..backslash..!emph!..braceleft..!{words}!..braceright..!
[monospacedwords]
!..backslash..!texttt!..braceleft..!{words}!..braceright..!
[strongwords]
!..backslash..!textbf!..braceleft..!{words}!..braceright..!
# Paragraph substitution.
[paragraph]
{title%} \par{latex-indent-paragraphs!\noindent}
{title#} \paragraph\{{title}\}
\label\{{id}\}\hypertarget\{{id}\}\{\}
|
[literalparagraph]
# The literal block employs the same markup.
template::[literalblock]
[verseparagraph]
# The verse block employs the same markup.
template::[verseblock]
[admonitionparagraph]
# The admonition block employs the same markup.
template::[admonitionblock]
# Delimited blocks.
[passthroughblock]
|
[listingblock]
\minisec\{{caption=Listing: }{title}\}
\label\{{id}\}\hypertarget\{{id}\}\{\}
\begin\{lstlisting\}[{title?name={title}}]
|
\end\{lstlisting\}
[literalblock]
\minisec\{{title}\}
\label\{{id}\}\hypertarget\{{id}\}\{\}
\begin\{alltt\}
|
\end\{alltt\}
[verseblock]
\minisec\{{title}\}
\label\{{id}\}\hypertarget\{{id}\}\{\}
\begin\{alltt\}
\normalfont\{\}
|
\end\{alltt\}
[sidebarblock]
\label\{{id}\}\hypertarget\{{id}\}\{\}
\par\noindent
ifndef::latex-use-colored-sidebar-blocks[]
\setlength\{\tabcolsep\}\{0pt\}
\rowcolors\{1\}\{\}\{\}
\begin\{tabular\}\{l>\{\columncolor[gray]\{.75\}\}rcl\}
\hspace*\{0pt\} &
\hspace*\{8pt\} &
\hspace*\{16pt\} &
\begin\{minipage\}\{4in\}
endif::latex-use-colored-sidebar-blocks[]
ifdef::latex-use-colored-sidebar-blocks[]
\fcolorbox\{SidebarBorderColor\}\{SidebarBackgroundColor\}\{\parbox\{\textwidth\}\{
endif::latex-use-colored-sidebar-blocks[]
\minisec\{{title}\}
|
ifdef::latex-use-colored-sidebar-blocks[]
\}
\}
endif::latex-use-colored-sidebar-blocks[]
ifndef::latex-use-colored-sidebar-blocks[]
\end\{minipage\}
\end\{tabular\}
endif::latex-use-colored-sidebar-blocks[]
\bigskip
[quoteblock]
\minisec\{{title}\}
\label\{{id}\}\hypertarget\{{id}\}\{\}
\begin\{quote\}
|
\end\{quote\}
\begin\{flushright\}
{citetitle} \\
-- {attribution}
\end\{flushright\}
[exampleblock]
\minisec\{{caption=Example: }{title}\}
\label\{{id}\}\hypertarget\{{id}\}\{\}
\begin\{quotation\}
|
\end\{quotation\}
[admonitionblock]
\begin\{addmargin*\}[0em]\{0em\}
\label\{{id}\}\hypertarget\{{id}\}\{\}
\begin\{minipage\}\{\linewidth\}
{icons#} \includegraphics\{{icon={iconsdir}/{name}.png}\}
{icons%} \minisec\{{caption}\}
\\
\rule\{\linewidth\}\{2pt\}
\par\{\}\noindent\{\}|\par\{\}\noindent\{\}%
\rule[.25\baselineskip]\{\linewidth\}\{2pt\}
\end\{minipage\}
\end\{addmargin*\}
# Bibliography list.
# Same as numbered list.
[listdef-bibliography]
listtag=biblist
itemtag=biblistitem
texttag=biblisttext
# Glossary list.
# Same as labeled list.
[listdef-glossary]
listtag=vlist
itemtag=vlistitem
texttag=vlisttext
entrytag=vlistentry
labeltag=vlistterm
# Tables.
[tabledef-default]
template=table
colspec=>\{{colalign@left:\\raggedright}{colalign@center:\\centering}{colalign@right:\\raggedleft}\}p\{ {colwidth}pt \}
bodyrow=%| \tabularnewline
headdata=\{\bfseries\{\}%|\} {colnumber@{cols}::&}
footdata=\{\bfseries\{\}%|\} {colnumber@{cols}::&}
bodydata=%| {colnumber@{cols}:%:&}
[table]
ifdef::latex-use-colored-tables[]
\rowcolors\{1\}\{TableEvenColor\}\{TableOddColor\}
\setlength\arrayrulewidth\{1.5pt\}
\arrayrulecolor\{TableBorderColor\}
endif::latex-use-colored-tables[]
{eval:{rows}{gt}{latex-table-rowlimit}} \begin\{longtable\}\{
{eval:{rows}{gt}{latex-table-rowlimit}} {frame$all|sides:|}
{eval:{rows}{gt}{latex-table-rowlimit}} {colspecs}
{eval:{rows}{gt}{latex-table-rowlimit}} {frame$all|sides:|}
{eval:{rows}{gt}{latex-table-rowlimit}} \}
{eval:{rows}{gt}{latex-table-rowlimit}} \hypertarget\{{id}\}\{\}
{eval:{rows}{gt}{latex-table-rowlimit}} \caption\{{title}\}
{eval:{rows}{gt}{latex-table-rowlimit}} {frame$all|topbot:\hline}
{eval:{rows}{gt}{latex-table-rowlimit}} {headrows}
{eval:{rows}{gt}{latex-table-rowlimit}} {headrows#} \endhead
{eval:{rows}{gt}{latex-table-rowlimit}} {footrows}
{eval:{rows}{gt}{latex-table-rowlimit}} {footrows#} \endlastfoot
{eval:{rows}{gt}{latex-table-rowlimit}}
{eval:{rows}{gt}{latex-table-rowlimit}} {bodyrows}
{eval:{rows}{gt}{latex-table-rowlimit}} {frame$all|topbot:\hline}
{eval:{rows}{gt}{latex-table-rowlimit}} \label\{{id}\}
{eval:{rows}{gt}{latex-table-rowlimit}} \end\{longtable\}
{eval:{rows}{lt}={latex-table-rowlimit}} {title%} \par{latex-indent-paragraphs!\noindent}
{eval:{rows}{lt}={latex-table-rowlimit}} {title#} \begin\{table\}
{eval:{rows}{lt}={latex-table-rowlimit}} {title#} \begin\{center\}
{eval:{rows}{lt}={latex-table-rowlimit}} \hypertarget\{{id}\}\{\}
{eval:{rows}{lt}={latex-table-rowlimit}} \caption\{{title}\}
{eval:{rows}{lt}={latex-table-rowlimit}} \begin\{tabular\}\{
{eval:{rows}{lt}={latex-table-rowlimit}} {frame$all|sides:|}
{eval:{rows}{lt}={latex-table-rowlimit}} {colspecs}
{eval:{rows}{lt}={latex-table-rowlimit}} {frame$all|sides:|}
{eval:{rows}{lt}={latex-table-rowlimit}} \}
{eval:{rows}{lt}={latex-table-rowlimit}} {frame$all|topbot:\hline}
{eval:{rows}{lt}={latex-table-rowlimit}} {headrows}
{eval:{rows}{lt}={latex-table-rowlimit}} {bodyrows}
{eval:{rows}{lt}={latex-table-rowlimit}} {footrows}
{eval:{rows}{lt}={latex-table-rowlimit}} {frame$all|topbot:\hline}
{eval:{rows}{lt}={latex-table-rowlimit}} \end\{tabular\}
{eval:{rows}{lt}={latex-table-rowlimit}} {title#} \end\{center\}
{eval:{rows}{lt}={latex-table-rowlimit}} \label\{{id}\}
{eval:{rows}{lt}={latex-table-rowlimit}} {title#} \end\{table\}
[specialsections]
ifdef::doctype-article[]
^Abstract$=sect-abstract
endif::doctype-article[]
ifdef::doctype-book[]
^Dedication$=sect-dedication
endif::doctype-book[]
^Index$=sect-index
ifdef::latex-use-bibliography-environment[]
^(Bibliography|References)$=sect-bibliography
endif::latex-use-bibliography-environment[]
^Appendix.*$=sect-appendix
^(TOC|Contents)$=sect-toc
^Figures$=sect-list-of-figures
# Special sections.
[sect-list-of-figures]
\listoffigures
[sect-toc]
\label\{{id}\}\hypertarget\{{id}\}\{\}
\tableofcontents
[sect-index]
\setindexpreamble\{
|
\}
\label\{{id}\}\hypertarget\{{id}\}\{\}
\printindex
ifdef::latex-use-bibliography-environment[]
[sect-bibliography]
\label\{{id}\}\hypertarget\{{id}\}\{\}
\begin\{thebibliography\}\{99\}
|
\end\{thebibliography\}
endif::latex-use-bibliography-environment[]
[sect-appendix]
\appendix
\label\{{id}\}\hypertarget\{{id}\}\{\}
|
[sect-abstract]
\label\{{id}\}\hypertarget\{{id}\}\{\}
\begin\{abstract\}
|
\end\{abstract\}
[sect-dedication]
\label\{{id}\}\hypertarget\{{id}\}\{\}
\dedication\{
|
\}
[preamble]
# Untitled elements between header and first section title.
ifdef::doctype-book[]
\frontmatter
\chapter*\{Preface\}
\label\{preamble\}\hypertarget\{preamble\}\{\}
endif::doctype-book[]
|
ifdef::doctype-book[]
\mainmatter
endif::doctype-book[]
# Document sections.
[sect0]
\hypertarget\{{id}\}\{\}
\chapter\{{title}\}
\label\{{id}\}
|
[sect1]
\hypertarget\{{id}\}\{\}
\section\{{title}\}
\label\{{id}\}
[sect2]
\hypertarget\{{id}\}\{\}
\subsection\{{title}\}
\label\{{id}\}
|
[sect3]
\hypertarget\{{id}\}\{\}
\subsubsection\{{title}\}
\label\{{id}\}
|
[sect4]
\hypertarget\{{id}\}\{\}
\minisec\{{title}\}
\label\{{id}\}
|
[header]
{encoding$UTF-8:}% coding: utf-8
\documentclass [a4paper,abstracton,titlepage]\{{doctype@article:scrartcl:scrbook}\}
\pagestyle\{{latex-use-running-title-headings?headings}{latex-use-running-title-headings!plain}\}
\usepackage\{makeidx\}
\usepackage[table]\{xcolor\}
\definecolor\{LinkColor\}\{RGB\}\{85,107,47\}
\definecolor\{TableEvenColor\}\{RGB\}\{238,255,204\}
\definecolor\{TableOddColor\}\{RGB\}\{238,255,255\}
\definecolor\{TableBorderColor\}\{RGB\}\{140,172,187\}
\definecolor\{ListingBorderColor\}\{gray\}\{0.55\}
\definecolor\{ListingBackgroundColor\}\{gray\}\{0.95\}
\definecolor\{SidebarBorderColor\}\{gray\}\{0.95\}
\definecolor\{SidebarBackgroundColor\}\{RGB\}\{255,255,238\}
\usepackage\{type1ec\}
\usepackage[{language=english}]\{babel\}
\usepackage[
pdftex,
pdftitle=\{{doctitle}\},
pdfauthor=\{{author}\},
backref,
pagebackref,
breaklinks=true,
unicode
]
\{hyperref\}
\usepackage\{enumerate\}
\usepackage\{graphicx\}
\usepackage\{longtable\}
\usepackage[T1]\{fontenc\}
\usepackage\{ucs\}
\usepackage[{encoding@ISO-8859-1:latin1}{encoding@UTF-8:utf8x}{encoding!utf8x}]\{inputenc\}
\usepackage\{textcomp\}
\usepackage\{alltt\}
\usepackage\{listings\}
\lstset\{basicstyle=\footnotesize\ttfamily,showstringspaces=false,breaklines,frame=single, rulecolor=\color\{ListingBorderColor\}, backgroundcolor=\color\{ListingBackgroundColor\}, xleftmargin=0cm, linewidth=0.95\textwidth\}
{latex-indent-paragraphs%} \setlength\{\parskip\}\{1ex plus 0.5ex minus 0.2ex\}
\makeatletter
\DeclareRobustCommand*\textsubscript[1]\{%
\@textsubscript\{\selectfont#1\}\}
\def\@textsubscript#1\{%
\{\m@th\ensuremath\{_\{\mbox\{\fontsize\sf@size\z@#1\}\}\}\}\}
\makeatother
\subject\{{subject}\}
\title\{{doctitle}\}
\author\{{author}{email?, \href\{mailto:{email}\}\{{email}\}}\}
\date\{{date}\}
\publishers\{\begin\{tabular\}\{ll\} {revision?\textbf\{Revision:\} & {revision} \\ } {keywords?\textbf\{Keywords:\} & {keywords} \\ } \end\{tabular\}\}
\makeindex
\begin\{document\}
\label\{header\}\hypertarget\{header\}\{\}
{doctitle#\maketitle}
[footer]
\label\{footer\}\hypertarget\{footer\}\{\}
\end\{document\}

285
docs/asciidoc/linuxdoc.conf Normal file
View File

@@ -0,0 +1,285 @@
# linuxdoc.conf
#
# Asciidoc configuration file.
# linuxdoc backend, article document type.
#
# NOTE:
# - The Linuxdoc format only supports article documents.
# - Linuxdoc does not support a number of AsciiDoc elements, for
# example table.
# - The AsciiDoc linuxdoc backend is no longer being actively
# developed or tested with new AsciiDoc releases.
#
[attributes]
basebackend=linuxdoc
basebackend-linuxdoc=
[miscellaneous]
outfilesuffix=.sgml
[replacements]
(?m)^(.*)\s\+$=\1<newline>
# To allow the AsciiDoc User Guide to be processed.
{amp}\#960;=pi
# Small 'NEW' image.
(?<!\\)#NEW#=New!
\\#NEW#=#NEW#
# (C) Copyright (entity reference &copy;)
(?<!\\)\(C\)=&#169;
\\\(C\)=(C)
# (R) registered trade mark (entity reference &reg;
(?<!\\)\(R\)=&reg;
\\\(R\)=(R)
# (TM) Trademark (entity reference &trade;)
(?<!\\)\(TM\)=&trade;
\\\(TM\)=(TM)
# -- Spaced and unspaced em dashes (entity reference &mdash;)
(^|[^-\\])--($|[^-])=\1&mdash;\2
\\--(?!-)=--
# ... Ellipsis (entity reference &hellip;)
(?<!\\)\.\.\.=&hellip;
\\\.\.\.=...
[header]
<!doctype linuxdoc system>
<article>
<title>{doctitle}</title>
<author>
by {author}
<tt>&lt;<url url="mailto:{email}" name="{email}">&gt;</tt>
</author>
{date#}<date>
{date#} v{revision}{date?,}
{date#} {date}
{date#}</date>
[footer]
</article>
[indexterm-inlinemacro]
# Inline index term.
{2%}<nidx>{1}</nidx>
{2#}{3%}<nidx>{2}</nidx>
<nidx>{3}</nidx>
[indexterm2-inlinemacro]
# Inline index term.
# Single entry index term that is visible in the primary text flow.
<nidx>{1}</nidx>
{1}
[footnote-inlinemacro]
# Inline footnote.
<newline>[{0}]<newline>
[tags]
# Bulleted, numbered and labeled list tags.
ilist={title?<p><bf>{title}</bf>}<itemize>|</itemize>
ilistitem=<item>|</item>
ilisttext=|
olist={title?<p><bf>{title}</bf>}<enum>|</enum>
olist2=<enum>|</enum>
olistitem=<item>|</item>
olisttext=|
vlist={title?<p><bf>{title}</bf>}<descrip>|</descrip>
vlistitem=|
vlisttext=|
vlistentry=|
vlistterm=<tag>|</tag>
# Same as vertical labeled list.
hlist={title?<p><bf>{title}</bf>}<descrip>|</descrip>
hlistitem=|
hlisttext=|
hlistentry=|
hlistterm=<tag>|</tag>
# Question and Answer list.
qlist=<enum>|</enum>
qlistentry=<item>|</item>
qlistterm=|
qlistitem=|
qlisttext=<p>|
# Callout list (same as numbered list).
colist={title?<p><bf>{title}</bf>}<enum>|</enum>
colistitem=<item>|</item>
colisttext=|
# Quoted text
emphasis=<em>|</em>
strong=<bf>|</bf>
monospaced=<tt>|</tt>
quoted=``|''
[specialsections]
^Abstract$=sect-abstract
[sect-abstract]
<abstract>
|
</abstract>
<toc>
[preamble]
<abstract>
|
</abstract>
<toc>
[sect1]
<sect>{title}
<p>
|
[sect2]
<sect1>{title}
<p>
|
[sect3]
<sect2>{title}
<p>
|
[sect4]
<p><bf>{title}</bf>
<p>
|
# Inline macros
[http-inlinemacro]
<url url="{name}:{target}" name="{0={name}:{target}}">
[https-inlinemacro]
<url url="{name}:{target}" name="{0={name}:{target}}">
[ftp-inlinemacro]
<url url="{name}:{target}" name="{0={name}:{target}}">
[file-inlinemacro]
<url url="{name}:{target}" name="{0={name}:{target}}">
[mailto-inlinemacro]
<url url="{name}:{target}" name="{0={target}}">
[link-inlinemacro]
<url url="{target}" name="{0={target}}">
# LinuxDoc does not have anchors or anchor reference elements but we include
# the macros so the anchor is hidden and the reference text displayed.
# Anchor: [[id,xreflabel]]
[anchor-inlinemacro]
#&lsqb;{target}&rsqb;
[anchor2-inlinemacro]
# [[id,text]]
#&lsqb;{1}&rsqb;
[xref-inlinemacro]
#{1} &lsqb;{target}&rsqb;
{1={target}}
[xref2-inlinemacro]
# <<id,text>>
#{2} &lsqb;{1}&rsqb;
{2=1}
# Special word macros
[emphasizedwords]
<em>{words}</em>
[monospacedwords]
<tt>{words}</tt>
[strongwords]
<bf>{words}</bf>
# Paragraph substitution.
[paragraph]
<p><bf>{title}</bf><newline>
|
{empty}
{empty}
[literalparagraph]
<p><bf>Example:</bf> {title}
<verb>|</verb>
{empty}
[admonitionparagraph]
<p><bf>{style}:</bf> |
{empty}
{empty}
[verseparagraph]
template::[paragraph]
[image-inlinemacro]
{1={target}}
[ruler-blockmacro]
# Only applies to HTML so don't output anything.
[image-blockmacro]
<p><bf>Figure:</bf> {title}
<p>{1}
{1%}<p>Image file: {target}
[literalblock]
<p><bf>Example:</bf> {title}
<verb>
|
</verb>
{empty}
[listingblock]
<p><bf>Example:</bf> {title}
<tscreen><verb>
|
</verb></tscreen>
{empty}
[sidebarblock]
<p><bf>{title}</bf>
|
{empty}
{empty}
[exampleblock]
<p><bf>{title}</bf>
|
{empty}
{empty}
[admonitionblock]
<p><bf>{style}</bf>
|
{empty}
{empty}
[passthroughblock]
|
[quoteblock]
<p><bf>{title}</bf>
|
<p>
&mdash; {1={attribution}}
<em>{2={citetitle}}</em>
{empty}
[verseblock]
|
{empty}
{empty}
# Bibliography list.
# Same as numbered list.
[listdef-bibliography]
listtag=olist
itemtag=olistitem
texttag=olisttext
# Glossary list.
# Same as variable list.
[listdef-glossary]
listtag=vlist
itemtag=vlistitem
texttag=vlisttext
entrytag=vlistentry
labeltag=vlistterm

View File

@@ -0,0 +1,271 @@
/*
CSS stylesheet for XHTML produced by DocBook XSL stylesheets.
Tested with XSL stylesheets 1.61.2, 1.67.2
*/
span.strong {
font-weight: bold;
}
body blockquote {
margin-top: .75em;
line-height: 1.5;
margin-bottom: .75em;
}
html body {
margin: 1em 5% 1em 5%;
line-height: 1.2;
}
body div {
margin: 0;
}
h1, h2, h3, h4, h5, h6,
div.toc p b,
div.list-of-figures p b,
div.list-of-tables p b,
div.abstract p.title
{
color: #527bbd;
font-family: tahoma, verdana, sans-serif;
}
div.toc p:first-child,
div.list-of-figures p:first-child,
div.list-of-tables p:first-child,
div.example p.title
{
margin-bottom: 0.2em;
}
body h1 {
margin: .0em 0 0 -4%;
line-height: 1.3;
border-bottom: 2px solid silver;
}
body h2 {
margin: 0.5em 0 0 -4%;
line-height: 1.3;
border-bottom: 2px solid silver;
}
body h3 {
margin: .8em 0 0 -3%;
line-height: 1.3;
}
body h4 {
margin: .8em 0 0 -3%;
line-height: 1.3;
}
body h5 {
margin: .8em 0 0 -2%;
line-height: 1.3;
}
body h6 {
margin: .8em 0 0 -1%;
line-height: 1.3;
}
body hr {
border: none; /* Broken on IE6 */
}
div.footnotes hr {
border: 1px solid silver;
}
div.navheader th, div.navheader td, div.navfooter td {
font-family: sans-serif;
font-size: 0.9em;
font-weight: bold;
color: #527bbd;
}
div.navheader img, div.navfooter img {
border-style: none;
}
div.navheader a, div.navfooter a {
font-weight: normal;
}
div.navfooter hr {
border: 1px solid silver;
}
body td {
line-height: 1.2
}
body th {
line-height: 1.2;
}
ol {
line-height: 1.2;
}
ul, body dir, body menu {
line-height: 1.2;
}
html {
margin: 0;
padding: 0;
}
body h1, body h2, body h3, body h4, body h5, body h6 {
margin-left: 0
}
body pre {
margin: 0.5em 10% 0.5em 1em;
line-height: 1.0;
color: navy;
}
tt.literal, code.literal {
color: navy;
}
.programlisting, .screen {
border: 1px solid silver;
background: #f4f4f4;
margin: 0.5em 10% 0.5em 0;
padding: 0.5em 1em;
}
div.sidebar {
background: #ffffee;
margin: 1.0em 10% 0.5em 0;
padding: 0.5em 1em;
border: 1px solid silver;
}
div.sidebar * { padding: 0; }
div.sidebar div { margin: 0; }
div.sidebar p.title {
font-family: sans-serif;
margin-top: 0.5em;
margin-bottom: 0.2em;
}
div.bibliomixed {
margin: 0.5em 5% 0.5em 1em;
}
div.glossary dt {
font-weight: bold;
}
div.glossary dd p {
margin-top: 0.2em;
}
dl {
margin: .8em 0;
line-height: 1.2;
}
dt {
margin-top: 0.5em;
}
dt span.term {
font-style: italic;
}
div.variablelist dd p {
margin-top: 0;
}
div.itemizedlist li, div.orderedlist li {
margin-left: -0.8em;
margin-top: 0.5em;
}
ul, ol {
list-style-position: outside;
}
div.sidebar ul, div.sidebar ol {
margin-left: 2.8em;
}
div.itemizedlist p.title,
div.orderedlist p.title,
div.variablelist p.title
{
margin-bottom: -0.8em;
}
div.revhistory table {
border-collapse: collapse;
border: none;
}
div.revhistory th {
border: none;
color: #527bbd;
font-family: tahoma, verdana, sans-serif;
}
div.revhistory td {
border: 1px solid silver;
}
/* Keep TOC and index lines close together. */
div.toc dl, div.toc dt,
div.list-of-figures dl, div.list-of-figures dt,
div.list-of-tables dl, div.list-of-tables dt,
div.indexdiv dl, div.indexdiv dt
{
line-height: normal;
margin-top: 0;
margin-bottom: 0;
}
/*
Table styling does not work because of overriding attributes in
generated HTML.
*/
div.table table,
div.informaltable table
{
margin-left: 0;
margin-right: 5%;
margin-bottom: 0.8em;
}
div.informaltable table
{
margin-top: 0.4em
}
div.table thead,
div.table tfoot,
div.table tbody,
div.informaltable thead,
div.informaltable tfoot,
div.informaltable tbody
{
/* No effect in IE6. */
border-top: 2px solid #527bbd;
border-bottom: 2px solid #527bbd;
}
div.table thead, div.table tfoot,
div.informaltable thead, div.informaltable tfoot
{
font-weight: bold;
}
div.mediaobject img {
border: 1px solid silver;
margin-bottom: 0.8em;
}
div.figure p.title,
div.table p.title
{
margin-top: 1em;
margin-bottom: 0.4em;
}
@media print {
div.navheader, div.navfooter { display: none; }
}

View File

@@ -0,0 +1,21 @@
/* Man page text is indented from headings. */
p,ul,ol,dl,h4,h5 {
padding: 0 10%;
}
h2 { text-decoration: none;}
/* Man page emphasis is always bold. */
em, dt {
font-style: normal;
font-weight: bold;
}
div#synopsis p { }
div.literalparagraph { margin: 0 10%; }
div.literalblock { margin: 0 10%; }
div.listingblock {
margin: 0 10%;
}

View File

@@ -0,0 +1,247 @@
body {
background: #dedede;
margin: 0;
min-height: 480px;
}
h1,h2,h3,h4,h5 {
padding: 0.5em 0 0 5%;
text-align: left;
background: transparent;
font-family: Tahoma, Verdana, sans-serif;
font-weight: bold;
margin-top: 1.5em;
}
h1 { font-size: 200%; }
h2 { font-size: 125%; }
h3 { font-size: 110%; font-family: sans-serif;}
h4 { font-size: 100%; font-style: italic; font-family: sans-serif;}
h1 {
padding: 0.5em 0 0.5em 5%;
color: white;
background: #1f764c; /* Olive green */
margin: 0;
border-bottom: solid 1px black;
}
h2 { text-decoration: underline;}
/* This is only used by level 0 sections in book document types. */
h2.sect0 { font-size: 175%; text-decoration: underline;}
span#author {
font-family: sans-serif;
font-size: larger;
font-weight: bold;
}
div#informalpreface p { }
div.literalparagraph { margin: 0 5%; }
div.literalblock { margin: 0 5%; }
div.listingblock { padding: 0 5%; }
pre.verseblock { padding: 0 5%; }
p.verseblock {
white-space: pre;
}
a {
font-weight: bold;
background: #ffd; /* Light yellow */
color: #093; /* Green */
text-decoration: none;
}
a:hover { text-decoration: underline; }
p { padding: 0 5%; }
ul,ol {
padding: 0 5%;
margin-left: 1.75em;
list-style-position: outside;
}
ol ol, ol ul, ul ol, ul ul, dd ol, dd ul {
margin-left: 0;
}
/* Keep lists close to preceeding titles. Broken in IE6. */
p.listtitle + ul, p.listtitle + ol, p.listtitle + dl {
margin-top: 0;
}
dl { padding: 0 5%; }
dt { font-style: italic; }
dd, li { padding-bottom: 0.5em; }
dd p, li p { margin: 0 0 0.4em; padding: 0; }
li div.literalparagraph { margin-left: 0; }
div.literalparagraph pre, li div.literalparagraph pre { margin-left: 2%; }
div.listingblock, li div.listingblock { margin-left: 0; }
li div.literalblock { margin-left: 0; }
dd div.literalblock { margin-left: 0; }
div.literalblock pre, li div.literalblock pre { margin-left: 2%; }
dd div.literalparagraph { margin-left: 0; }
dd div.literalparagraph pre { margin-left: 2%; }
.listingblock, .literalparagraph, .literalblock, tt {
color: #461b7e;
}
div.listingblock pre {
background: #f0f0f0;
border: 1px dashed gray;
padding: 0.5em 1em;
}
table {
margin-left: 5%;
margin-right: 5%;
}
thead,tfoot,tbody {
/* No effect in IE6. */
border-top: 2px solid green;
border-bottom: 2px solid green;
}
thead,tfoot {
font-weight: bold;
}
table.hlist td:first-child { font-style: italic; }
p.listtitle {
margin-top: 1.5em;
margin-bottom: 0.2em;
}
p.tabletitle {
margin-top: 1.5em;
margin-bottom: 0.5em;
}
p.blocktitle {
margin-top: 1.5em;
margin-bottom: 0.2em;
}
p.imagetitle {
margin-top: 0.2em;
margin-bottom: 1.5em;
}
div.image img {
border: 1px solid #ece9d8;
}
a.imagelink > img:hover { border: 1px solid #093; } /* IE6 broken */
a.imagelink > img { border: 1px solid transparent; }
a.imagelink {
/* Don't use text link colors. */
background: transparent;
color: white;
}
div#content {
margin: 50px 3em 3em 140px;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 2px solid black;
border-bottom: 2px solid black;
background: white;
}
div#footer {
background: #f0f0f0;
font: 8pt sans-serif;
margin-top: 2em;
margin-bottom: 0;
padding: 0.8em 0 0.8em 0;
position: relative;
bottom: 0;
border-top: 1px solid silver;
}
div#footer table {
margin-left: 2%;
}
div#footer p {
margin: .5em 0 0 0;
padding: 0 5%;
}
div#footer a {
color: black;
background: transparent;
text-decoration: underline;
}
div#badges {
padding: 0 15px;
}
div#badges td {
vertical-align: middle;
}
div#badges img {
border-style: none;
}
/*
* Style sheet rules that are applied using element class attributes.
*/
div.image {
width: 100%;
border-style: none;
margin-bottom: 1.5em;
margin-left: 1em; /* for IE5,6 misbehavior */
padding: 0;
text-align: left;
}
div.admonition {
margin: 1.0em 20% 1.0em 5%;
}
div.admonition div.text * { padding: 0; }
div.admonition div.icon {
float: left;
width: 56px;
}
div.admonition div.text {
margin-left: 56px;
padding-top: 1px;
}
div.admonition div.text * { padding: 0; }
div.clear {
clear: both;
}
/* Print nicely. */
@media print {
@page { margin: 10% } /* This _is_ valid CSS2. */
h1,h2,h3,h4 { page-break-after: avoid; page-break-inside: avoid }
blockquote,pre { page-break-inside: avoid }
ul,ol,dl { page-break-before: avoid }
/* Override existing property settings. */
h1,a { color: black; background: white; }
div#content { margin: 0; border: 0; }
div#footer { display: none; }
/* IE5,6 only has the problem displaying, so restore margin for printing */
div.image { margin-left: 0; }
p.imagetitle { page-break-before: avoid; }
p.blocktitle, tabletitle { page-break-after: avoid; }
}
div.sidebarblock, exampleblock {
margin: 0.5em 20% 0.5em 5%;
padding: 0.5em 1em;
border: 1px solid silver;
}
div.sidebarblock *, exampleblock * { padding: 0; }
div.sidebarblock div, exampleblock div { margin: 0; }
div.sidebarblock {
background: #ffffee;
}
p.sidebartitle {
font-family: sans-serif;
font-weight: bold;
margin-top: 0.5em;
margin-bottom: 0.2em;
}

View File

@@ -0,0 +1,13 @@
/* Overrides for manpage documents */
h1 {
padding-top: 0.5em;
padding-bottom: 0.5em;
border-top: 2px solid silver;
border-bottom: 2px solid silver;
}
h2 {
border-style: none;
}
div.sectionbody {
margin-left: 5%;
}

View File

@@ -0,0 +1,31 @@
/* Workarounds for IE6's broken and incomplete CSS2. */
div.sidebar-content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.sidebar-title, div.image-title {
font-family: sans-serif;
font-weight: bold;
margin-top: 0.0em;
margin-bottom: 0.5em;
}
div.listingblock div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock-content {
padding-left: 2.0em;
}
div.exampleblock-content {
border-left: 2px solid silver;
padding-left: 0.5em;
}
/* IE6 sets dynamically generated links as visited. */
div#toc a:visited { color: blue; }

View File

@@ -0,0 +1,261 @@
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
/*
border: 1px solid red;
*/
}
body {
margin: 1em 5% 1em 5%;
}
a {
color: blue;
text-decoration: underline;
}
a:visited {
color: fuchsia;
}
em {
font-style: italic;
}
strong {
font-weight: bold;
}
tt {
color: navy;
}
h1, h2, h3, h4, h5, h6 {
color: #527bbd;
font-family: sans-serif;
margin-top: 1.2em;
margin-bottom: 0.5em;
line-height: 1.3;
}
h1 {
border-bottom: 2px solid silver;
}
h2 {
border-bottom: 2px solid silver;
padding-top: 0.5em;
}
div.sectionbody {
font-family: serif;
margin-left: 0;
}
hr {
border: 1px solid silver;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
pre {
padding: 0;
margin: 0;
}
span#author {
color: #527bbd;
font-family: sans-serif;
font-weight: bold;
font-size: 1.1em;
}
span#email {
}
span#revision {
font-family: sans-serif;
}
div#footer {
font-family: sans-serif;
font-size: small;
border-top: 2px solid silver;
padding-top: 0.5em;
margin-top: 4.0em;
}
div#footer-text {
float: left;
padding-bottom: 0.5em;
}
div#footer-badges {
float: right;
padding-bottom: 0.5em;
}
div#preamble,
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-right: 10%;
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.5em;
margin-bottom: 2.5em;
}
div.content { /* Block element content. */
padding: 0;
}
/* Block element titles. */
div.title, caption.title {
font-family: sans-serif;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.listingblock {
margin-right: 0%;
}
div.listingblock > div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock > div.content {
padding-left: 2.0em;
}
div.attribution {
text-align: right;
}
div.verseblock + div.attribution {
text-align: left;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #527bbd;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 2px solid silver;
}
div.exampleblock > div.content {
border-left: 2px solid silver;
padding: 0.5em;
}
div.verseblock div.content {
white-space: pre;
}
div.imageblock div.content { padding-left: 0; }
div.imageblock img { border: 1px solid silver; }
span.image img { border-style: none; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: italic;
}
dd > *:first-child {
margin-top: 0;
}
ul, ol {
list-style-position: outside;
}
ol.olist2 {
list-style-type: lower-alpha;
}
div.tableblock > table {
border: 3px solid #527bbd;
}
thead {
font-family: sans-serif;
font-weight: bold;
}
tfoot {
font-weight: bold;
}
div.hlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
div.hlist td {
padding-bottom: 5px;
}
td.hlist1 {
vertical-align: top;
font-style: italic;
padding-right: 0.8em;
}
td.hlist2 {
vertical-align: top;
}
@media print {
div#footer-badges { display: none; }
}
div#toctitle {
color: #527bbd;
font-family: sans-serif;
font-size: 1.1em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 0.1em;
}
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
div.toclevel2 {
margin-left: 2em;
font-size: 0.9em;
}
div.toclevel3 {
margin-left: 4em;
font-size: 0.9em;
}
div.toclevel4 {
margin-left: 6em;
font-size: 0.9em;
}

16
docs/asciidoc/text.conf Normal file
View File

@@ -0,0 +1,16 @@
# text.conf
# Used by the AsciiDoc a2x(1) toolchain wrapper utility.
# Filters to add leading blank line and margin indent to verbatim
# block elements so lynx(1) generated text output looks nicer.
[paradef-default]
verse-style=template="verseparagraph",filter="echo; echo; sed 's/^/ /'"
[paradef-literal]
filter=echo; echo; sed 's/^/ /'
[blockdef-listing]
filter=echo; sed 's/^/ /'
[blockdef-literal]
filter=echo; sed 's/^/ /'

View File

@@ -0,0 +1,235 @@
#
# xhtml-deprecated-css.conf
#
# Legacy AsciiDoc 6 xhtml backend.
# Included in xhtml-deprecated.conf
#
[tags]
# Add title class.
ilist={id?<a name="{id}"></a>}{title?<p class="listtitle"><b>{title}</b></p>}<ul>|</ul>
olist={id?<a name="{id}"></a>}{title?<p class="listtitle"><b>{title}</b></p>}<ol>|</ol>
vlist={id?<a name="{id}"></a>}{title?<p class="listtitle"><b>{title}</b></p>}<dl>|</dl>
hlist={id?<a name="{id}"></a>}{title?<p class="listtitle"><b>{title}</b></p>}<table class="hlist">|</table>
qlist={id?<a name="{id}"></a>}{title?<p class="listtitle"><b>{title}</b></p>}<ol>|</ol>
colist={id?<a name="{id}"></a>}{title?<p class="listtitle"><b>{title}</b></p>}<ol>|</ol>
[image-inlinemacro]
<a class="imagelink" href="{link}">
# border="0" so broken IE6 does not put border round linked image.
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"} border="0"/>
{link#}</a>
[image-blockmacro]
<div class="image">
<a name="{id}"></a>
<p>{link?<a class="imagelink" href="{link}">}
# border="0" so broken IE6 does not put border round linked image.
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"} border="0"/>
{link?</a>}</p>
<p class="imagetitle"><b>Figure:</b> {title}</p>
</div>
# Paragraph substitution.
[literalparagraph]
<a name="{id}"></a>
<p class="blocktitle"><b>Example:</b> {title}</p>
<div class="literalparagraph"><pre>|</pre></div>
# Admonition paragraphs.
[admonitionparagraph]
<div class="admonition">
<a name="{id}"></a>
# For backward compatibility still accept deprecated imagesdir attribute.
{icons#}<div class="icon"><img src="{imagesdir={iconsdir}}/{name}.png" alt="{caption}" /></div>
<div class="text"><p><b>{style}:</b> |</p></div>
<div class="clear"></div>
</div>
# Delimited block substitution.
[literalblock]
<a name="{id}"></a>
<p class="blocktitle"><b>Example:</b> {title}</p>
<div class="literalblock"><pre>
|
</pre></div>
[listingblock]
<a name="{id}"></a>
<p class="blocktitle"><b>Example:</b> {title}</p>
<div class="listingblock"><pre>
|
</pre></div>
[sidebarblock]
<div class="sidebarblock">
<a name="{id}"></a>
<p class="sidebartitle">{title}</p>
|
</div>
[passthroughblock]
|
[exampleblock]
<a name="{id}"></a>
<p class="blocktitle"><b>Example:</b> {title}</p>
<div class="exampleblock">
|
</div>
# Admonition blocks.
[admonitionblock]
<div class="admonition">
<a name="{id}"></a>
# For backward compatibility still accept deprecated imagesdir attribute.
{icons#}<div class="icon"><img src="{imagesdir={iconsdir}}/{name}.png" alt="{caption}" /></div>
<div class="text">
<p><b>{title={style}}</b></p>
|</div>
<div class="clear"></div>
</div>
[verseblock]
<p class="verseblock">{id?<a name="{id}"></a>}{title?<b>{title}</b><br />}
|
</p>
[table]
# Table captions not used because IE6 is broken.
<p class="tabletitle"><b>Table:</b> {title}</p>
# If you want styled table borders in IE use the following table tag:
# 1. Border style specified here rather than in CSS because IE6 is broken.
# 2. bordercolor attribute is IE specific and not valid XHTML 1.0.
#<table rules="groups" border="2" bordercolor="green" frame="hsides"
# cellspacing="0" cellpadding="4">
#
# Use this in preference to be strictly XHTML 1.0 conformant.
<a name="{id}"></a>
<table class="tableblock" rules="{grid=none}"
frame="{frame%hsides}"
frame="{frame@topbot:hsides}{frame@all:border}{frame@none:void}{frame@sides:vsides}"
cellspacing="0" cellpadding="4">
{headrows#}<thead{noborders? style="border-width: 0;"}>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot{noborders? style="border-width: 0;"}>
{footrows}
{footrows#}</tfoot>
<tbody{noborders? style="border-width: 0;"}>
{bodyrows}
</tbody>
</table>
[preamble]
# Untitled elements between header and first section title.
<div id="preamble">
<a name="{id}"></a>
|
</div>
[sect0]
<h2 class="sect0">{id?<a name="{id}"></a>}{title}</h2>
|
[sect1]
<h2>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h2>
|
[sect2]
<h3>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h3>
|
[sect3]
<h4>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h4>
|
[sect4]
<h5>{id?<a name="{id}"></a>}{title}</h5>
|
[footer]
<div id="footer">
<p>
Version {revision}<br />
Last updated {localdate} {localtime}
</p>
</div>
</div>
</body>
</html>
#-------------------------
# article and book document types
# Both use the article.css stylesheet
#-------------------------
ifndef::doctype-manpage[]
[header]
<!DOCTYPE html {dtddecl}>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={encoding=ISO-8859-1}" />
<meta name="generator" content="AsciiDoc {asciidoc-version}" />
ifdef::linkcss[]
<link rel="stylesheet" href="{stylesdir=.}/{theme={backend}}.css" type="text/css" />
endif::linkcss[]
ifndef::linkcss[]
<style type="text/css">
include1::./stylesheets/{theme={backend}}.css[]
</style>
endif::linkcss[]
<title>{doctitle}</title>
</head>
<body>
<div id="content">
<h1>{doctitle}</h1>
<p>
<span id="author">by {author}</span><br />
<tt>&lt;<a href="mailto:{email}">{email}</a>&gt;</tt><br />
v{revision}{date?,}
{date}
</p>
endif::doctype-manpage[]
#-------------------------
# manpage document type
#-------------------------
ifdef::doctype-manpage[]
[header]
<!DOCTYPE html {dtddecl}>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={encoding=ISO-8859-1}" />
<meta name="generator" content="AsciiDoc {asciidoc-version}" />
ifdef::linkcss[]
<link rel="stylesheet" href="{stylesdir=.}/{theme={backend}}.css" type="text/css" />
<link rel="stylesheet" href="{stylesdir=.}/{backend}-manpage.css" type="text/css" />
endif::linkcss[]
ifndef::linkcss[]
<style type="text/css">
include1::./stylesheets/{theme={backend}}.css[]
include1::./stylesheets/{theme={backend}}-manpage.css[]
</style>
endif::linkcss[]
<title>{mantitle}</title>
</head>
<body>
<div id="content">
<h1>{doctitle} Manual Page</h1>
<h2>NAME</h2>
<p>{manname} -
{manpurpose}
</p>
# Section macros
[sect-synopsis]
<div id="synopsis">
<a name="{id}"></a>
<h2>SYNOPSIS</h2>
|
</div>
endif::doctype-manpage[]

View File

@@ -0,0 +1,352 @@
#
# xhtml-deprecated.conf
#
# Asciidoc configuration file.
# Legacy AsciiDoc 6 xhtml backend.
#
[miscellaneous]
outfilesuffix=.html
# Screen width in pixels.
pagewidth=800
pageunits=
[attributes]
basebackend=html
basebackend-html=
dtddecl=PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
[replacements]
# Line break.
(?m)^(.*)\s\+$=\1<br />
# Superscripts.
\^(.+?)\^=<sup>\1</sup>
# Subscripts.
~(.+?)~=<sub>\1</sub>
[ruler-blockmacro]
<hr />
[image-inlinemacro]
<a href="{link}">
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"}/>
{link#}</a>
[image-blockmacro]
<a name="{id}"></a>
<a href="{link}">
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"}/>
{link#}</a>
<p><b>Figure:</b> {title}</p>
[indexterm-inlinemacro]
# Inline index term.
{empty}
[indexterm2-inlinemacro]
# Inline index term.
# Single entry index term that is visible in the primary text flow.
{1}
[footnote-inlinemacro]
# Inline footnote.
<br />[{0}]<br />
[callout-inlinemacro]
# Inline callout.
<b>({index})</b>
[tags]
# Bulleted, numbered and labeled list tags.
ilist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ul>|</ul>
ilistitem=<li>|</li>
ilisttext=<p>|</p>
olist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol>|</ol>
olist2={id?<a name="{id}"></a>}<ol type="a">|</ol>
olistitem=<li>|</li>
olisttext=<p>|</p>
vlist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<dl>|</dl>
vlistentry=|
vlistterm=<dt>|</dt>
vlistitem=<dd>|</dd>
vlisttext=<p>|</p>
# Horizontal labeled list.
hlist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<table cellpadding="4">|</table>
hlistentry=<tr valign="top">|</tr>
hlisttext=|
hlistterm=<td{1? width="{1}%"}>|</td>
hlistitem=<td{2? width="{2}%"}>|</td>
# Question and Answer list.
qlist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol>|</ol>
qlistentry=<li>|</li>
qlistterm=<p><em>|</em></p>
qlistitem=|
qlisttext=<p>|</p>
# Callout list.
colist={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol>|</ol>
colistitem=<li>|</li>
colisttext=<p>|</p>
# Quoted text.
emphasis=<em>|</em>
strong=<strong>|</strong>
monospaced=<tt>|</tt>
quoted={amp}#8220;|{amp}#8221;
# Inline macros
[http-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[https-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[ftp-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[file-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[mailto-inlinemacro]
<a href="{name}:{target}">{0={target}}</a>
[link-inlinemacro]
<a href="{target}">{0={target}}</a>
# anchor:id[text]
[anchor-inlinemacro]
<a name="{target}"></a>
# [[id,text]]
[anchor2-inlinemacro]
<a name="{1}"></a>
# [[[id]]]
[anchor3-inlinemacro]
<a name="{1}">[{1}]</a>
# xref:id[text]
[xref-inlinemacro]
<a href="#{target}">{0=[{target}]}</a>
# <<id,text>>
[xref2-inlinemacro]
<a href="#{1}">{2=[{1}]}</a>
# Special word substitution.
[emphasizedwords]
<em>{words}</em>
[monospacedwords]
<tt>{words}</tt>
[strongwords]
<strong>{words}</strong>
# Paragraph substitution.
[paragraph]
<p>{id?<a name="{id}"></a>}{title?<b>{title}</b><br />}
|
</p>
[literalparagraph]
# The literal block employs the same markup.
template::[literalblock]
[verseparagraph]
# The verse block employs the same markup.
template::[verseblock]
[admonitionparagraph]
<a name="{id}"></a>
<p><b>{style}:</b> |</p>
# Delimited blocks.
[passthroughblock]
|
[listingblock]
<a name="{id}"></a>
<p><b>{title}</b></p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
<pre>
|
</pre>
</td></tr></table>
[literalblock]
<a name="{id}"></a>
<p><b>{title}</b></p>
<pre>
|
</pre>
[verseblock]
<a name="{id}"></a>
<p><b>{title}</b></p>
# Font inheritance broken in IE6.
<pre style="font-family: inherit;">
|
</pre>
[sidebarblock]
<a name="{id}"></a>
<table frame="border" bgcolor="#ffffee" width="80%" cellpadding="15">
<tr><td>
<p><em>{title}</em></p>
|
</td></tr></table>
[quoteblock]
<a name="{id}"></a>
<blockquote>
<p><b>{title}</b></p>
|
<p align="right">
<em>{citetitle}</em><br />
&#8212; {attribution}
</p>
</blockquote>
[exampleblock]
<a name="{id}"></a>
<p><b>Example:</b> {title}</p>
<table frame="border" bgcolor="white" width="80%" cellpadding="15">
<tr><td>
|
</td></tr></table>
[admonitionblock]
<a name="{id}"></a>
<table frame="void" bgcolor="white" width="80%" cellpadding="8">
<tr valign="top"><td><p><b>{style}</b></p></td><td>
<p><b>{title}</b></p>
|
</td></tr></table>
# Bibliography list.
# Same as numbered list.
[listdef-bibliography]
listtag=olist
itemtag=olistitem
texttag=olisttext
# Glossary list.
# Same as labeled list.
[listdef-glossary]
listtag=vlist
itemtag=vlistitem
texttag=vlisttext
entrytag=vlistentry
labeltag=vlistterm
# Tables.
[tabledef-default]
template=table
bodyrow=<tr>|</tr>
headdata=<th align="{colalign}" width="{colwidth}{pageunits}">|</th>
footdata=<td align="{colalign}" width="{colwidth}{pageunits}"><strong>|</strong></td>
bodydata=<td align="{colalign}" width="{colwidth}{pageunits}" valign="top">|</td>
[table]
<p><b>Table:</b> {title}</p>
<a name="{id}"></a>
<table rules="{grid=none}"
frame="{frame%hsides}"
frame="{frame@topbot:hsides}{frame@all:border}{frame@none:void}{frame@sides:vsides}"
cellspacing="0" cellpadding="4">
{headrows#}<thead>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot>
{footrows}
{footrows#}</tfoot>
<tbody>
{bodyrows}
</tbody>
</table>
[footer]
<p></p>
<p></p>
<hr /><p><small>
Version {revision}<br />
Last updated {localdate} {localtime}
</small></p>
</body>
</html>
[preamble]
# Untitled elements between header and first section title.
<a name="{id}"></a>
|
[sect0]
{doctype-manpage%}<hr />
<h1>{id?<a name="{id}"></a>}{title}</h1>
|
[sect1]
{doctype-manpage%}<hr />
<h2>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h2>
|
[sect2]
<h3>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h3>
|
[sect3]
<h4>{id?<a name="{id}"></a>}{numbered?{sectnum} }{title}</h4>
|
[sect4]
<h5>{id?<a name="{id}"></a>}{title}</h5>
|
#-------------------------
# article and book document types
#-------------------------
ifndef::doctype-manpage[]
[header]
<!DOCTYPE html {dtddecl}>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={encoding=ISO-8859-1}"/>
<meta name="generator" content="AsciiDoc {asciidoc-version}"/>
<title>{doctitle}</title>
</head>
<body>
<h1>{doctitle}</h1>
<p>
<strong>by {author}</strong><br />
<tt>&lt;<a href="mailto:{email}">{email}</a>&gt;</tt><br />
v{revision}{date?,}
{date}
</p>
endif::doctype-manpage[]
#-------------------------
# manpage document type
#-------------------------
ifdef::doctype-manpage[]
[tags]
# This is more inline with man page convention.
emphasis=<b>|</b>
vlistterm=<dt><b>|</b></dt>
[header]
<!DOCTYPE html {dtddecl}>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={encoding=ISO-8859-1}"/>
<meta name="generator" content="AsciiDoc {asciidoc-version}"/>
<title>{mantitle}</title>
</head>
<body>
<hr />
<h1>
{doctitle} Manual Page
</h1>
<hr />
<h2>NAME</h2>
<p>{manname} -
{manpurpose}
</p>
[sect-synopsis]
template::[sect1]
endif::doctype-manpage[]
ifdef::css[]
include::xhtml-deprecated-css.conf[]
endif::css[]

View File

@@ -0,0 +1,43 @@
#
# xhtml11-quirks.conf
#
# Workarounds for IE6's broken # and incomplete CSS2.
#
[image-blockmacro]
<div class="imageblock">
<a id="{id}"></a>
<div class="content">
<a class="image" href="{link}">
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"}/>
{link#}</a>
</div>
<div class="image-title">{caption=Figure: }{title}</div>
</div>
[sidebarblock]
<div class="sidebarblock">
<a id="{id}"></a>
<div class="sidebar-content">
<div class="sidebar-title">{title}</div>
|
</div></div>
[quoteblock]
<div class="quoteblock">
<a id="{id}"></a>
<div class="title">{title}</div>
<div class="quoteblock-content">
|
<div class="attribution">
<span class="emphasis">{citetitle}</span><br />
&#8212; {attribution}
</div></div></div>
[exampleblock]
<div class="exampleblock">
<a id="{id}"></a>
<div class="title">{caption=Example: }{title}</div>
<div class="exampleblock-content">
|
</div></div>

467
docs/asciidoc/xhtml11.conf Normal file
View File

@@ -0,0 +1,467 @@
#
# xhtml11.conf
#
# Asciidoc configuration file.
# xhtml11 backend, generates XHTML 1.1 conformant markup.
#
[miscellaneous]
outfilesuffix=.html
# Screen width in pixels.
pagewidth=800
pageunits=
[attributes]
basebackend=html
basebackend-html=
[replacements]
# Line break.
(?m)^(.*)\s\+$=\1<br />
# Escape ASCIIMathML delimiters.
ifdef::asciimath[]
\$=\$
`=\`
endif::asciimath[]
ifdef::asciidoc7compatible[]
# Superscripts.
\^(.+?)\^=<sup>\1</sup>
# Subscripts.
~(.+?)~=<sub>\1</sub>
endif::asciidoc7compatible[]
[ruler-blockmacro]
<hr />
[image-inlinemacro]
<span class="image">
<a class="image" href="{link}">
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"} />
{link#}</a>
</span>
[image-blockmacro]
<div class="imageblock">
<a id="{id}"></a>
<div class="content">
<a class="image" href="{link}">
<img src="{target}" alt="{1={target}}"{1? title="{1}"}{width? width="{width}"}{height? height="{height}"} />
{link#}</a>
</div>
<div class="title">{caption=Figure: }{title}</div>
</div>
[indexterm-inlinemacro]
# Inline index term.
{empty}
[indexterm2-inlinemacro]
# Inline index term.
# Single entry index term that is visible in the primary text flow.
{1}
[footnote-inlinemacro]
# Inline footnote.
<br />[{0}]<br />
[callout-inlinemacro]
# Inline callout.
<b>({index})</b>
[tags]
# Bulleted, numbered and labeled list tags.
ilist={id?<a id="{id}"></a>}{title?<div class="title">{title}</div>}<ul>|</ul>
ilistitem=<li>|</li>
ilisttext=<p>|</p>
olist={id?<a id="{id}"></a>}{title?<div class="title">{title}</div>}<ol>|</ol>
olist2={id?<a id="{id}"></a>}<ol class="olist2">|</ol>
olistitem=<li>|</li>
olisttext=<p>|</p>
vlist={id?<a id="{id}"></a>}{title?<div class="title">{title}</div>}<dl>|</dl>
vlistentry=|
vlistterm=<dt>|</dt>
vlistitem=<dd>|</dd>
vlisttext=<p>|</p>
# Horizontal labeled list.
hlist=<div class="hlist">{id?<a id="{id}"></a>}{title?<div class="title">{title}</div>}<table>{1?<col width="{1}%" />}{2?<col width="{2}%" />}|</table></div>
hlistentry=<tr>|</tr>
hlistterm=<td class="hlist1">|</td>
hlistitem=<td class="hlist2">|</td>
hlisttext=|
# Question and Answer list.
qlist={id?<a id="{id}"></a>}{title?<div class="title">{title}</div>}<ol>|</ol>
qlistentry=<li>|</li>
qlistterm=<p><em>|</em></p>
qlistitem=|
qlisttext=<p>|</p>
# Callout list.
colist={id?<a id="{id}"></a>}{title?<div class="title">{title}</div>}<ol>|</ol>
colistitem=<li>|</li>
colisttext=<p>|</p>
# Quoted text.
emphasis=<em{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</em>
strong=<strong{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</strong>
monospaced=<tt{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</tt>
quoted={0?<span style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?">}{amp}#8220;|{amp}#8221;{0?</span>}
unquoted={0?<span style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?">}|{0?</span>}
superscript=<sup{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</sup>
subscript=<sub{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</sub>
# $$ inline passthrough.
$$passthrough=<span{0? style="}{1?color: {1};}{2?background-color: {2};}{3?font-size: {3}em;}{0?"}>|</span>
# Inline macros
[http-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[https-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[ftp-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[file-inlinemacro]
<a href="{name}:{target}">{0={name}:{target}}</a>
[mailto-inlinemacro]
<a href="{name}:{target}">{0={target}}</a>
[link-inlinemacro]
<a href="{target}">{0={target}}</a>
[callto-inlinemacro]
<a href="{name}:{target}">{0={target}}</a>
# anchor:id[text]
[anchor-inlinemacro]
<a id="{target}"></a>
# [[id,text]]
[anchor2-inlinemacro]
<a id="{1}"></a>
# [[[id]]]
[anchor3-inlinemacro]
<a id="{1}"></a>[{1}]
# xref:id[text]
[xref-inlinemacro]
<a href="#{target}">{0=[{target}]}</a>
# <<id,text>>
[xref2-inlinemacro]
<a href="#{1}">{2=[{1}]}</a>
# Special word substitution.
[emphasizedwords]
<em>{words}</em>
[monospacedwords]
<tt>{words}</tt>
[strongwords]
<strong>{words}</strong>
# Paragraph substitution.
[paragraph]
<div class="title">{title}</div>
<p>{id?<a id="{id}"></a>}
|
</p>
[literalparagraph]
# The literal block employs the same markup.
template::[literalblock]
[verseparagraph]
# The verse block employs the same markup.
template::[verseblock]
[admonitionparagraph]
# The admonition block employs the same markup.
template::[admonitionblock]
# Delimited blocks.
[passthroughblock]
|
[listingblock]
<div class="listingblock">
<a id="{id}"></a>
<div class="title">{caption=Example: }{title}</div>
<div class="content">
<pre><tt>
|
</tt></pre>
</div></div>
[literalblock]
<div class="literalblock">
<a id="{id}"></a>
<div class="title">{title}</div>
<div class="content">
{style#}<pre class="{style}"><span>
{style%}<pre><tt>
|
</tt></pre>
</div></div>
[verseblock]
<div class="verseblock">
<a id="{id}"></a>
<div class="title">{title}</div>
<div class="content">
|
</div></div>
[sidebarblock]
<div class="sidebarblock">
<a id="{id}"></a>
<div class="content">
<div class="title">{title}</div>
|
</div></div>
[quoteblock]
<div class="quoteblock">
<a id="{id}"></a>
<div class="title">{title}</div>
<div class="content">
|
<div class="attribution">
<em>{citetitle}</em><br />
&#8212; {attribution}
</div></div></div>
[exampleblock]
<div class="exampleblock">
<a id="{id}"></a>
<div class="title">{caption=Example: }{title}</div>
<div class="content">
|
</div></div>
[admonitionblock]
<div class="admonitionblock">
<a id="{id}"></a>
<table><tr>
<td class="icon">
{icons#}<img src="{icon={iconsdir}/{name}.png}" alt="{caption}" />
{icons%}<div class="title">{caption}</div>
</td>
<td class="content">
<div class="title">{title}</div>
|
</td>
</tr></table>
</div>
# Bibliography list.
# Same as numbered list.
[listdef-bibliography]
listtag=olist
itemtag=olistitem
texttag=olisttext
# Glossary list.
# Same as labeled list.
[listdef-glossary]
listtag=vlist
itemtag=vlistitem
texttag=vlisttext
entrytag=vlistentry
labeltag=vlistterm
# Tables.
[tabledef-default]
template=table
colspec=<col width="{colwidth}{pageunits}" />
bodyrow=<tr>|</tr>
headdata=<th align="{colalign}">|</th>
footdata=<td align="{colalign}">|</td>
bodydata=<td align="{colalign}">|</td>
[table]
<div class="tableblock">
<a id="{id}"></a>
<table rules="{grid=none}"
frame="{frame%hsides}"
frame="{frame@topbot:hsides}{frame@all:border}{frame@none:void}{frame@sides:vsides}"
cellspacing="0" cellpadding="4">
<caption class="title">{caption=Table: }{title}</caption>
{colspecs}
{headrows#}<thead>
{headrows}
{headrows#}</thead>
{footrows#}<tfoot>
{footrows}
{footrows#}</tfoot>
<tbody valign="top">
{bodyrows}
</tbody>
</table>
</div>
[preamble]
# Untitled elements between header and first section title.
<div id="preamble">
<a id="{id}"></a>
<div class="sectionbody">
|
</div>
</div>
# Document sections.
[sect0]
<h1>{id?<a id="{id}"></a>}{title}</h1>
|
[sect1]
<h2>{id?<a id="{id}"></a>}{numbered?{sectnum} }{title}</h2>
<div class="sectionbody">
|
</div>
[sect2]
<h3>{id?<a id="{id}"></a>}{numbered?{sectnum} }{title}</h3>
|
[sect3]
<h4>{id?<a id="{id}"></a>}{numbered?{sectnum} }{title}</h4>
|
[sect4]
<h5>{id?<a id="{id}"></a>}{title}</h5>
|
[header]
# IE6 enters quirks mode if the following XML directive is present.
#<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={encoding}" />
<meta name="generator" content="AsciiDoc {asciidoc-version}" />
ifdef::linkcss[]
<link rel="stylesheet" href="{stylesdir=.}/{theme={backend}}.css" type="text/css" />
{doctype-manpage}<link rel="stylesheet" href="{stylesdir=.}/{theme={backend}}-manpage.css" type="text/css" />
ifdef::quirks[]
<link rel="stylesheet" href="{stylesdir=.}/{theme={backend}}-quirks.css" type="text/css" />
endif::quirks[]
endif::linkcss[]
ifndef::linkcss[]
<style type="text/css">
include1::{stylesdir=./stylesheets}/{theme={backend}}.css[]
{doctype-manpage}include1::{stylesdir=./stylesheets}/{theme={backend}}-manpage.css[]
ifdef::quirks[]
include1::{stylesdir=./stylesheets}/{theme={backend}}-quirks.css[]
endif::quirks[]
</style>
endif::linkcss[]
ifdef::toc[]
ifdef::linkcss[]
<script type="text/javascript">
# Escape as CDATA to pass validators.
/*<![CDATA[*/
window.onload = function()\{generateToc({toclevels=2})\}
/*]]>*/
</script>
<script type="text/javascript" src="{scriptsdir=.}/toc.js"></script>
endif::linkcss[]
ifndef::linkcss[]
<script type="text/javascript">
# Escape as CDATA to pass validators.
/*<![CDATA[*/
window.onload = function()\{generateToc({toclevels=2})\}
include1::{scriptsdir=./javascripts}/toc.js[]
/*]]>*/
</script>
endif::linkcss[]
endif::toc[]
ifdef::asciimath[]
ifdef::linkcss[]
<script type="text/javascript" src="{scriptsdir=.}/ASCIIMathML.js"></script>
endif::linkcss[]
ifndef::linkcss[]
<script type="text/javascript">
# Escape as CDATA to pass validators.
/*<![CDATA[*/
include1::{scriptsdir=./javascripts}/ASCIIMathML.js[]
/*]]>*/
</script>
endif::linkcss[]
endif::asciimath[]
<title>{doctitle}</title>
</head>
<body>
# Article, book header.
ifndef::doctype-manpage[]
<div id="header">
<h1>{doctitle}</h1>
<span id="author">{author}</span><br />
<span id="email"><tt>&lt;<a href="mailto:{email}">{email}</a>&gt;</tt></span><br />
<span id="revision">version {revision}{date?,}</span>
{date}
ifdef::toc[]
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
endif::toc[]
</div>
endif::doctype-manpage[]
# Man page header.
ifdef::doctype-manpage[]
<div id="header">
<h1>
{doctitle} Manual Page
</h1>
ifdef::toc[]
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
endif::toc[]
<h2>NAME</h2>
<div class="sectionbody">
<p>{manname} -
{manpurpose}
</p>
</div>
</div>
endif::doctype-manpage[]
[footer]
<div id="footer">
<div id="footer-text">
Version {revision}<br />
Last updated {localdate} {localtime}
</div>
<div id="footer-badges">
{edeversion}
</div>
ifdef::badges[]
<div id="footer-badges">
ifndef::icons[]
Valid <a href="http://validator.w3.org/check?uri=referer">XHTML</a>
and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.
endif::icons[]
ifdef::icons[]
<a href="http://validator.w3.org/check?uri=referer">
<img style="border:none; width:88px; height:31px;"
src="http://www.w3.org/Icons/valid-xhtml11"
alt="Valid XHTML 1.1!" />
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:none; width:88px; height:31px;"
src="http://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!" />
</a>
<a href="http://www.mozilla.org/products/firefox/">
<img style="border:none; width:110px; height:32px;"
src="http://www.spreadfirefox.com/community/images/affiliates/Buttons/110x32/safer.gif"
alt="Get Firefox!" />
</a>
endif::icons[]
</div>
endif::badges[]
</div>
</body>
</html>
ifdef::doctype-manpage[]
[sect-synopsis]
template::[sect1]
endif::doctype-manpage[]
ifdef::quirks[]
include::{backend}-quirks.conf[]
endif::quirks[]