html_stack 1.0.2

A stack based dsl for writing html. This is not an html template!
Documentation
  • Coverage
  • 6.25%
    1 out of 16 items documented1 out of 16 items with examples
  • Size
  • Source code size: 5.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 299.41 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • spacenegative

by extinct

A dsl (domain specific language) for writing html. This is NOT an html template. This library focus is on html composability. It uses a FILO stack paradigm.

usage

use html_stack::Stack ;
fn myhomepage() ->String  {
         let s = Stack::new() ;
         s .put("my homepage") .wrp("title") .wrp("head") ;
         s .put("my homepage") .wrp("h1") ;
         s .put("Lorem ipsum dolor sit amet, consectetur adipiscing elit.") .wrp("p") .add() ;
         s .put("") .wrp("img src=/img/image.jpg") .add() ;
         s .put("some link") .wrp("a href=/somelink/") .add() ;
         s .wrp("div class='class1 class2'")
         s .wrp("body") .add() ;
         s .put("") .wrp("script type=module src=/js/main.js") .add() ;
         s .wrp("html") ;
         return s .doctype() ;
         }