Sha256: a6777fa78cbfedc256bb52658bcb03573736d61d9e746d66387721ef944729f4
Contents?: true
Size: 1.17 KB
Versions: 45
Compression:
Stored size: 1.17 KB
Contents
# ------------------------------------------------------------------------------ # ~/_plugins/asciidoctor-extensions/admonition-block-question.rb # Asciidoctor extension for J1 Theme # # Product/Info: # https://jekyll.one # # Copyright (C) 2023 Juergen Adams # # J1 Theme is licensed under the MIT License. # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md # # ------------------------------------------------------------------------------ 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
45 entries across 45 versions & 1 rubygems