diff options
Diffstat (limited to 'docs/modules/syntax-highlighting/pages/custom.adoc')
| -rw-r--r-- | docs/modules/syntax-highlighting/pages/custom.adoc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/modules/syntax-highlighting/pages/custom.adoc b/docs/modules/syntax-highlighting/pages/custom.adoc index 9c390d14..f7229321 100644 --- a/docs/modules/syntax-highlighting/pages/custom.adoc +++ b/docs/modules/syntax-highlighting/pages/custom.adoc @@ -52,6 +52,13 @@ Then, require this file when invoking Asciidoctor, setting `source-highlighter=p $ asciidoctor -r ./extended-pygments-syntax-highlighter.rb -a source-highlighter=pygments document.adoc +If you wanted to modify the built-in adapter to honor the location of a custom stylesheet specified by the `pygments-stylesheet` attribute, you can do so by extending the adapter and overriding the `docinfo` method. + +[,ruby] +---- +include::example$pygments-syntax-highlighter-with-custom-stylesheet.rb[] +---- + If you want to decorate built-in behavior, you can invoke the `super` method anywhere inside the method to delegate to the behavior provided by the built-in adapter. Let's say you always want lines to be numbered, regardless of the setting in the document. |
