Magic Cloud

An Open Source Application Generator


Magic Lambda HTML

This project provides HTML helper slots for Magic. More specifically, it provides the following slots.

Usage

.html:@"<html>
  <head>
    <title>Howdy</title>
  </head>
  <body>
    <p class=""foo""></p>
  </body>
</html>"
html2lambda:x:-

The above results in something resembling the following.

html2lambda
   html
      head
         title
            #text:Howdy
      body
         p
            @class:foo

Attributes starts out with the @ character, children nodes does not - While text content inside of elements will start out with #. This implies you’ll need to use escaped expression iterators when traversing the resulting node lambda object. For instance, to retrieve the above p element’s inner text, you could use something such as the following.

get-value:x:-/**/\#text

Project website

The source code for this repository can be found at github.com/polterguy/magic.lambda.html, and you can provide feedback, provide bug reports, etc at the same place.

Quality gates

License

This project is the copyright(c) 2020-2021 of Thomas Hansen thomas@servergardens.com, and is licensed under the terms of the LGPL version 3, as published by the Free Software Foundation. See the enclosed LICENSE file for details.