<%flags>inherit='document_base.myt' <&|doclib.myt:item, name="otherblocks", description="Other Blocks", &>

Myghty has some miscellaneous <% "<%xxxx>" %> blocks, whose contents are less than pure Python. The most important is the <% "<%flags>" %> section, since it controls several important behaviors of a component.

<&|doclib.myt:item, name="flags", description="<%flags>", escapedesc=True &>

%flags is used to specify special properties of the component, which are significant to the execution of the component in the Myghty environment. Some flags can be inherited from a parent supercomponent, and overridden as well. Current flags are:

Flags may be specified via the <% "<%flags>" %> tag, or for subcomponents and methods may be specified as inline attributes within the <% "<%def> or <%method>" %> tags. The <% "<%flags>" %> tag may appear anywhere in a component, or even across multiple %flags sections, and will still take effect before a component is actually executed.

Example: the <% "<%flags>"%> tag:

<&|formatting.myt:code&><%text> <%flags> inherit = None autoflush = True <%python scope="init"> ...

Example: subcomponent flags as attributes:

<&|formatting.myt:code&><%text> <%method getlink trim="both"> <%init> lala <&|doclib.myt:item, name="attr", description="<%attr>", escapedesc=True &>

%attr simply sets some attributes on the component. These attributes are accessed via the <&formatting.myt:link, path="components_members", member="attributes"&> member of the component. Below, two attributes are accessed from a component to provide style information. One uses <& formatting.myt:link, path="request_members", member="current_component"&>, and the other uses <& formatting.myt:link, path="request_members", member="base_component"&>. The difference is the former always returns the very same component that is currently executing, whereas the latter corresponds to the component at the bottom of the inheritance chain:

<&|formatting.myt:code&><%text> <%attr> bgcolor = "#FF0000" fgcolor = "#FA456A" # ...

In both cases, if the attribute does not exist in the current component or within futher inheriting child components, it will then traverse upwards via parent components to locate the attribute. For more information on parent/child relationships between components, see the section <&formatting.myt:link,path="inheritance"&>.

<&|doclib.myt:item, name="text", description="<%text>", escapedesc=True &>

%text surrounds a block where Myghty will not parse for control lines, line comments, substitutions, or any other Myghty tag. This allows the placement of free text which is intended to print as is, even if it may contain characters that are normally significant to the Myghty lexer. The %text tag is also essential for writing documentation that illustrates examples of Myghty (or similar) code.

<&|doclib.myt:item, name="doc", description="<%doc>", escapedesc=True &>

%doc is simply a comment string - the content inside of a <% "<%doc>" %> section is discarded upon compilation. Comments can also be stated on a per-line basis using a '#' character as the very first character on a line, as described in <&formatting.myt:link, path="embedding_comment" &>.