Skip to content

cardillo/htmlpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

htmlpp

You probably want a template engine... inja looks nice.
but if you're sure you don't, htmlpp will at least save you typing a few angle brackets.

GitHub Workflow Status Codecov

quick start

#include <html.hpp>

that's it. now you have access to the html:: namespace will all the tags and attributes you expect.

example

a more complete example, see example.cpp for the full source.

    server.run([](auto&& stream) {
        stream << html::indent;
        stream << html::html
            << html::head
            << html::script[html::language("javascript")]
            << "function sayHello() {" << std::endl
            << "  document.getElementById('message').innerHTML = 'Hello, world';" << std::endl
            << "}" << std::endl
            << html::head::end
            << html::body[html::attr("onload", "sayHello()")]
            << html::div[html::id("message")]
            << html::end;
    });
}

About

simple c++ header-only html tag library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published