Skip to content

siegeon/magic.lambda.html

 
 

Repository files navigation

Parsing HTML from Hyperlambda

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

  • [html2lambda] - Creates a lambda object out of an HTML input string.

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

  • Build status
  • Quality Gate Status
  • Bugs
  • Code Smells
  • Coverage
  • Duplicated Lines (%)
  • Lines of Code
  • Maintainability Rating
  • Reliability Rating
  • Security Rating
  • Technical Debt
  • Vulnerabilities

About

HTML parsing for Magic and Hyperlambda

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C# 90.4%
  • Shell 9.6%