Module: Eggshell::MacroHandler

Overview

Macros are extensible functions that can do a lot of things:

  • include other Eggshell documents into current document

  • process part of a document into a variable

  • do conditional processing

  • do loop processing

  • etc.

A typical macro call looks like this: ‘@macro(param, param, …)` and must be the first item on the line (excluding whitespace).

If a macro encloses a chunk of document, it would generally look like this:

pre. @block_macro(param, …) misc content misc content

Defined Under Namespace

Modules: Defaults

Constant Summary collapse

COLLECT_NORMAL =
:collect_normal
COLLECT_RAW_MACRO =
:collect_raw_macro
COLLECT_RAW =
:collect_raw

Instance Method Summary collapse

Methods included from ProcessHandler

#process

Methods included from BaseHandler

#set_processor

Instance Method Details

#collection_type(macro) ⇒ Object

TODO:

needed?

Indicates how to process lines contained with in the macro. {COLLECT_NORMAL} continues to evaluate block and macro content. {COLLECT_RAW_MACRO} collects all lines as raw unless a macro is encountered. {COLLECT_RAW} collects all lines as raw, regardless of nested macros.



34
35
36
# File 'lib/eggshell/macro-handler.rb', line 34

def collection_type(macro)
	COLLECT_NORMAL
end