Sha256: 31781f91d51e89ef77a2cfc2dfc02c2e47e1111762a1cfe01bafbc5e69969b4a

Contents?: true

Size: 831 Bytes

Versions: 13

Compression:

Stored size: 831 Bytes

Contents

module Juli
  module Macro
    class Base
      include Juli::Util

      # called on 'juli init' to generate config sample template.
      def self.conf_template
        ''
      end

      # called when juli(1) starts.
      def initialize
      end

      # called on setting up conf to set default key=val
      def set_conf_default(conf)
      end

      # called on each parsed document
      def on_root(file, root, visitor = nil)
      end

      # called on each macro as "\{macro_name args...}" in text.
      # String should be returned.
      def run(*args)
        ''
      end

      # called at final on each parsed document
      def after_root(file, root)
      end

    end

    Dir.glob(File.join(File.dirname(__FILE__), 'macro/*.rb')){|m|
      require File.join('juli/macro', File.basename(m))
    }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
juli-2.3.2 lib/juli/macro.rb
juli-2.3.1 lib/juli/macro.rb
juli-2.3.0 lib/juli/macro.rb
juli-2.2.4 lib/juli/macro.rb
juli-2.2.3 lib/juli/macro.rb
juli-2.2.1 lib/juli/macro.rb
juli-2.2.0 lib/juli/macro.rb
juli-2.1.0 lib/juli/macro.rb
juli-2.0.4 lib/juli/macro.rb
juli-2.0.3 lib/juli/macro.rb
juli-2.0.2 lib/juli/macro.rb
juli-2.0.1 lib/juli/macro.rb
juli-2.0.0 lib/juli/macro.rb