Unset Document Attributes
Document attributes—built-in, boolean, and custom—can be unset in the document header and document body.
Document attributes are unset by adding a bang symbol (
!) directly in front of or after the attribute’s name.
Like when setting an attribute in a document header, the attribute entry must be on its own line.
Don’t add a value to the entry.
= Title :!name: (1) :name!: (2)
|1||An attribute is unset when a
|2||An attribute is unset when a
Let’s use an attribute entry to turn off the built-in boolean attribute named
Asciidoctor automatically sets
sectids at processing time unless you unset it.
sectids attribute generates an ID for each section from the section’s title.
= Document Title :!sectids: (1)
|1||On a new line, type a colon (
Once an attribute is unset, its behavior is deactivated.
sectids is unset, Asciidoctor will not generate IDs from section titles at processing time.
Let’s unset the built-in attribute
This is an attribute that is set and assigned a default value of
Example automatically by Asciidoctor when you use an example block.
= Title :!example-caption: (1)
|1||Example blocks won’t be labeled and numbered, e.g., Example 1, because the attribute controlling that behavior is unset with the leading
Custom document attributes and some built-in document attributes can be turned off in the body of the document using an attribute entry and the bang symbol (
!) as described in the previous section.
For example, let’s say you set the section numbering attribute in the header of your document; however, you don’t want the two sections midway through the document to be numbered.
To disable the numbering on these two sections, you’d unset
sectnums before the first section you didn’t want numbered and then reset it when you wanted the numbering to start again.
= Title :sectnums: (1) == Section Title :!sectnums: (2) == Section Title === Section Title :sectnums: (3) == Section Title