Replying to my own replies here…
I think I can pass the template_dir option to Asciidoctor in the attributes line:
set :asciidoc_attributes, %w(source-highlighter=coderay coderay-css=style template_dir=templates)
I see this reflected when examining the config:
:asciidoc = {:safe=>:safe,
:backend=>:html5,
:attributes=>
["env=middleman",
"env-middleman",
"middleman-version=3.4.1",
"source-highlighter=coderay",
"coderay-css=style",
"imagesdir=/img",
"source-highlighter=coderay",
"coderay-css=style",
"template_dir=templates",
"imagesdir=/img"],
:base_dir=>"/home/thoraxe/Red_Hat/openshift/discoverycenter/source"}
AsciiDoc engine options (Hash)
If I edit the template, I see that Middleman notices:
== File Change: source/templates/section.html.haml == Rebuilding resource list
Here’s the content of source/templates/section.html.haml
:
- slevel = @level == 0 && @special ? 1 : @level
- anchor = nil
- link = nil
- if @id
- if @document.attr? :sectanchors
- anchor = %(<a class="anchor" href="##{@id}"></a>)
- link = nil
- elsif @document.attr? :sectlinks
- anchor = nil
- link = %(<a class="link" href="##{@id}">)
- if slevel == 0
%h1{:id=>@id, :class=>"sect0"}=%(#{anchor}#{link}#{title}#{link && '</a>'})
=content
- else
%div{:class=>["sect#{slevel}", role]}
%p foo bar baz beta
- snum = @numbered && @caption.nil? && slevel <= (@document.attr 'sectnumlevels', 3).to_i ? %(#{sectnum} ) : nil
- haml_tag "h#{slevel + 1}##{@id}", %(#{anchor}#{link}#{snum}#{captioned_title}#{link && '</a>'})
- if slevel == 1
.sectionbody
=content
- else
=content
This is nipped directly from https://github.com/asciidoctor/asciidoctor-backends/blob/master/haml/html5/section.html.haml
Here’s the Asciidoc:
[[fundamentals]]
[.category-info.helper.pt0]
=== OpenShift Fundamentals
Here’s the resulting output HTML I’m seeing in the rendered page:
<div class="sect2 category-info helper pt0">
<h3 id="fundamentals">OpenShift Fundamentals</h3>
</div>
So, clearly the “foo bar baz” stuff is not being output.
I think I’m so close!