Sha256: 3763186c158c6835ee57b156ba4729ebe471a103f2987018a082126e5a72d836

Contents?: true

Size: 1.17 KB

Versions: 80

Compression:

Stored size: 1.17 KB

Contents

# ------------------------------------------------------------------------------
# ~/_plugins/asciidoctor-extensions/admonition-block-question.rb
# Asciidoctor extension for J1 Template
#
# Product/Info:
# https://jekyll.one
#
# Copyright (C) 2021 Juergen Adams
#
# J1 Template is licensed under the MIT License.
# See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
#
# ------------------------------------------------------------------------------
require 'asciidoctor/extensions'
include Asciidoctor

# An extension that introduces a custom admonition type, complete
# with a custom icon.
#
# Usage
#
#   [QUESTION]
#   ====
#   What's the main tool for selecting colors?
#   ====
#
# or
#
#   [QUESTION]
#   What's the main tool for selecting colors?
#
Asciidoctor::Extensions.register do

  class CustomAdmonitionBlockQuestion < Extensions::BlockProcessor
    use_dsl
    named :QUESTION
    on_contexts :example, :paragraph

    def process parent, reader, attrs
      attrs['name'] = 'question'
      attrs['caption'] = 'Question'
      create_block parent, :admonition, reader.lines, attrs, content_model: :compound
    end
  end

  block CustomAdmonitionBlockQuestion

end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
j1-template-2022.0.18 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.17 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.16 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.15 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.14 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.13 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.12 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.11 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.10 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.9 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.8 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.7 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.6 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.5 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.4 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.3 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.2 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.1 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2022.0.0 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb
j1-template-2021.3.2 lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb