hemplate

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

hemplate_test.cpp (963B)


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