{"id":25523298,"url":"https://github.com/jacnils/bygg","last_synced_at":"2026-05-01T00:31:48.632Z","repository":{"id":260385620,"uuid":"881153498","full_name":"jacnils/bygg","owner":"jacnils","description":"Component-based HTML/CSS builder for C++","archived":false,"fork":false,"pushed_at":"2025-06-08T01:50:54.000Z","size":254,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-21T11:51:36.293Z","etag":null,"topics":["cpp17","cpp20","cpp23","css","html","library","website","website-builder"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacnils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-31T01:58:51.000Z","updated_at":"2025-06-08T01:50:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"5060aa39-73ac-4a1b-b7b0-4790b2b90eb0","html_url":"https://github.com/jacnils/bygg","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"0917cfaa61f9bbbb0fa8cea4c20400429b7efabf"},"previous_names":["jcbnilsson/bygg","jacnils/bygg"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jacnils/bygg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacnils%2Fbygg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacnils%2Fbygg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacnils%2Fbygg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacnils%2Fbygg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacnils","download_url":"https://codeload.github.com/jacnils/bygg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacnils%2Fbygg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32481553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","cpp20","cpp23","css","html","library","website","website-builder"],"created_at":"2025-02-19T19:18:40.325Z","updated_at":"2026-05-01T00:31:48.607Z","avatar_url":"https://github.com/jacnils.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bygg\n\n![action](https://github.com/jcbnilsson/bygg/actions/workflows/cmake-multi-platform.yml/badge.svg)\n\n[Demo](https://bygg-web.jacobnilsson.com)\n[Docs](https://jacobnilsson.com/docs/bygg)\n\nComponent-based HTML/CSS builder for C++17.\n\n## Features\n\n- HTML and CSS document generation and deserialization\n- Component-based, modular design\n- C++ pseudo-code generation\n- Easy to use, with a modern C++ API\n- Iterator- and reference-based design for easy manipulation and traversal\n- Sensible indentation for pretty-formatting.\n- HTML serialization\\*\n- No dependencies, other than the standard library\\*\n- Command-line tool for generating HTML or pseudocode from HTML or Markdown files\\*\n- Windows, macOS, Linux and \\*BSD support\\*\\*\n\n*Serialization and CLI requires the use of libxml2, which is not included in this repository.\nTests require the use of Catch2, which is not included in this repository.\nMarkdown support requires `pandoc` to be installed on the system. Pandoc is not included in this\nrepository.\n\n**Not tested on BSD. bygg is actively tested on Windows, macOS and Linux through GitHub Actions.\n\n## Dependencies\n\n- C++17 compiler\n- CMake\n- libxml2 (*optional*, for CLI and serialization)\n- Catch2 (*optional*, for tests)\n- Pandoc (*optional*, for Markdown support when using the CLI, not required at compile-time)\n\n## Installation\n\nTo install the library, you can utilize the provided CMakeLists.txt file:\n\n```sh\nmkdir build\ncd build\ncmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local\ncmake --build .\ncmake --install . --prefix /usr\n```\n\nThis will install the library to `/usr/local/lib` and the headers to `/usr/local/include/bygg/...`\nIf you're packaging the library, `/usr` is probably a more suitable prefix.\n\nIf you don't need serialization, you can disable it along with the libxml2\ndependency by passing `-DBYGG_USE_LIBXML2=OFF` to CMake. This will disable the\nserialization features of the library and not install the headers for it.\nNote that you must disable the CLI as well.\n\nIf you don't need the CLI, you can disable it by passing `-DBYGG_BUILD_CLI=OFF` to CMake.\nThis will disable the CLI utility.\n\nIf you want to enable the tests, you can pass `-DBYGG_BUILD_TESTS=ON` to \nCMake, and they will automatically be built.\n\nIf you want to download and build Catch2, you can pass `-DBYGG_BUILD_CATCH2=ON` to CMake.\nThis will download and build Catch2 as part of the build process. If you want to build\nlibxml2, you can pass `-DBYGG_BUILD_LIBXML2=ON` to CMake. This will download and build\nlibxml2 as part of the build process.\n\n## Usage\n\nJust include the appropriate headers in your project and link against the library. \nIf you are not sure which header(s) are appropriate, you can include all of them by \nincluding bygg.hpp. If you know that you, for example, only need the HTML builder,\nyou can include HTML.hpp. Examples can be found in the `examples` directory.\n\nHello world example:\n\n```cpp\n#include \u003cfstream\u003e\n#include \u003cbygg/HTML/HTML.hpp\u003e\n#include \u003cbygg/CSS/property.hpp\u003e\n\nint main() {\n   using namespace bygg::HTML;\n   using CSSProperty = bygg::CSS::Property;\n\n   Section sect{Tag::Html, Properties{Property{\"lang\", \"us\"}},\n      Section{Tag::Head,\n         Element{Tag::Title, \"Hello world!\"},\n         Element{Tag::Meta, Properties{Property{\"name\", \"description\"}, Property{\"content\", \"Hello world description!\"}}},\n         Element{Tag::Meta, Properties{Property{\"name\", \"viewport\"}, Property{\"content\", \"width=device-width, initial-scale=1.0\"}}},\n      },\n      Section{Tag::Body,\n         Section{Tag::Div, Properties{Property{\"class\", \"content\"}},\n            Element{Tag::H1, \"Hello world!\"},\n            Element{Tag::P, Properties{Property{\"style\", static_cast\u003cstd::string\u003e(CSSProperty(\"color\", \"red\"))}}, \"This is a red string of text.\"},\n         },\n      },\n      Section{Tag::Footer,\n         Element{Tag::P, \"This is a paragraph in a footer.\"},\n      },\n   };\n\n   std::ofstream ofs(\"hello-world.html\");\n\n   ofs \u003c\u003c sect.get\u003cstd::string\u003e(Formatting::Pretty);\n\n   ofs.close();\n}\n```\n\nYou can see that the library is heavily designed around avoiding strings as much as possible, in favor of\nobjects that represent the data you want to work with. This makes it easier to manipulate and traverse.\nBut if you find that you need to work with strings in your sections or elements, you can always use strings\nto create them.\n\nSee the Doxygen documentation in `docs` for classes and functions that are exposed by the library.\n\n## CLI\n\nThe CLI utility can be used to generate HTML or pseudocode from HTML or Markdown files.  This may be useful \nif you want to quickly generate `bygg` code from an existing HTML or even Markdown document. Note that you \ncan also read from stdin.\n\nIf you enabled the CLI during the build process and executed `cmake --install . --prefix /usr`, you should\nbe able to simply run `bygg-cli` from the command line. In addition, if you enabled `BYGG_INSTALL_DOCS`,\nyou can run `man bygg-cli` (provided you have `man` installed) to see the full documentation for the CLI.\n\nExample usage:\n\n```sh\nbygg-cli --formatting pretty --input html input.html # generates pretty-formatted HTML from input.html\nbygg-cli --formatting pretty --input markdown input.md # generates pretty-formatted HTML from input.md\nbygg-cli --formatting pseudo --input html input.html # generates pseudo-code from input.html\nbygg-cli --formatting pseudo --input markdown input.md # generates pseudo-code from input.md\ncat input.html | bygg-cli --formatting pretty --input html # generates pretty-formatted HTML from stdin\ncat input.md | bygg-cli --formatting pretty --input markdown # generates pretty-formatted HTML from stdin\n```\n\nSee `bygg-cli --help` or the aforementioned man page for more information.\n\n## License\n\nThis project is licensed under the MIT license. See the included LICENSE file for more information.\n\nThe dependency `libxml2` is licensed under the MIT license and maintained by the GNOME project.\nFor issues regarding `libxml2`, please refer to the [libxml2 issue tracker](https://gitlab.gnome.org/GNOME/libxml2/-/issues).\n\n## Packaging\n\nThere are no packages for bygg at the moment. If you'd like to add packaging for your distribution, \nplease feel free to do so. I'm happy to help you with any questions you might have.\n\n## What about the name?\n\nI am Swedish and I want to name projects in Swedish, because it's fun. Bygg means build, and I think build is a fitting\nword for a project like this, because it's all about building HTML and CSS documents.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacnils%2Fbygg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacnils%2Fbygg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacnils%2Fbygg/lists"}