diff --git a/Crafter.CppDOM.cppm b/Crafter.CppDOM.cppm index b264112..d275bac 100644 --- a/Crafter.CppDOM.cppm +++ b/Crafter.CppDOM.cppm @@ -36,7 +36,7 @@ extern "C" { -export namespace Crafter::CppDOM::Bindings { +export namespace Crafter::CppDOM { __attribute__((import_module("env"), import_name("setInnerHTML"))) void SetInnerHTML(const char* id, std::size_t idLenght, const char* html, std::size_t htmlLenght); // __attribute__((import_module("env"), import_name("strokeRect"))) void StrokeRect(std::uint64_t id, std::uint32_t x, std::uint32_t y, std::uint32_t width, std::uint32_t height, const char* color, std::size_t colorLenght); // __attribute__((import_module("env"), import_name("putImageData"))) void PutImageData(std::uint64_t id, Crafter::Web::Pixel* buffer, std::uint32_t width, std::uint32_t height); diff --git a/README.md b/README.md index 5916984..ce2e261 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ using namespace Crafter::Web; int main() { const char id[] = "body"; const char content = "

Hello from C++!

"; - Crafter::CppDOM::Bindings::SetInnerHTML(id, sizeof(id)-1, content.c_str(), content.size()-1); + Crafter::CppDOM::SetInnerHTML(id, sizeof(id)-1, content.c_str(), content.size()-1); } ``` Save and close, then run ``crafter-webbuild serve -c debug``. Now you can open the browser at ``http://localhost:8080/`` and ``Hello from C++!`` will appear in the browser.