html_stack

Crates.iohtml_stack
lib.rshtml_stack
version1.0.2
sourcesrc
created_at2022-12-29 00:16:10.319802
updated_at2022-12-29 19:40:43.019434
descriptionA stack based dsl for writing html. This is not an html template!
homepage
repository
max_upload_size
id747058
size6,103
e X T i N C T (spacenegative)

documentation

README

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() ;
         }
Commit count: 0

cargo fmt