From 8ba0aff55c7aaf065fac9b6817fcecbaebb90ffa Mon Sep 17 00:00:00 2001 From: speedie Date: Mon, 13 May 2024 00:57:27 +0200 Subject: [PATCH] Revise examples a little bit. --- examples/biteme.lol.cpp | 17 ++++++----------- examples/hello-world.cpp | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/examples/biteme.lol.cpp b/examples/biteme.lol.cpp index 220b1ac..9bbaf09 100644 --- a/examples/biteme.lol.cpp +++ b/examples/biteme.lol.cpp @@ -15,10 +15,8 @@ int main() { html.push_back({"title", {}, "Google"}); - docpp::CSS::Stylesheet sheet{}; - - sheet.push_back(docpp::CSS::Element( - ".center", { + docpp::CSS::Stylesheet sheet{{ + {".center", { {"display", "flex"}, {"flex-wrap", "wrap"}, {"justify-content", "center"}, @@ -26,14 +24,11 @@ int main() { {"font-size", "10vw"}, {"height", "10vw"}, {"padding", "10vw"}, - } - )); - - sheet.push_back(docpp::CSS::Element( - "input[type=text], select", { + }}, + {"input[type=text], select", { {"width", "50vw"}, - } - )); + }}, + }}; html.push_back({"style", {}, sheet.get(docpp::CSS::FORMATTING_PRETTY)}); diff --git a/examples/hello-world.cpp b/examples/hello-world.cpp index a4f5cf9..e40c1d6 100644 --- a/examples/hello-world.cpp +++ b/examples/hello-world.cpp @@ -28,7 +28,7 @@ int main() { * * Note that it is very important that you do not append a section or element to a section until you have finished its construction, * because push_back() makes a copy of the object you pass to it. If you need to make changes later, you can use methods such as find() and swap(), - * or construct a new object. + * or construct a new object. An alternative is to append using the += operator, which does the same thing as push_back(). * * To get the section as an std::string object, call section.get(). */