diff options
| author | Robert Bennett <rltbennett@icloud.com> | 2021-12-23 23:58:33 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2021-12-23 23:59:16 -0700 |
| commit | 40fc0fe353ebd45eea3751356c4760758ebeabcf (patch) | |
| tree | 868b4c0f6d6a96dba1afabe279f652bf97b03307 /docs/modules/syntax-highlighting/examples | |
| parent | de54df6307c2b1ad6db5a7f0b305b730b7afb096 (diff) | |
added example to docs of extending the pygments adapter to link to a custom stylesheet
Diffstat (limited to 'docs/modules/syntax-highlighting/examples')
| -rw-r--r-- | docs/modules/syntax-highlighting/examples/pygments-syntax-highlighter-with-custom-stylesheet.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/modules/syntax-highlighting/examples/pygments-syntax-highlighter-with-custom-stylesheet.rb b/docs/modules/syntax-highlighting/examples/pygments-syntax-highlighter-with-custom-stylesheet.rb new file mode 100644 index 00000000..9c6fdae1 --- /dev/null +++ b/docs/modules/syntax-highlighting/examples/pygments-syntax-highlighter-with-custom-stylesheet.rb @@ -0,0 +1,12 @@ +class MyPygmentsAdapter < (Asciidoctor::SyntaxHighlighter.for 'pygments') + register_for :pygments + + def write_stylesheet? doc + false + end + + def docinfo location, doc, opts + slash = opts[:self_closing_tag_slash] + %(<link rel="stylesheet" href="/styles/syntax-theme.css"#{slash}>) + end +end |
