Sha256: ea1d54b4d3826f2cfad1918b271c3e44dd9776b88edc7cec103e918df1637f95

Contents?: true

Size: 1.03 KB

Versions: 38

Compression:

Stored size: 1.03 KB

Contents

# ------------------------------------------------------------------------------
# ~/_plugins/asciidoctor-extensions/conum.rb
# Asciidoctor extension for conums
#
# Product/Info:
# https://jekyll.one
#
# Copyright (C) 2022 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' unless RUBY_ENGINE == 'opal'
include Asciidoctor

# A inline macro that embeds a conum into the output document
#
# Usage
# ------------------------------------------------------------------------------
#   conum::<num>[]
#
# Example:
#
#   conum:1[]
#
# ------------------------------------------------------------------------------
Asciidoctor::Extensions.register do
  inline_macro do
    named :conum
    process do |parent, target, attrs|
      # TODO validate that this conum is valid
      Asciidoctor::Inline.new(parent, :callout, target.to_i).convert
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
j1-template-2022.6.3 lib/starter_web/_plugins/asciidoctor/conum.rb
j1-template-2022.6.2 lib/starter_web/_plugins/asciidoctor/conum.rb
j1-template-2022.6.1 lib/starter_web/_plugins/asciidoctor/conum.rb
j1-template-2022.6.0 lib/starter_web/_plugins/asciidoctor/conum.rb
j1-template-2022.5.3 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.2 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.1 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.1.rc1 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.1.rc0 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.0 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.0.rc4 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.0.rc3 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.0.rc2 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.0.rc1 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.5.0.rc0 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.4.10 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.4.9 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.4.8 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.4.7 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb
j1-template-2022.4.6 lib/starter_web/_plugins/asciidoctor-extensions/conum.rb