Skip to content

websitegenerator v2.5.0

Choose a tag to compare

@nirokay nirokay released this 07 Mar 18:39
· 6 commits to master since this release
530ae2f

Breaking Changes (will break code from older versions)

  • renamed all former => procs for HtmlAttribute construction to -= (sugar submodule)
    procs => now exclusively for HtmlElement construction
  • newHtmlElement with varargs[HtmlElementAttribute] arguments removed

New

  • XML support is finally ready
    Types: new XmlDocument type, XmlElement and XmlElementAttribute map to HtmlElement and HtmlElementAttribute respectively
    Procs: newXmlDocument, newXmlElement and this types $, add and writeFile procs
  • newHtmlElement with varargs[HtmlElement] arguments introduced (actual implementation is scary, look up at your own risk...)
    newHtmlElement rewritten using the newElementGenerator template
    These functions can now accept children of many types, and is extensible by the user:
    Example:
    assert $newHtmlElement("tag", "line1", "line2", "line3") == """<tag>line1<br />line2<br />line3</tag>"""
    The separator can be changed: const wgsRawTextSeparator* {.strdefine.}: string = "br", setting it to "", will join items without separator tag
  • <$> procs convert non-HtmlElement types to HtmlElement rawText
  • $<$> proc converts via <$> to HtmlElement and then to string (equivalent to $(<$>"Some Text"))
  • added getTargetDirectory proc

Changes

  • newHtmlElement procs