Sha256: 24c4e64b05055c1a97d8e84eacb92c0fb2881fde0ee697b75eab3cfe141cd031
Contents?: true
Size: 997 Bytes
Versions: 11
Compression:
Stored size: 997 Bytes
Contents
# frozen_string_literal: true require 'asciidoctor' unless defined? Asciidoctor.load require_relative 'preprocessor' require_relative 'tree_processor' module Asciidoctor::Reducer module Extensions module_function def group proc do next if document.options[:reduced] preprocessor Preprocessor tree_processor TreeProcessor end end def key :reducer end def prepare_registry registry = nil registry = ::Asciidoctor::Extensions.create(®istry) if ::Proc === registry return registry if ::Asciidoctor::Extensions.groups[key] if registry registry.groups[key] = group registry else ::Asciidoctor::Extensions.create key, &group end end def register ::Asciidoctor::Extensions.register key, &group end def unregister ::Asciidoctor::Extensions.groups.delete key # NOTE `Extensions.unregister key` fails if groups is not initialized end end end
Version data entries
11 entries across 11 versions & 1 rubygems