Commit 8ac41d0c authored by asciidoc3's avatar asciidoc3

Merge branch 'master' into 'master'

Update for next release

See merge request !5
parents f2ce1798 d5a8c576
......@@ -27,3 +27,7 @@ images/slidy-example__1.md5
images/slidy-example__1.png
tests/__pycache__/
*.dat
dist/
asciidoc3.egg-info/
setupbeforewin.py
build/
include a2x3.py
include asciidoc3.conf
include asciidoc3.py
include asciidoc3api.py
include COPYING
include COPYRIGHT
include doc/*.*
include doc/images/
include docbook45.conf
include dblatex/dblatex-readme.txt
include dblatex/asciidoc3-dblatex.sty
include dblatex/asciidoc3-dblatex.xsl
include docbook-xsl/*.txt
include docbook-xsl/*.xsl
include filters/code/code-filter.conf
include filters/code/code-filter.py
include filters/code/code-filter-test.txt
include filters/code/code-filter-readme.txt
include filters/graphviz/graphviz-filter.conf
include filters/graphviz/graphviz2png.py
include filters/graphviz/asciidoc3-graphviz-sample.txt
include filters/graphviz/images/
include filters/latex/latex2png.py
include filters/latex/latex-filter.conf
include filters/music/music-filter.conf
include filters/music/music2png.py
include filters/music/music-filter-test.txt
include filters/music/images/
include filters/source/source-highlight-filter-test.txt
include filters/source/source-highlight-filter.conf
include help.conf
include html4.conf
include html5.conf
include images/icons/callouts/*.png
include images/icons/README
include images/icons/*.png
include images/*.png
include images/*.jpg
include javascripts/*.js
include lang-*.conf
include latex.conf
include LICENSE
include README.md
include slidy.conf
include stylesheets/*.css
include text.conf
include themes/flask/*.css
include themes/volnitsky/*.css
include tests/readme-tests.txt
include vim/readme-vim.txt
include vim/syntax/asciidoc3.vim
include xhtml11.conf
include a2x3.py
include asciidoc3.conf
include asciidoc3.py
include asciidoc3api.py
include COPYING
include COPYRIGHT
include doc/*.*
include doc/images
include docbook45.conf
include dblatex/dblatex-readme.txt
include dblatex/asciidoc3-dblatex.sty
include dblatex/asciidoc3-dblatex.xsl
include docbook-xsl/*.txt
include docbook-xsl/*.xsl
include filters/code/code-filter.conf
include filters/code/code-filter.py
include filters/code/code-filter-test.txt
include filters/code/code-filter-readme.txt
include filters/graphviz/graphviz-filter.conf
include filters/graphviz/graphviz2png.py
include filters/graphviz/asciidoc3-graphviz-sample.txt
include filters/graphviz/images/
include filters/latex/latex2png.py
include filters/latex/latex-filter.conf
include filters/music/music-filter.conf
include filters/music/music2png.py
include filters/music/music-filter-test.txt
include filters/music/images/
include filters/source/source-highlight-filter-test.txt
include filters/source/source-highlight-filter.conf
include help.conf
include html4.conf
include html5.conf
include images/icons/callouts/*.png
include images/icons/README
include images/icons/*.png
include images/*.png
include images/*.jpg
include javascripts/*.js
include lang-*.conf
include latex.conf
include LICENSE
include README.md
include slidy.conf
include stylesheets/*.css
include text.conf
include themes/flask/*.css
include themes/volnitsky/*.css
include tests/readme-tests.txt
include vim/readme-vim.txt
include vim/syntax/asciidoc3.vim
include xhtml11.conf
recursive-include doc *
recursive-include docbook-xsl *
recursive-include filters *
recursive-include images *
recursive-include javascripts *
recursive-include stylesheets *
recursive-include themes *
recursive-include vim *
recursive-include tests *
include *
include a2x3.py
include asciidoc3.conf
include asciidoc3.py
include asciidoc3api.py
include COPYING
include COPYRIGHT
include doc/*.*
include doc/images
include docbook45.conf
include dblatex/dblatex-readme.txt
include dblatex/asciidoc3-dblatex.sty
include dblatex/asciidoc3-dblatex.xsl
include docbook-xsl/*.txt
include docbook-xsl/*.xsl
include filters/code/code-filter.conf
include filters/code/code-filter.py
include filters/code/code-filter-test.txt
include filters/code/code-filter-readme.txt
include filters/graphviz/graphviz-filter.conf
include filters/graphviz/graphviz2png.py
include filters/graphviz/asciidoc3-graphviz-sample.txt
include filters/graphviz/images/
include filters/latex/latex2png.py
include filters/latex/latex-filter.conf
include filters/music/music-filter.conf
include filters/music/music2png.py
include filters/music/music-filter-test.txt
include filters/music/images/
include filters/source/source-highlight-filter-test.txt
include filters/source/source-highlight-filter.conf
include help.conf
include html4.conf
include html5.conf
include images/icons/callouts/*.png
include images/icons/README
include images/icons/*.png
include images/*.png
include images/*.jpg
include javascripts/*.js
include lang-*.conf
include latex.conf
include LICENSE
include README.md
include slidy.conf
include stylesheets/*.css
include text.conf
include themes/flask/*.css
include themes/volnitsky/*.css
include tests/readme-tests.txt
include vim/readme-vim.txt
include vim/syntax/asciidoc3.vim
include xhtml11.conf
name = "asciidoc3"
from . import asciidoc3
if __name__ == '__main__':
asciidoc3.main()
......@@ -3,12 +3,11 @@
a2x3 - A toolchain manager for AsciiDoc3 - converts AsciiDoc3 text files to other
file formats. See asciidoc3.org for more information.
Copyright: (c) 2009 Stuart Rackham <srackham@gmail.com> MIT
Copyright: (c) 2009 Stuart Rackham <srackham@gmail.com> MIT
Copyright: (c) 2018 Berthold Gehrke <berthold.gehrke@gmail.com> for Python3 version
License: GNU GPL v2 or higher
'''
import fnmatch
import html.parser
import mimetypes
......@@ -104,19 +103,23 @@ class AttrDict(dict):
except KeyError as k:
if '_default' in self:
return self['_default']
else:
raise AttributeError(k)
raise AttributeError(k)
def __setattr__(self, key, value):
self[key] = value
def __delattr__(self, key):
try:
del self[key]
except KeyError as k:
raise AttributeError(k)
def __repr__(self):
return '<AttrDict ' + dict.__repr__(self) + '>'
def __getstate__(self):
return dict(self)
def __setstate__(self, value):
for k, v in list(value.items()):
self[k] = v
......@@ -311,7 +314,7 @@ def find_files(path, pattern):
Return list of file names matching pattern in directory path.
'''
result = []
for (p, dirs, files) in os.walk(path):
for (p, __, files) in os.walk(path):
for f in files:
if fnmatch.fnmatch(f, pattern):
result.append(os.path.normpath(os.path.join(p, f)))
......@@ -367,7 +370,6 @@ def get_source_options(asciidoc3_file):
parse_options()
return result
#####################################################################
# Application class
#####################################################################
......@@ -431,7 +433,7 @@ class A2X3(AttrDict):
stdout = shell(self.asciidoc3 + ' --backend list')[0]
backends = [(i, os.path.split(i)[1]) for i in stdout.splitlines()]
backend_dir = [i[0] for i in backends if i[1] == self.backend]
if len(backend_dir) == 0:
if not backend_dir:
die('missing %s backend' % self.backend)
if len(backend_dir) > 1:
die('more than one %s backend' % self.backend)
......@@ -649,7 +651,31 @@ class A2X3(AttrDict):
file).
Executes the global function in an A2X3 class instance context.
'''
eval('to_%s(self)' % self.backend)
#eval('to_%s(self)' % self.backend) # avoid 'eval()'
if self.backend == 'docbook':
to_docbook(self)
elif self.backend == 'xhtml':
to_xhtml(self)
elif self.backend == 'manpage':
to_manpage(self)
elif self.backend == 'pdf':
to_pdf(self)
elif self.backend == 'dvi':
to_dvi(self)
elif self.backend == 'ps':
to_ps(self)
elif self.backend == 'tex':
to_tex(self)
elif self.backend == 'htmlhelp':
to_htmlhelp(self)
elif self.backend == 'chunked':
to_chunked(self)
elif self.backend == 'epub':
to_epub(self)
elif self.backend == 'text':
to_text(self)
else:
die('missing backend directive: %s' % self.backend)
def to_docbook(self):
'''
......@@ -810,7 +836,7 @@ class A2X3(AttrDict):
write_file('mimetype', 'application/epub+zip')
zip.write('mimetype', compress_type=zipfile.ZIP_STORED)
# Compress all remaining files.
for (p, dirs, files) in os.walk('.'):
for (p, __, files) in os.walk('.'):
for f in files:
f = os.path.normpath(os.path.join(p, f))
if f != 'mimetype':
......@@ -855,7 +881,8 @@ class A2X3(AttrDict):
# Script main line.
#####################################################################
if __name__ == '__main__':
def main():
global OPTIONS
description = '''A toolchain manager for AsciiDoc3
(converts Asciidoc3 text files to other file formats)'''
from optparse import OptionParser
......@@ -970,7 +997,9 @@ if __name__ == '__main__':
opts.fop_opts = ' '.join(opts.fop_opts)
opts.xsltproc_opts = ' '.join(opts.xsltproc_opts)
opts.backend_opts = ' '.join(opts.backend_opts)
opts = eval(str(opts)) # Convert optparse.Values to dict.
# avoid 'eval()' found in v2
#opts = eval(str(opts)) # Convert optparse.Values to dict.
opts = vars(opts)
a2x3 = A2X3(opts)
OPTIONS = a2x3 # verbose and dry_run used by utility functions.
verbose('args: %r' % argv)
......@@ -979,5 +1008,7 @@ if __name__ == '__main__':
a2x3.load_conf()
a2x3.execute()
except KeyboardInterrupt:
exit(1)
sys.exit(1)
if __name__ == '__main__':
main()
This diff is collapsed.
#!/usr/bin/env python3
"""
This script sets some symlinks inside the AsciiDoc3 package
installed via pip / pip3 from 'https://pypi.org/project/asciidoc3/'.
Run it immediately subsequently after install.
See https://asciidoc3.org/pypi.html for more information.
Copyright (C) 2018 by Berthold Gehrke <berthold.gehrke@gmail.com>
Free use of this software is granted under the terms of the
GNU General Public License Version 2 or higher (GNU GPLv2+).
"""
import os
import re
import subprocess
import sys
USERHOMEDIR = os.path.expanduser("~") # e.g. GNU/Linux: USERHOMEDIR = '/home/<username>'
def main():
"""
runs "pip show asciidoc3" to locate AsciiDoc3's config-dirs and sets symlinks;
at first within AsciiDoc3, than from the user's home directory.
"""
ad3_location = ''
try:
runpip = subprocess.Popen("pip show asciidoc3", shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, universal_newlines=True, bufsize=-1)
runpip.wait()
pip_show_status = runpip.returncode
if pip_show_status:
sys.exit("FATAL: 'pip show asciidoc3' ends with non-zero exit code")
output = runpip.communicate()
except OSError:
sys.exit("FATAL: 'pip show asciidoc3' ends with an unidentified error ...")
if output:
output = output[0]
output = re.split(r'Location: ', output, re.DOTALL)[1]
output = re.split(r'\nRequires', output, re.DOTALL)[0]
ad3_location = output
# ad3_location <class 'str'> looks like this:
# '/home/<username>/.local/lib/python3.5/site-packages'
else:
# no output
sys.exit("FATAL: 'pip show asciidoc3' gives no information ...")
# AsciiDoc3 distribution, set internal (relative) symlinks.
# <...>/asciidoc3/filters/music/images --> ../../images
if os.path.exists(ad3_location + "/asciidoc3/filters/music/images"):
os.unlink(ad3_location + "/asciidoc3/filters/music/images")
os.symlink(os.path.relpath(
ad3_location + "/asciidoc3/images", ad3_location + "/asciidoc3/filters/music"),
ad3_location + "/asciidoc3/filters/music/images")
# <...>/asciidoc3/filters/graphviz/images --> ../../images
if os.path.exists(ad3_location + "/asciidoc3/filters/graphviz/images"):
os.unlink(ad3_location + "/asciidoc3/filters/graphviz/images")
os.symlink(os.path.relpath(
ad3_location + "/asciidoc3/images", ad3_location + "/asciidoc3/graphviz/music"),
ad3_location + "/asciidoc3/filters/graphviz/images")
# <...>/asciidoc3/doc/images --> ../images
if os.path.exists(ad3_location + "/asciidoc3/doc/images"):
os.unlink(ad3_location + "/asciidoc3/doc/images")
os.symlink(os.path.relpath(
ad3_location + "/asciidoc3/images", ad3_location + "/asciidoc3/doc"),
ad3_location + "/asciidoc3/doc/images")
# Set symlinks user home to AsciiDoc3's 'working/config' directories'
# Skip if running as root.
if USERHOMEDIR != '/root':
if os.path.exists(USERHOMEDIR + "/.asciidoc3"):
os.replace(USERHOMEDIR + "/.asciidoc3", USERHOMEDIR + "/.asciidoc3_backup")
os.symlink(ad3_location + "/asciidoc3", USERHOMEDIR + "/.asciidoc3")
if os.path.exists(USERHOMEDIR + "/asciidoc3"):
os.replace(USERHOMEDIR + "/asciidoc3", USERHOMEDIR + "/asciidoc3_backup")
os.symlink(ad3_location + "/asciidoc3", USERHOMEDIR + "/asciidoc3")
if __name__ == '__main__':
main()
<!--
article-docinfo.xml
Example DocBook document information file for article.txt.
-->
<authorgroup>
<author>
<honorific>Dr</honorific>
<firstname>Lois</firstname>
<surname>Common-Demoninator</surname>
<affiliation>
<shortaffil>Director, M. Behn School of Coop. Eng.</shortaffil>
<jobtitle>Director of Cooperative Efforts</jobtitle>
<orgname>The Marguerite Behn International School of
Cooperative Engineering</orgname>
</affiliation>
</author>
<author>
<honorific>Mr</honorific>
<firstname>Steven</firstname>
<surname>Norman</surname>
<othername role='mi'>T</othername>
<affiliation>
<shortaffil>ATI</shortaffil>
<jobtitle>Senior Application Analyst</jobtitle>
<orgname>Foobar, Inc.</orgname>
<orgdiv>Application Development</orgdiv>
</affiliation>
</author>
<editor>
<firstname>Peter</firstname>
<surname>Pan</surname>
<lineage>Sr.</lineage>
<othername>Spiderman</othername>
<authorblurb>
<para>
Peter's a super hero in his spare time.
</para>
</authorblurb>
</editor>
</authorgroup>
<copyright>
<year>2009</year>
<holder>Behn International</holder>
</copyright>
<legalnotice>
<simpara>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
</simpara>
<simpara>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
</simpara>
<simpara>
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</simpara>
</legalnotice>
<revhistory>
<revision>
<revnumber>1.1</revnumber>
<date>May 2009</date>
<authorinitials>PP</authorinitials>
<revremark>
Updates.
</revremark>
</revision>
<revision>
<revnumber>1.0</revnumber>
<date>October 2003</date>
<authorinitials>PP</authorinitials>
<revremark>
First release.
</revremark>
</revision>
</revhistory>
......@@ -6,20 +6,17 @@ a clever JavaScript written by Peter Jipsen that dynamically
transforms mathematical formulae written in a wiki-like plain text
markup to http://www.w3.org/Math/[MathML] markup which is displayed as
standard mathematical notation by the Web Browser. See 'Appendix E'
in the AsciiDoc User Guide for more details.
in the AsciiDoc3 User Guide for more details.
The AsciiDoc `xhtml11` backend supports ASCIIMathML -- it links the
The AsciiDoc3 `xhtml11` backend supports ASCIIMathML -- it links the
ASCIIMathML script and escapes ASCIIMathML delimiters and special
characters to yield valid XHTML. To use ASCIIMathML:
1. Include the `-a asciimath` command-line option when you run
`asciidoc(1)`.
`asciidoc3(1)`.
2. Enclose ASCIIMathML formulas inside math or double-dollar
passthroughs or in math passthrough blocks.
Here's the link:asciimathml.txt[AsciiDoc source] that generated this
page.
.NOTE
- When you use the `asciimath:[]` inline macro you need to escape `]`
characters in the formulas with a backslash, escaping is unnecessary
......
Multi-Part Book Title Goes Here
===============================
Author's Name
v1.0, 2003-12
v3.0, 2018-05
:doctype: book
......@@ -10,13 +10,13 @@ Example Dedication
==================
The optional dedication goes here.
This document is an AsciiDoc multi-part book skeleton containing
This document is an AsciiDoc3 multi-part book skeleton containing
briefly annotated element placeholders plus a couple of example index
entries and footnotes. Books are normally used to generate DocBook
markup and the preface, appendix, bibliography, glossary and index
section titles are significant ('specialsections').
NOTE: Multi-part books differ from all other AsciiDoc document formats
NOTE: Multi-part books differ from all other AsciiDoc3 document formats
in that top level sections (dedication, preface, book parts,
appendices, bibliography, glossary, index) must be level zero headings
(not level one).
......
......@@ -7,21 +7,25 @@
[graphviz-filter-style]
# When the filter output image is data-uri encoded write it to the indir
# (instead of the outdir) so that encoder can find it.
ifndef::data-uri[]
#{sys:"{python3}" -u -c "print("hallo")"}
#graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "{outdir={indir}}/{imagesdir=}
# {imagesdir?/}{target}" -L {layout=dot} -F {format=png} -'
ifndef::data-uri[]
graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "{outdir={indir}}/{imagesdir=}/{target}" -L {layout=dot} -F {format=png} -'
#graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "home/bge/ad3bgemucfork/asciidoc3/filters/graphviz/#{target}" -L {layout=dot} -F {format=png} -'
# {outdir={indir}}/{imagesdir=}{imagesdir?/}{target}
endif::data-uri[]
ifdef::data-uri[]
graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "{imagesdir=}{imagesdir?/}{target}" -L {layout=dot} -F {format=png} -'
endif::data-uri[]
# [graphviz-filter-style] AsciDoc 8.6.9 Python 2
# When the filter output image ... can find it.
# ifndef::data-uri[]
# graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -L # {layout=dot} -F {format=png} -'
# endif::data-uri[]
# ifdef::data-uri[]
# graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "{indir={outdir}}/{imagesdir=}{imagesdir?/}{target}" -L # {layout=dot} -F {format=png} -'
# endif::data-uri[]
[blockdef-open]
template::[graphviz-filter-style]
......@@ -58,3 +62,4 @@ filter=graphviz2png.py {verbose?-v} -o "{outdir={indir}}/{target}" -L {layout=do
posattrs=target,format
#
# DEPRECATED: End
#
......@@ -15,6 +15,17 @@ ifdef::data-uri[]
latex-style=template="latex-block",subs=(),posattrs=("style","target","dpi"),filter='latex2png.py -m{verbose? -v}{dpi? -D {dpi}} -o "{imagesdir=}{imagesdir?/}{target}" -'
endif::data-uri[]
# [latex-filter-style] from AsciiDoc 8.6.9 Python 2
# When the ... find it.
# ifndef::data-uri[]
# latex-style=template="latex-block",subs=(),posattrs=("style","target","dpi"),filter='latex2png.py -m{verbose? -v}{dpi? -D {dpi}} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -'
# endif::data-uri[]
# ifdef::data-uri[]
# latex-style=template="latex-block",subs=(),posattrs=("style","target","dpi"),filter='latex2png.py -m{verbose? -v}{dpi? -D {dpi}} -o "{indir={outdir}}/{imagesdir=}{imagesdir?/}{target}" -'
# endif::data-uri[]
[blockdef-open]
template::[latex-filter-style]
......
......@@ -16,6 +16,15 @@ ifdef::data-uri[]
music-style=template="music-block",subs=(),posattrs=("style","target","format"),filter='music2png.py -m{verbose? -v}{format? -f {format}} -o "{imagesdir=}{imagesdir?/}{target}" -'
endif::data-uri[]
# [music-filter-style] from AsciiDoc 8.6.9 (Python2)
# When the ... can find it.
# ifndef::data-uri[]
# music-style=template="music-block",subs=(),posattrs=("style","target","format"),filter='music2png.py -m{verbose? -v}{format? -f {format}} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -'
# endif::data-uri[]
# ifdef::data-uri[]
# music-style=template="music-block",subs=(),posattrs=("style","target","format"),filter='music2png.py -m{verbose? -v}{format? -f {format}} -o "{indir={outdir}}/{imagesdir=}{imagesdir?/}{target}" -'
# endif::data-uri[]
[blockdef-open]
template::[music-filter-style]
......
#
# AsciiDoc source code highlight filter configuration file.
#
# Documented in source-hightlight-filter.txt in AsciiDoc distribution
# ./examples/website/ directory.
#
# HTML outputs require GNU source-highlight (xhtml11, html4 outputs)
# http://www.gnu.org/software/src-highlite/source-highlight.html
#
# or Pygments (xhtml11 outputs):
# http://pygments.org/
#
# GNU source-hightlight is default, define the 'pygments' attribute to use
# Pygments.
#
########################
# Source block templates
########################
[source-highlight-block]
template::[listingblock]
ifdef::basebackend-html[]
[source-highlight-block]
<a name="{id}"></a>
<p><b>{title}</b></p>
<table{role? class="{role}"} border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
{source-highlighter$highlight:}<pre><code>
|
{source-highlighter$highlight:}</code></pre>
</td></tr></table>
endif::basebackend-html[]
ifdef::basebackend-xhtml11,basebackend-html5[]
[source-highlight-block]
<div class="listingblock{role? {role}}">
<a id="{id}"></a>
<div class="title">{caption=}{title}</div>
<div class="content">
{source-highlighter$highlight:}<pre><code>
|
{source-highlighter$highlight:}</code></pre>
</div></div>
endif::basebackend-xhtml11,basebackend-html5[]
# Use DocBook programlisting element.
ifdef::basebackend-docbook[]
[source-highlight-block]
<formalpara{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><title>{title}</title><para>
{title#}<programlisting language="{language}" linenumbering="{src_numbered=unnumbered}"{args? {args}}>
{title%}<programlisting language="{language}"{role? role="{role}"} linenumbering="{src_numbered=unnumbered}"{args? {args}}>
|
</programlisting>
{title#}</para></formalpara>
endif::basebackend-docbook[]
# Source styles template.
ifdef::basebackend-html[]
[source-filter-style]
ifeval::["{source-highlighter}"=="source-highlight"]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f xhtml -s {language} {src_numbered?--line-number=' '} {src_tab?--tab={src_tab}} {args=}"
endif::[]
ifeval::["{source-highlighter}"=="highlight"]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="highlight --no-doc --inline-css --out-format=xhtml --syntax={language@python:py:{language}} {src_numbered?--line-number} {src_tab?--tab={src_tab}} --encoding={encoding} {args=}"
endif::[]
ifeval::["{source-highlighter}"=="pygments"]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered"),filter="pygmentize"
endif::[]
# DEPRECATED: 'pygments' attribute.
ifdef::pygments[]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered"),filter="pygmentize -f html -l {language} {args=}"
endif::[]
endif::basebackend-html[]
ifdef::basebackend-html4[]
[source-filter-style]
# html4 does not use pygments.
ifeval::["{source-highlighter}"=="source-highlight"]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f html -s {language} {src_numbered?--line-number=' '} {src_tab?--tab={src_tab}} {args=}"
endif::[]
ifeval::["{source-highlighter}"=="highlight"]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="highlight --no-doc --inline-css --out-format=html --syntax={language@python:py:{language}} {src_numbered?--line-number} {src_tab?--tab={src_tab}} {args=}"
endif::[]
endif::basebackend-html4[]
ifdef::basebackend-docbook[]
[source-filter-style]
source-style=template="source-highlight-block",presubs=(),postsubs=("specialcharacters","callouts"),posattrs=("style","language","src_numbered","src_tab")
endif::basebackend-docbook[]
#########################
# Source paragraph styles
#########################
[paradef-default]
template::[source-filter-style]
[paradef-literal]
template::[source-filter-style]
#########################
# Source block styles
#########################
[blockdef-open]
template::[source-filter-style]
[blockdef-listing]
template::[source-filter-style]
#
# DEPRECATED: Pre 8.2.7 filter definition.
#
#########################
# Source block definition
#########################
[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