#
# This file is modified from  /etc/asciidoc/filters/source/source-highlight-filter.conf
# and modified to support additional languages (ngc,halcmd)
# it is passed to asciidoc as -f <filename> option
#
# Michael Haberler 3/2011
#
#-------------
#
# AsciiDoc source code highlight filter configuration file.
#
# Documented in source-highlight-filter.txt in AsciiDoc distribution
# ./examples/website/ directory.
#
# HTML outputs require GNU source-highlight
# http://www.gnu.org/software/src-highlite/source-highlight.html
#

########################
# Source block templates
########################
[source-highlight-block]
template::[listingblock]

ifdef::basebackend-html[]
[source-highlight-block]
<a name="{id}"></a>
<p><b>{title}</b></p>
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
|
</td></tr></table>
endif::basebackend-html[]

# 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=}{title}</div>
<div class="content">
|
</div></div>
endif::backend-xhtml11[]

# Use DocBook programlisting element.
ifdef::backend-docbook[]
[source-highlight-block]
<formalpara{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><title>{title}</title><para>
<programlisting language="{language}" linenumbering="{src_numbered=unnumbered}">
|
</programlisting>
{title#}</para></formalpara>
endif::backend-docbook[]

#########################
# Source paragraph styles
#########################
[paradef-default]
ifdef::basebackend-html[]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f html  --data-dir={source_highlight_dir} -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}}"
endif::basebackend-html[]

ifdef::backend-xhtml11[]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f xhtml  --data-dir={source_highlight_dir} -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}}"
endif::backend-xhtml11[]

ifdef::backend-docbook[]
source-style=template="source-highlight-block",presubs=(),postsubs=("specialcharacters","callouts"),posattrs=("style","language","src_numbered","src_tab"),filter=""
endif::backend-docbook[]

#########################
# Source block styles
#########################
[blockdef-listing]
ifdef::basebackend-html[]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f html  --data-dir={source_highlight_dir} -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}}"
endif::basebackend-html[]

ifdef::backend-xhtml11[]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f xhtml   --data-dir={source_highlight_dir}  -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}}"
endif::backend-xhtml11[]

ifdef::backend-docbook[]
source-style=template="source-highlight-block",presubs=(),postsubs=("specialcharacters","callouts"),posattrs=("style","language","src_numbered","src_tab")
endif::backend-docbook[]


#
# 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
presubs=none
posattrs=language,src_numbered,src_tab

ifndef::backend-docbook[]
postsubs=callouts
# GNU Source Highlight filter.
filter=source-highlight -f {backend-xhtml11?xhtml}{backend-html4?html}{backend-docbook?docbook} -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}}
endif::backend-docbook[]

ifdef::backend-docbook[]
postsubs=specialcharacters,callouts
# In the case of DocBook just pass the listing through and let the DocBook
# toolchain handle it.
filter=
endif::backend-docbook[]

#
# DEPRECATED: End
#
