diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-05-17 04:51:35 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-17 04:51:35 -0600 |
| commit | 2c6f8f231c6b4933e41278f561137e2021cbafee (patch) | |
| tree | 154173208869b4fb7f46fab38cc8b11188412c2f /docs/modules/extend/examples | |
| parent | a0eb966cb37ddcd816f6abea6dc591132ba2a733 (diff) | |
resolves #1597 add example of extended converter that adds change bars to paragraphs (PR #2186)
Diffstat (limited to 'docs/modules/extend/examples')
| -rw-r--r-- | docs/modules/extend/examples/pdf-converter-change-bars.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/modules/extend/examples/pdf-converter-change-bars.rb b/docs/modules/extend/examples/pdf-converter-change-bars.rb new file mode 100644 index 00000000..887a395d --- /dev/null +++ b/docs/modules/extend/examples/pdf-converter-change-bars.rb @@ -0,0 +1,15 @@ +class PDFConverterChangeBars < (Asciidoctor::Converter.for 'pdf') + register_for 'pdf' + + def convert_paragraph node + start_cursor = cursor + super + if node.role? 'changed' + float do + bounding_box [bounds.left - 4, start_cursor], width: 2, height: (start_cursor - cursor) do + fill_bounds 'FF0000' + end + end + end + end +end |
