title: Hide header from ToC in Asciidoc / Asciidoctor
body: <p>I'd like to find a way to hide certain headers from the Table of Contents in my Asciidoc document, which I am processing with Asciidoctor to HTML and PDF.</p>
  
  <p>I have increased the <code>headerlevel</code> value to include some other sub-headers, but a side-effect of this is that some unwanted headers are now also present in the ToC of the output document.</p>
  
  <p>My document is composed dynamically from multiple source files using this kind of statement:</p>
  
  <pre><code>include::deployment/topic.adoc[leveloffset=+3]
  </code></pre>
  
  <p>Some of these headers should not appear in the ToC - including them would lead to a lot of repetition (they have similar content under each major header).</p>
  
  <p>E.g.:</p>
  
  <p>Each component topic has an H1 header that these 'leveloffset' attributes demote to h2, h3 etc. as required:</p>
  
  <pre><code>= My Topic Title
  </code></pre>
  
  <p>So my resolved document looks like this:</p>
  
  <pre><code>= Main Title (Keep in ToC)
  == H2 (Keep in ToC)
  === H3 (Keep in ToC)
  == H2 (Keep in ToC)
  === H3 (Remove from ToC)
  == H2 (Keep in ToC)
  === H3 (Remove from ToC)
  </code></pre>
  
  <p>I can't decrease <code>headerlevel</code> to remove the instances of <code>=== H3 (Remove from ToC)</code> without <strong>also</strong> removing <code>=== H3 (Keep in ToC)</code> from the ToC.</p>
  
  <p>I'm trying to keep the document modular. So making some headings simple bold text (using asterisks) is not ideal. I would like to keep them as headers, but add some kind of attribute to them that would mark them as 'non-ToC'.</p>
  
  <p>I'd be grateful for any hints or ideas.</p>
  
  <p>Thanks</p>