Readmix.Context (readmix v0.5.0)

Helpers to access the context in generator actions.

Summary

Functions

Returns a function that reads the given var from the given context.

Returns a section from the current rendering context at the same nesting level.

Functions

getter(context, key)

Returns a function that reads the given var from the given context.

The returned function with throw {:undef_var, key} if the variable is not defined.

lookup_rendered_section(context, section_name)

Returns a section from the current rendering context at the same nesting level.

This function can only retrieve sections that are defined above the calling generated block. If multiple sections share the same name, it will return the closest section, .i.e the last one in file order.