HaXtatic Docs

X-tags: dynamic renderers

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:

demoSimplest

Outputs <h1>Hello World!</h1>.

  1. Declaration of an |X|demoSimplest:myTag directive in a *.haxproj file,
    • further configuring: (no other settings)
  2. Usage anywhere: {X|myTag |}

demoCfgArgs

Outputs <h4>Hello, <b>greetname!</b></h4>.

  1. Declaration of an |X|demoCfgArgs:myTag or |X|demoCfgArgs:myTag:greetname directive in a *.haxproj file,
    • further configuring: (no other settings)
  2. Usage anywhere: {X|myTag|} or {X|myTag:greetname |}

hax.miniTag

Outputs  <somehtmltag ..>tag's inner-markup content</somehtmltag>.

  1. Declaration of an |X|hax.miniTag:myTag:somehtmltag: .. directive in a *.haxproj file,
    • further configuring: attr
  2. Usage anywhere: {X|myTag: tag's inner-markup content |}

hax.htmlImage

Outputs <img .. /> or <a ..><img .. /></a>.

  1. Declaration of an |X|hax.htmlImage:myTag:some/rel/base/path: .. directive in a *.haxproj file,
    • further configuring: attrLink, attrImg, xmlEscape
  2. Usage anywhere: {X|myTag:rel-to-base/path/no/whitespace and optionally some description text |}

Outputs <a ..>..</a>.

  1. Declaration of an |X|hax.htmlLink:myTag:some/rel/base/path: .. directive in a *.haxproj file,
    • further configuring: attr , xmlEscape , uriAutoExt
  2. Usage anywhere: {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.

  1. Declaration of an |X|hax.htmlLinks:myTag:outerhtmltag: .. directive in a *.haxproj file,
    • further configuring: attr, itemsFirst, itemsLast, wrapHref
  2. Usage anywhere: {X|myTag: items = [..] , attr = [..] |}

hax.htmlAnchors

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.

  1. Declaration of an |X|hax.htmlAnchors:myTag:gatherhtmltag: .. directive in a *.haxproj file,
    • further configuring: considerEmpty, outputIfEmpty, xmlEscapeHref
  2. Usage anywhere: {X|myTag:outerhtmltag: attr = [..] |}

hax.xmlEscape

Outputs the given content with all occurrences of any of & < > " ' each appropriately entity-escaped for safe inclusion in HTML/XML/etc. markup.

  1. Declaration of an |X|hax.xmlEscape:myTag directive in a *.haxproj file,
    • further configuring: (no other settings)
  2. Usage anywhere: {X|myTag: any "content' to <> XML&HTML-escape |}

hax.dtFormat

Outputs in a designated output format any input date/time text-values encoded in a designated input format.

  1. Declaration of an |X|hax.dtFormat:myTag:dtf_in:dtf_out directive in a *.haxproj file,
    • further configuring: (no other settings)
  2. Usage anywhere: {X|myTag: any date/time value currently formatted as inputdtfname or as YYYY-MM-DD |}

hax.unMarkup

Outputs the given content with HTML/XML/etc. markup tags (but not entities outside such tags) naively replaced by space characters.

  1. Declaration of an |X|hax.unMarkup:myTag directive in a *.haxproj file,
    • further configuring: (no other settings)
  2. Usage anywhere: {X|myTag: any content to plain-text-ify |}

hax.noOp

Outputs either the given content exactly-as-specified, or ignores it and outputs the pre-configured "constant" content.

  1. Declaration of an |X|hax.noOp:myTag or |X|hax.noOp:myTag:constant-content-here directive in a *.haxproj file,
    • further configuring: (no other settings)
  2. Usage anywhere: {X|myTag: any content to output or discard here |}

hax.snippet

Renders the named "snippet" (aka. "controls" / "components" / "sub-templates") substituting the specified named-parameter values.

  1. Declaration of an |X|hax.snippet:myTag: .. directive in a *.haxproj file,
    • further configuring: vars, content
  2. Usage anywhere: {X|myTag: vars = [..], content = ".." |}

hax.iterator

Outputs a sequence of values from the specified enumerator, applying the specified filtering/ordering/limits.

  1. Declaration of an |X|hax.iterator:myTag: .. directive in a *.haxproj file,
    • further configuring: prefix, suffix, joinVia, content
  2. Usage anywhere: {X|myTag: .. |}

hax.feedView

Renders posts from the specified feeds grouped as specified, delegating display logic to the specified X-tags.

  1. Declaration of an |X|hax.feedView:myTag: .. directive in a *.haxproj file,
    • further configuring: xnameGroupHeading, feedWrap, xnameFeedItem, feedMore
  2. Usage anywhere: {X|myTag: feeds = [..] , groups = [..] , xVars = [..] |}