Initial commit: Klammertext source distribution
Curated source subset assembled by klammertext-dev's doc/make_dist.sh: the Klammermachine (mac), the Standard Klammer Set (sks), the commands (com), editor plugins and install guides (doc), a test subset (tst), and lib/bin placeholders. Builds with 'make -C com'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
74
sks/target/html_test.cpp
Normal file
74
sks/target/html_test.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
#include <iostream>
|
||||
#include "html_util.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << page("HTML target test",
|
||||
html("i", "An HTML page, all in italic text."),
|
||||
{"a.css", "b.css", "c.css"},
|
||||
{"j.js", "k.js", "l.js"}) << "\n";
|
||||
|
||||
}
|
||||
|
||||
//auto m { meta_elements() };
|
||||
|
||||
/*
|
||||
HTML h = html(
|
||||
"html", { html("head", meta_elements()),
|
||||
html("body", "body") });
|
||||
|
||||
std::cout << h << "\n";
|
||||
|
||||
std::cout << preamble() << "\n";
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
std::string body {};
|
||||
std::vector<HTML> page {};
|
||||
page.push_back(HTML("!DOCTYPE"));
|
||||
page.push_back(HTML("html")
|
||||
|
||||
|
||||
HTML head("head", {"
|
||||
<html lang="en">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HTML h("i", "italic text");
|
||||
h.attr("class", "italic").attr("style", "margin; 1em;");
|
||||
|
||||
HTML b("b", "bold text");
|
||||
b.cls("italic").sty("margin; 1em;");
|
||||
|
||||
|
||||
HTML img("img");
|
||||
img.attr("href", "dog.png").attr("class", "framed");
|
||||
|
||||
HTML p1("p", "paragraph 1");
|
||||
HTML p2("p", "paragraph 2");
|
||||
|
||||
|
||||
//std::vector<HTML> pars { p1, p2 };
|
||||
|
||||
//HTML body("body", pars);
|
||||
|
||||
HTML body("body", { p1, p2});
|
||||
HTML body2("body", { {"p", "paragraph 1"}, {"p", "paragraph 2"} });
|
||||
|
||||
//element_contents c {p1, p2};
|
||||
|
||||
|
||||
// std::cout << h << "\n" << b << "\n" << img << "\n"
|
||||
// << p1 << "\n" << p2
|
||||
// << body2
|
||||
// << "\n";
|
||||
|
||||
std::cout << body2 << "\n";
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user