2.3.4 - Style Rules

  • Don't define a style within another style definition
  • Don't define a style within a built-in or style invocation
  • Recursive style use is okay, but, you must provide a sane exit strategy
  • Style names may contain any character except a space (0x20) or a newline (0x0a)
  • Styles that use other styles can be defined in any order, but:
  • Styles must be defined before they are used to generate content

Those last two rules call for some examples. Styles can be defined in any order with regard to each other because they are simply stored until they are actually used; execution is deferred until use. So all you're doing when you define a style is putting it away in exactly that form.

These patterns will all work:

[style s1 [b]]
style first; stored and deferred
{s1 test}
then generate - s1 is defined, all good.

[style s1 [b]]
style s1; stored and deferred
[style s2 {s1 [b]}]
style s2 uses style s1; stored and deferred
{s2 test}
then generate - s2 uses s1, both are present, all good.

[style s2 {s1 [b]}]
style s2 uses style s1; stored and deferred
[style s1 [b]]
style s1; stored and deferred
{s2 test}
then generate - s2 uses s1, both are present, all good.

None of these patterns will work:

{s1 test}
can't generate, s1 style not created yet
[style s1 [b]]
style s1; stored and deferred, but too late

[style s1 [b]]
style s1; stored and deferred
{s2 test}
can't generate, s2 style not created yet
[style s2 {s1 [b]}]
style s2 stored and deferred, but too late

[style s2 {s1 [b]}]
style s2 stored and deferred
{s2 test}
can't generate, s1 style, used by s2, not created yet
[style s1 [b]]
style s1; stored and deferred, but too late

{s2 test}
can't generate, neither s1 or s2 created yet
[style s2 {s1 [b]}]
style s2 stored and deferred
[style s1 [b]]
style s1; stored and deferred, but too late for attempt at generation

For the same reasons, you can create styles that will contain operations that will be present after a future  [import]  or  [embrace] , but you can't use those styles until the actual  [import]  or  [embrace]  has been processed in the usual inside-out, left-to-right fashion.

Keyboard Navigation
, Previous Page . Next Page t TOC i Index

Valid HTML 4.01 Loose
 

This manual was generated with wtfm
wtfm uses aa_macro and SqLite
aa_macro uses python 2.7