From 065fd2984a827f4cb87f71fe478ccc0da92eb540 Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Thu, 28 Jan 2021 21:49:22 +0000 Subject: fix building website with new package structure Signed-off-by: Matthew Peveler --- .github/workflows/ghpages.yml | 4 +- asciidoc/a2x.py | 6 +- asciidoc/resources/dblatex/asciidoc-dblatex.sty | 22 ++++++++ asciidoc/resources/dblatex/asciidoc-dblatex.xsl | 74 +++++++++++++++++++++++++ asciidoc/resources/dblatex/dblatex-readme.txt | 39 +++++++++++++ build_website.sh | 25 +++++---- configure.ac | 2 +- dblatex/asciidoc-dblatex.sty | 22 -------- dblatex/asciidoc-dblatex.xsl | 74 ------------------------- dblatex/dblatex-readme.txt | 39 ------------- 10 files changed, 156 insertions(+), 151 deletions(-) create mode 100644 asciidoc/resources/dblatex/asciidoc-dblatex.sty create mode 100644 asciidoc/resources/dblatex/asciidoc-dblatex.xsl create mode 100644 asciidoc/resources/dblatex/dblatex-readme.txt delete mode 100644 dblatex/asciidoc-dblatex.sty delete mode 100644 dblatex/asciidoc-dblatex.xsl delete mode 100644 dblatex/dblatex-readme.txt diff --git a/.github/workflows/ghpages.yml b/.github/workflows/ghpages.yml index 6d9ee3c..fb025f4 100644 --- a/.github/workflows/ghpages.yml +++ b/.github/workflows/ghpages.yml @@ -1,8 +1,8 @@ name: Publish to gh-pages on: - release: - types: [created] + push: + branches: [ master ] jobs: build: diff --git a/asciidoc/a2x.py b/asciidoc/a2x.py index 32ee88e..756ae96 100644 --- a/asciidoc/a2x.py +++ b/asciidoc/a2x.py @@ -41,7 +41,11 @@ from urllib.parse import urlparse import zipfile import xml.dom.minidom import mimetypes -from . import asciidoc + +try: + from . import asciidoc +except ImportError: + import asciidoc CONF_DIR = os.path.join(os.path.dirname(__file__), 'resources') METADATA = {} diff --git a/asciidoc/resources/dblatex/asciidoc-dblatex.sty b/asciidoc/resources/dblatex/asciidoc-dblatex.sty new file mode 100644 index 0000000..309459f --- /dev/null +++ b/asciidoc/resources/dblatex/asciidoc-dblatex.sty @@ -0,0 +1,22 @@ +%% +%% 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} +% To preserve simple quotes in the blocs of code +\usepackage{upquote} diff --git a/asciidoc/resources/dblatex/asciidoc-dblatex.xsl b/asciidoc/resources/dblatex/asciidoc-dblatex.xsl new file mode 100644 index 0000000..3df2d2e --- /dev/null +++ b/asciidoc/resources/dblatex/asciidoc-dblatex.xsl @@ -0,0 +1,74 @@ + + + + + + colorlinks,linkcolor=blue,pdfstartview=FitH + 1 + + 1 + 0 + 3 + 0 + 0 + 1 + + + + 1 + + + + \begin{alltt} + \normalfont{} + + \end{alltt} + + + + + \pagebreak[4] + + + + + + \newline + + + + + \begin{center} + \line(1,0){444} + \end{center} + + + + diff --git a/asciidoc/resources/dblatex/dblatex-readme.txt b/asciidoc/resources/dblatex/dblatex-readme.txt new file mode 100644 index 0000000..026ef2b --- /dev/null +++ b/asciidoc/resources/dblatex/dblatex-readme.txt @@ -0,0 +1,39 @@ +AsciiDoc dblatex README +======================= + +Customization +------------- +The `./dblatex` directory contains: + +`./dblatex/asciidoc-dblatex.xsl`:: Optional dblatex XSL parameter +customization. + +`./dblatex/asciidoc-dblatex.sty`:: Optional customized LaTeX styles. + +Use these files with dblatex(1) `-p` and `-s` options, for example: + + dblatex -p ../dblatex/asciidoc-dblatex.xsl \ + -s ../dblatex/asciidoc-dblatex.sty article.xml + + +Limitations +----------- +Observed in dblatex 0.2.8. + +- dblatex doesn't seem to process the DocBook 'literallayout' element + correctly: it is rendered in a monospaced font and no inline + elements are processed. By default the normal font should be used + and almost all DocBook inline elements should be processed + (https://tdg.docbook.org/tdg/4.5/literallayout.html). I almost + fixed this by overriding the default dblatex literallayout template + (in `./dblatex/asciidoc-dblatex.xsl`) and using the LaTeX 'alltt' + package, but there are remaining problems: + + * Blank lines are replaced by a single space. + * The 'literallayout' element incorrectly wraps text when rendered + inside a table. + +- Callouts do not work inside DocBook 'literallayout' elements which + means callouts are not displayed inside AsciiDoc literal blocks. A + workaround is to change the AsciiDoc literal block to a listing + block. diff --git a/build_website.sh b/build_website.sh index 79dd0ee..62d0e35 100644 --- a/build_website.sh +++ b/build_website.sh @@ -12,10 +12,10 @@ ASCIIDOCDATE=$(sed -n '3p' configure.ac | grep -o -e "[0-9]* [A-Z][a-z]* [0-9]*" # execute this as a function so that we do not run afoul of bash's string interpolation / splitting # when trying to execute commands from variables asciidoc() { - python3 ../asciidoc.py -a revnumber="${ASCIIDOCVERSION}" -a revdate="${ASCIIDOCDATE}" "$@" + python3 ../asciidoc -a revnumber="${ASCIIDOCVERSION}" -a revdate="${ASCIIDOCDATE}" "$@" } -A2X="python3 ../a2x.py" +A2X="python3 ../asciidoc/a2x.py" # Step 0: Initialize the gh-pages folder if [ ! -d gh-pages ]; then @@ -33,15 +33,15 @@ popd # Step 1: Conslidate all files into the gh-pages directory files=( - docbook-xsl/asciidoc-docbook-xsl.txt - filters/graphviz/asciidoc-graphviz-sample.txt - stylesheets/asciidoc.css - javascripts/asciidoc.js - javascripts/ASCIIMathML.js + asciidoc/resources/docbook-xsl/asciidoc-docbook-xsl.txt + asciidoc/resources/filters/graphviz/asciidoc-graphviz-sample.txt + asciidoc/resources/stylesheets/asciidoc.css + asciidoc/resources/javascripts/asciidoc.js + asciidoc/resources/javascripts/ASCIIMathML.js CHANGELOG.txt INSTALL.txt - javascripts/LaTeXMathML.js - stylesheets/xhtml11-quirks.css + asciidoc/resources/javascripts/LaTeXMathML.js + asciidoc/resources/stylesheets/xhtml11-quirks.css ) for file in ${files[@]}; do @@ -55,6 +55,7 @@ set -x cp website/* gh-pages cp doc/*.txt gh-pages cp -R images gh-pages +cp -R asciidoc/resources/icons gh-pages/images cp doc/asciidoc.1.txt gh-pages/manpage.txt cp doc/asciidoc.txt gh-pages/userguide.txt @@ -96,7 +97,7 @@ ${ASCIIDOC} -b html5 -a icons -a toc2 -a theme=flask -o article-html5-toc2.html ${ASCIIDOC} -d manpage -b html4 asciidoc.1.txt ${ASCIIDOC} -b xhtml11 -d manpage -o asciidoc.1.css-embedded.html asciidoc.1.txt ${ASCIIDOC} -d manpage -b docbook asciidoc.1.txt -xsltproc --nonet ../docbook-xsl/manpage.xsl asciidoc.1.xml +xsltproc --nonet ../asciidoc/resources/docbook-xsl/manpage.xsl asciidoc.1.xml rm asciidoc.1.xml ${ASCIIDOC} -b xhtml11 -n -a toc -a toclevels=2 -o asciidoc.css-embedded.html asciidoc.txt @@ -107,7 +108,7 @@ mv asciidoc.chunked chunked # ${A2X} -f epub -d book --epubcheck --icons book.txt ${ASCIIDOC} -n -b docbook article.txt -xsltproc --nonet --stringparam admon.textlabel 0 ../docbook-xsl/fo.xsl article.xml > article.fo +xsltproc --nonet --stringparam admon.textlabel 0 ../asciidoc/resources/docbook-xsl/fo.xsl article.xml > article.fo fop article.fo article.pdf set +x rm article.xml @@ -115,7 +116,7 @@ rm article.fo set -x ${ASCIIDOC} -b docbook asciidoc.txt -dblatex -p ../dblatex/asciidoc-dblatex.xsl -s ../dblatex/asciidoc-dblatex.sty -o asciidoc.pdf asciidoc.xml +dblatex -p ../asciidoc/resources/dblatex/asciidoc-dblatex.xsl -s ../asciidoc/resources/dblatex/asciidoc-dblatex.sty -o asciidoc.pdf asciidoc.xml set +x rm asciidoc.xml diff --git a/configure.ac b/configure.ac index d29efbf..5fb953d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(asciidoc, 10.0.0a1) +AC_INIT(asciidoc, 9.0.5) AC_SUBST([PACKAGE_DATE], ['24 January 2021']) diff --git a/dblatex/asciidoc-dblatex.sty b/dblatex/asciidoc-dblatex.sty deleted file mode 100644 index 309459f..0000000 --- a/dblatex/asciidoc-dblatex.sty +++ /dev/null @@ -1,22 +0,0 @@ -%% -%% This style is derived from the docbook one. -%% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style] -%% Just use the original package and pass the options. -\RequirePackageWithOptions{docbook} - -% Sidebar is a boxed minipage that can contain verbatim. -% Changed shadow box to double box. -\renewenvironment{sidebar}[1][0.95\textwidth]{ - \hspace{0mm}\newline% - \noindent\begin{Sbox}\begin{minipage}{#1}% - \setlength\parskip{\medskipamount}% -}{ - \end{minipage}\end{Sbox}\doublebox{\TheSbox}% -} - -% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`. -\usepackage{alltt} -% To preserve simple quotes in the blocs of code -\usepackage{upquote} diff --git a/dblatex/asciidoc-dblatex.xsl b/dblatex/asciidoc-dblatex.xsl deleted file mode 100644 index 3df2d2e..0000000 --- a/dblatex/asciidoc-dblatex.xsl +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - colorlinks,linkcolor=blue,pdfstartview=FitH - 1 - - 1 - 0 - 3 - 0 - 0 - 1 - - - - 1 - - - - \begin{alltt} - \normalfont{} - - \end{alltt} - - - - - \pagebreak[4] - - - - - - \newline - - - - - \begin{center} - \line(1,0){444} - \end{center} - - - - diff --git a/dblatex/dblatex-readme.txt b/dblatex/dblatex-readme.txt deleted file mode 100644 index 026ef2b..0000000 --- a/dblatex/dblatex-readme.txt +++ /dev/null @@ -1,39 +0,0 @@ -AsciiDoc dblatex README -======================= - -Customization -------------- -The `./dblatex` directory contains: - -`./dblatex/asciidoc-dblatex.xsl`:: Optional dblatex XSL parameter -customization. - -`./dblatex/asciidoc-dblatex.sty`:: Optional customized LaTeX styles. - -Use these files with dblatex(1) `-p` and `-s` options, for example: - - dblatex -p ../dblatex/asciidoc-dblatex.xsl \ - -s ../dblatex/asciidoc-dblatex.sty article.xml - - -Limitations ------------ -Observed in dblatex 0.2.8. - -- dblatex doesn't seem to process the DocBook 'literallayout' element - correctly: it is rendered in a monospaced font and no inline - elements are processed. By default the normal font should be used - and almost all DocBook inline elements should be processed - (https://tdg.docbook.org/tdg/4.5/literallayout.html). I almost - fixed this by overriding the default dblatex literallayout template - (in `./dblatex/asciidoc-dblatex.xsl`) and using the LaTeX 'alltt' - package, but there are remaining problems: - - * Blank lines are replaced by a single space. - * The 'literallayout' element incorrectly wraps text when rendered - inside a table. - -- Callouts do not work inside DocBook 'literallayout' elements which - means callouts are not displayed inside AsciiDoc literal blocks. A - workaround is to change the AsciiDoc literal block to a listing - block. -- cgit v1.2.1