Modules¶
The lexbor project is designed with a modular architecture, where each module can be built and used independently or as part of the complete engine. This approach provides flexibility — you can use only the components you need, keeping your application lightweight and focused.
Modular Design Philosophy¶
Lexbor is built around the idea that you should use only what you need. Each module is designed to work independently, so you can include just the HTML parser without dragging in CSS parsing, or use the Encoding module on its own without any HTML dependencies.
This architecture offers several practical benefits:
Self-contained — Each module has its own version and configuration, and can be built separately. You get clean separation without unnecessary coupling.
Standards-compliant — Every module strictly implements WHATWG and W3C specifications. If a browser does it, lexbor does it the same way.
Flexible integration — Use any combination of modules that fits your needs. The HTML parser works great on its own, or pair it with CSS and Selectors for more advanced use cases.
Module Location¶
All modules are located in the source/lexbor/ directory of the project. Each module has:
A
base.hfile with version information and type definitionsA
config.cmakefile for build configurationImplementation files (
.c) and headers (.h)
Available Modules¶
Production-Ready Modules¶
These modules are stable, fully tested, and ready for production use:
Module |
Version |
Specification |
Description |
|---|---|---|---|
2.7.0 |
— |
Base algorithms and memory management |
|
2.8.0 |
Full HTML parser |
||
2.0.0 |
DOM tree manipulation |
||
1.4.0 |
CSS parser and CSS modules |
||
0.5.0 |
CSS selectors engine |
||
2.2.0 |
40+ character encodings |
||
0.4.0 |
URL parsing and manipulation |
||
0.5.0 |
Normalization and IDNA |
||
Punycode |
— |
Punycode encoding/decoding |
Supporting Modules¶
These modules provide internal functionality and are typically used by other modules:
Module |
Description |
|---|---|
NS |
Namespace handling (HTML, SVG, MathML, XLink, XML, XMLNS) |
Tag |
HTML and SVG tag definitions and lookup |
Style |
CSS Style event handling and integration. Combines HTML and CSS |
Ports |
Platform-specific implementations |
Utils |
Utility functions and helpers |
Modules in Development¶
Module |
Status |
Description |
|---|---|---|
Layout |
🚧 In progress |
CSS layout engine (currently at rendering tree stage) |
Fonts |
🚧 Planned |
Font parsing and text rendering |
Engine |
🚧 Planned |
Full browser engine integration |
Module Versioning¶
Each module maintains its own version number. Versions follow semantic versioning:
Major — breaking API changes
Minor — new features, backward compatible
Patch — bug fixes, backward compatible
#include <lexbor/html/base.h>
printf("HTML module version: %s\n", LXB_HTML_VERSION_STRING);
printf("Core version: %s\n", LEXBOR_VERSION_STRING);
Or:
printf("Core version: %d.%d.%d\n",
LEXBOR_VERSION_MAJOR,
LEXBOR_VERSION_MINOR,
LEXBOR_VERSION_PATCH);
(Documentation is currently being developed, details will be available here soon.)