An {X| .. |}
tag invokes a programmatic output renderer (aka.
X-renderer).
Such an "X-renderer" may be of a built-in type, or of a custom one developed in Haskell and linked into the HaXtatic code-base manually. Naturally only the built-in types are covered here and in the X-renderers section.
Like T-tags (and unlike P- and B-tags), there are no predefined X-tags, only those declared and set up in *.haxproj files — ie. before an X-tag can be embedded many times anywhere in the project, it is first to be defined once in a *.haxproj: to be given a name and some default settings.
Here are the built-in X-renderers ready to set up and try out:
Outputs <h1>Hello World!</h1>
.
|X|demoSimplest:myTag
directive in a
*.haxproj file,
{X|myTag |}
Outputs <h4>Hello, <b>greetname!</b></h4>
.
|X|demoCfgArgs:myTag
or |X|demoCfgArgs:myTag:greetname
directive in a
*.haxproj file,
{X|myTag|}
or {X|myTag:greetname |}
Outputs <somehtmltag ..>tag's inner-markup content</somehtmltag>
.
|X|hax.miniTag:myTag:somehtmltag: ..
directive in a
*.haxproj file,
attr
{X|myTag: tag's inner-markup content |}
Outputs <img .. />
or <a ..><img .. /></a>
.
|X|hax.htmlImage:myTag:some/rel/base/path: ..
directive in a
*.haxproj file,
attrLink
, attrImg
, xmlEscape
{X|myTag:rel-to-base/path/no/whitespace and optionally some description text |}
Outputs <a ..>..</a>
.
|X|hax.htmlLink:myTag:some/rel/base/path: ..
directive in a
*.haxproj file,
attr
, xmlEscape
, uriAutoExt
{X|myTag:rel-to-base/path/no/whitespace and then the link text text |}
Helps with site navigation: outputs a sequence of <a href=".."> .. </a>
or
<outerhtmltag ..><a href=".."> .. </a></outerhtmltag>
in a uniform manner.
|X|hax.htmlLinks:myTag:outerhtmltag: ..
directive in a
*.haxproj file,
attr
, itemsFirst
, itemsLast
, wrapHref
{X|myTag: items = [..] , attr = [..] |}
Helps with page-level tables-of-content: outputs a sequence of
<a href="#.."> .. </a>
or
<outerhtmltag ..><a href="#.."> .. </a></outerhtmltag>
— one per <gatherhtmltag>
element found in the content source file.
|X|hax.htmlAnchors:myTag:gatherhtmltag: ..
directive in a
*.haxproj file,
considerEmpty
, outputIfEmpty
, xmlEscapeHref
{X|myTag:outerhtmltag: attr = [..] |}
Outputs the given content with all occurrences of any of & < > " '
each appropriately
entity-escaped for safe inclusion in HTML/XML/etc. markup.
|X|hax.xmlEscape:myTag
directive in a
*.haxproj file,
{X|myTag: any "content' to <> XML&HTML-escape |}
Outputs in a designated output format any input date/time text-values encoded in a designated input format.
|X|hax.dtFormat:myTag:dtf_in:dtf_out
directive in a
*.haxproj file,
{X|myTag: any date/time value currently formatted as inputdtfname or as YYYY-MM-DD |}
Outputs the given content with HTML/XML/etc. markup tags (but not entities outside such tags) naively replaced by space characters.
|X|hax.unMarkup:myTag
directive in a
*.haxproj file,
{X|myTag: any content to plain-text-ify |}
Outputs either the given content exactly-as-specified, or ignores it and outputs the pre-configured "constant" content.
|X|hax.noOp:myTag
or |X|hax.noOp:myTag:constant-content-here
directive in a
*.haxproj file,
{X|myTag: any content to output or discard here |}
Renders the named "snippet" (aka. "controls" / "components" / "sub-templates") substituting the specified named-parameter values.
|X|hax.snippet:myTag: ..
directive in a
*.haxproj file,
vars
, content
{X|myTag: vars = [..], content = ".." |}
Outputs a sequence of values from the specified enumerator, applying the specified filtering/ordering/limits.
|X|hax.iterator:myTag: ..
directive in a
*.haxproj file,
prefix
, suffix
, joinVia
, content
{X|myTag: .. |}
Renders posts from the specified feeds grouped as specified, delegating display logic to the specified X-tags.
|X|hax.feedView:myTag: ..
directive in a
*.haxproj file,
xnameGroupHeading
, feedWrap
, xnameFeedItem
, feedMore
{X|myTag: feeds = [..] , groups = [..] , xVars = [..] |}