use local copies of asciidoc-dblatex.sty/asciidoc-dblatex.xsl

This commit is contained in:
Thomas Nagy 2012-09-05 01:19:53 +02:00
parent b5c043ef49
commit d51858100c
3 changed files with 115 additions and 23 deletions

View File

@ -0,0 +1,31 @@
%%
%% This style is derived from the docbook one.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style]
%% Just use the original package and pass the options.
\RequirePackageWithOptions{docbook}
% Sidebar is a boxed minipage that can contain verbatim.
% Changed shadow box to double box.
\renewenvironment{sidebar}[1][0.95\textwidth]{
\hspace{0mm}\newline%
\noindent\begin{Sbox}\begin{minipage}{#1}%
\setlength\parskip{\medskipamount}%
}{
\end{minipage}\end{Sbox}\doublebox{\TheSbox}%
}
% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`.
\usepackage{alltt}
\usepackage{color}
\usepackage{listings}
\definecolor{gray}{gray}{0.5}
\definecolor{plum}{rgb}{0.55078125,0.09765625,0.55859375}
\lstset{commentstyle=\color{plum}}
\lstdefinelanguage{shishell} {
morekeywords={},
sensitive=false,
morecomment=[l]{\$}
}

View File

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

View File

@ -90,6 +90,7 @@ def configure(conf):
def build(bld):
#bld(features='subst', is_copy=True, source='asciidoc-dblatex.sty asciidoc-dblatex.xsl', target='asciidoc-dblatex.sty asciidoc-dblatex.xsl')
for x in bld.path.ant_glob('*.eps'):
bld(features='subst', source=x.name, target=x.name, is_copy=True)
@ -122,11 +123,15 @@ def build(bld):
bld(rule='${ADOC} -a icons=true -a stylesheet=${SRC[1].abspath()} -a iconsdir=. -a toc -d book -o ${TGT} ${SRC[0].abspath()}',
source='waf.txt waf.css', target='single.html', scan=ascii_doc_scan)
bld(rule='${A2X} -L -a toc --icons-dir=. --icons -D ${gen.path.get_bld().abspath()} -d book -f pdf ${SRC}',
source='waf.txt', target='waf.pdf', scan=ascii_doc_scan)
bld(rule='${A2X} -L -a toc --icons-dir=. --icons -D ${gen.path.get_bld().abspath()} \
-d book -f pdf --dblatex-opts "-s ${SRC[1].abspath()} -p ${SRC[2].abspath()}" ${SRC[0].bldpath()}',
shell=True,
source='waf.txt asciidoc-dblatex.sty asciidoc-dblatex.xsl', target='waf.pdf', scan=ascii_doc_scan)
bld(rule='${A2X} -L -a toc --icons-dir=. --icons -D ${gen.path.get_bld().abspath()} -d article -f pdf ${SRC}',
source='intro_waf_1.6.txt', target='intro_waf_1.6.pdf', scan=ascii_doc_scan)
bld(rule='${A2X} -L -a toc --icons-dir=. --icons -D ${gen.path.get_bld().abspath()} \
-d article -f pdf --dblatex-opts "-s ${SRC[1].abspath()} -p ${SRC[2].abspath()}" ${SRC[0].bldpath()}',
shell=True,
source='intro_waf_1.6.txt asciidoc-dblatex.sty asciidoc-dblatex.xsl', target='intro_waf_1.6.pdf', scan=ascii_doc_scan)
bld(rule='ln -sf single.html index.html', shell=True)
@ -136,25 +141,7 @@ def build(bld):
bld.add_post_fun(exe)
"""
Add the following to asciidoc/dblatex/asciidoc-dblatex.sty
\\usepackage{color}
\\usepackage{listings}
\definecolor{gray}{gray}{0.5}
\definecolor{plum}{rgb}{0.55078125,0.09765625,0.55859375}
\lstset{commentstyle=\color{plum}}
\lstdefinelanguage{shishell} {
morekeywords={},
sensitive=false,
morecomment=[l]{\$}
}
Set the following values in asciidoc-dblatex.xsl:
<xsl:param name="doc.publisher.show">0</xsl:param>
...
<xsl:param name="latex.output.revhistory">0</xsl:param>
And for vim highlighting:
For vim highlighting:
cp vim/syntax/asciidoc.vim /usr/share/vim/site/syntax/
cp vim/ftdetect/asciidoc_filetype.vim /usr/share/vim/site/ftdetect/