Disable line nubmers for specific listing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Disable line nubmers for specific listing

Fernando-Basso
I have enabled line numbers by default on the document:

:source-highlighter: pygments
:source-linenums-option:
:pygments-css: class

Is it possible to disable line numbers for specific code listings? Something
like this, perhaps?

[source,shell-session,nolinenums]

or

[source,shell-session,linenums!]

Tried both, by the way. Didn't work. Also, couldn't find docs on disabling
line numbers for specific listings. Perhaps it is not possible?
Reply | Threaded
Open this post in threaded view
|

Re: Disable line nubmers for specific listing

abelsromero

You can unset a value (https://asciidoctor.org/docs/user-manual/#using-attributes-set-assign-and-reference) using :!source-linenums-option: or :source-linenums-option!:.
But keep in mind this changes the value of the attribute from that point on. So if you want to disable it only in some parts, you have to set it again after.
Reply | Threaded
Open this post in threaded view
|

Re: Disable line nubmers for specific listing

Fernando-Basso
abelsromero wrote
You can unset a value (https://asciidoctor.org/docs/user-manual/#using-attributes-set-assign-and-reference) using :!source-linenums-option: or :source-linenums-option!:.
But keep in mind this changes the value of the attribute from that point on. So if you want to disable it only in some parts, you have to set it again after.
Cool. Thanks!