module Eggshell::Bundles::Basic

Constants

BH

A block handler handles one or more lines as a unit as long as all the lines conform to the block's expectations.

Blocks are either identified explicitly:

pre. block_name. some content \ block_name({}). some content

Or, through some non-alphanumeric character:

pre. |table|start|inferred |another|row|here

When a handler can handle a line, it sets an internal block type (retrieved with {{current_type()}}). Subsequent lines are passed to {{continue_with()}} which returns `true` if the line conforms to the current type or `false` to close the block.

The line or lines are finally passed to {{process()}} to generate the output.

h2. Block Standards

When explicitly calling a block and passing a parameter, always expect the first argument to be a hash of various attributes:

pre. p({'class': '', 'id': '', 'attributes': {}}, other, arguments, …). paragraph start

BUNDLE_ID
EE
FH
MH

Public Class Methods

new_instance(proc, opts = nil) click to toggle source
# File lib/eggshell/bundles/basics.rb, line 8
def self.new_instance(proc, opts = nil)
        TextBlocks.new.set_processor(proc, opts)
        TableBlock.new.set_processor(proc, opts)
        ListBlocks.new.set_processor(proc, opts)
        SectionBlocks.new.set_processor(proc, opts)
        
        CoreMacros.new.set_processor(proc, opts)
        ControlLoopMacros.new.set_processor(proc, opts)
        DataLoaderMacro.new.set_processor(proc, opts)
        
        BasicFormatHandlers.new.set_processor(proc, opts)

        #proc.register_functions('', StdFunctions::FUNC_NAMES)
        proc.register_functions(Kernel, 'sprintf')
        proc.register_functions(Eggshell::Bundles::BasicFunctions, 'length,str_match,str_split,arr_push,arr_pop,arr_delete,map_put,map_delete')
end