hemplate

Simple XML template engine
git clone git://git.dimitrijedobrota.com/hemplate.git
Log | Files | Refs | README | LICENSE

hemplate_test.cpp (997B)


      1 #include <iostream>
      2 
      3 #include "hemplate/classes.hpp"
      4 #include "hemplate/attribute.hpp"
      5 
      6 int main()
      7 {
      8   using namespace hemplate;  // NOLINT
      9 
     10   const attributeList li_attrs({"class", "home_li"});
     11   const attributeList ul_attrs({{"id", "main_ul"},
     12                                 {"class", "home_ul"},
     13                                 {"style", "margin-bottom: 1em"}});
     14 
     15   std::cout << comment("Hello this is a commen");
     16   std::cout << html::html() << std::endl;
     17   std::cout << html::ul("Won't see", ul_attrs)
     18                    .set("style", "margin-top: 1em")
     19                    .set("class", "center")
     20                    .add(html::li("Item 1", li_attrs).set("class", "item1"))
     21                    .add(html::li("Item 2", li_attrs).set("class", "item2"))
     22             << std::endl;
     23   std::cout << html::meta() << std::endl;
     24   std::cout << html::html() << std::endl;
     25 
     26   std::cout << comment();
     27   std::cout << "split ";
     28   std::cout << "comment ";
     29   std::cout << comment() << std::endl;
     30 
     31   return 0;
     32 }