Sha256: fd47824f9a64d57beec226714c93ce3fc64685e6fe07b0573efe4ac724a505d1
Contents?: true
Size: 1.15 KB
Versions: 12
Compression:
Stored size: 1.15 KB
Contents
# ------------------------------------------------------------------------------ # ~/_plugins/asciidoctor-extensions/banner.rb # Asciidoctor extension for J1 Banner blocks # # Product/Info: # https://jekyll.one # # Copyright (C) 2023, 2024 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md # ------------------------------------------------------------------------------ require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal' include Asciidoctor # A block macro that embeds a banner block into the output document # # Usage # # banner::banner_id[role="additional classes"] # # Example: # # banner::home_teaser_banner[role="mb-5"] # Asciidoctor::Extensions.register do class J1BlockMacro < Extensions::BlockMacroProcessor use_dsl named :panel name_positional_attributes 'role' default_attributes 'role' => 'mt-3 mb-3' def process parent, target, attributes html = %( <div id="#{target}" class="#{attributes['role']}"></div> ) create_pass_block parent, html, attributes, subs: nil end end block_macro J1BlockMacro end
Version data entries
12 entries across 12 versions & 1 rubygems