lexbor/lexbor
Fork: 106 Star: 1609 (更新于 2024-11-07 10:46:56)
license: Apache-2.0
Language: C .
Lexbor is development of an open source HTML Renderer library. https://lexbor.com
最后发布版本: v2.3.0 ( 2023-08-18 02:36:04)
Lexbor: Crafting a Browser Engine with Simplicity and Flexibility
Why build yet another browser engine? There's a myriad of challenges developers face in fully utilizing modern web technologies. Parsing HTML and CSS, dealing with URLs and encodings often involves slow, resource-heavy implementations or outdated solutions. Even established solutions, written in C++ and reaching tens of megabytes in volume, are often not versatile enough. Meanwhile, language-specific implementations for Python, Node.js, Rust, or any other favorite of the day are slow and prone to lock-in.
The Core Requirements
Lexbor's core requirements rose from the ashes of these challenges:
Portability
Lexbor aims to adapt to different platforms and integrate into various programming languages. It's not yet another library full of quirks and idiosyncrasies; Lexbor aims to offer developers flexibility to incorporate it into their work directly, regardless of the programming language they chose.
Modularity
Lexbor wants to keep things simple: Developers should be able to use only the parts they need. Whether it's an HTML or URL parser, the engine's code should be straightforward and easy to navigate, promoting rapid development.
Speed
In a nutshell, Lexbor wants things to happen real fast. It's not just about making a browser engine; it's about making sure that everything, even the most resource-intensive tasks such as HTML parsing, occur swiftly to meet the real-time demands of modern web applications.
Independence
Lexbor empowers developers by giving them full control over algorithms, resources, and dimensions. By eliminating on external dependencies, we let developers customize the engine without sacrificing performance or features.
Compliance
Lexbor commits to industry standards. Developers need to be sure that the code aligns with widely established specifications. The output of Lexbor's modules, be it HTML, CSS, URLs, or others, should match that of modern browsers, meeting industry specifications.
Origin Story
Having had all these goals in mind for about a decade, Alexander Borisov, whose name gave the project its title, came up with the idea of a browser engine crafted entirely in C (there's no school like the old school). The language was chosen simply because we believed it could meet all the criteria seamlessly.
Unlike heavyweights such as WebKit or Blink, Lexbor takes a lean and focused approach, delivering a nimble yet powerful browser engine. All it takes is years of top-notch developer expertise.
An important point to make: Lexbor doesn't stop at parsing and rendering modern HTML. It offers each component as a standalone entity, ready to be integrated into other people's projects. This approach sets us apart, providing a modular solution that not only meets browser needs but also empowers developers with versatile tools for their own web-related tasks.
All in all, we envision Lexbor a promising player in the menagerie of browser technologies, pushing the boundaries and helping developers fully leverage modern web technologies.
Features
- Modules.
- Single or separate libraries for each module.
- No outside dependencies.
- Easy to port to any platform.
- C99 support.
- Speed.
HTML Module
- Full conformance with the HTML5 specification.
- Manipulation of elements and attributes: add, change, delete and other.
- Supports fragment parsing (for innerHTML).
- Supports parsing by chunks.
- Passes all tree construction tests.
- Tested by 200+ million HTML pages with ASAN.
- Two way for parsing HTML: by Document, by Parser.
- Supports determining encoding by byte stream.
-
Parsing CSS Styles in tag attributes and in the
<style>
tag. - Fast
CSS Module
- Full conformance with the CSS Syntax module.
- Supports:
-
- StyleSheet Tree (aka CSSOM).
-
- and so on.
- Fast.
Selectors Module
- Search for HTML elements using CSS selectors.
- Fast.
Encoding Module
- Full conformance with the Encoding specification.
- Supports
40 encodings
for encode/decode. - Supports single and buffering encode/decode.
- Fast.
URL Module
- Conformance with the URL specification
- Support Unicode ToASCII
- Fast.
Punycode Module
- Conformance with the Punycode specification.
- Support Encode/Decode.
Unicode Module
- Unicode Standard Annex #15.
-
- Support Unicode normalization forms: D (NFD), C (NFC), KD (NFKD), KC (NFKC).
-
- Support chunks (stream).
- Unicode Technical Standard #46.
-
- Support Unicode IDNA Processing.
-
- Support Unicode ToASCII.
-
- Support Unicode ToUnicode.
- Fast.
Development of modules in process
- Layout
- Font
- and so on
Build and Installation
Binary packages
Binaries are available for:
- CentOS 6, 7, 8
- Debian 8, 9, 10, 11
- Fedora 28, 29, 30, 31, 32, 33, 34, 36, 37
- RHEL 7, 8
- Ubuntu 14.04, 16.04, 18.04, 18.10, 19.04, 19.10, 20.04, 20.10, 21.04, 22.04
Currently for x86_64
architecture.
If you need any other architecture, please, write to support@lexbor.com.
vcpkg
For vcpkg users there is a lexbor
port that can be installed via vcpkg install lexbor
or by adding it to dependencies
section of your vcpkg.json
file.
macOS
Homebrew
To install lexbor
on macOS from Homebrew:
brew install lexbor
MacPorts
To install lexbor
on macOS from MacPorts:
sudo port install lexbor
Source code
For building and installing Lexbor library from source code, use CMake (open-source, cross-platform build system).
cmake . -DLEXBOR_BUILD_TESTS=ON -DLEXBOR_BUILD_EXAMPLES=ON
make
make test
Please, see more information in documentation.
Single or separately
Single
- liblexbor — this is a single library that includes all modules.
Separately
- liblexbor-{module name} — libraries for each module.
You only need an HTML parser? Use liblexbor-html
.
Separate modules may depend on each other.
For example, dependencies for liblexbor-html
: liblexbor-core
, liblexbor-dom
, liblexbor-tag
, liblexbor-ns
.
The liblexbor-html
library already contains all the pointers to the required dependencies. Just include it in the assembly: gcc program.c -llexbor-html
.
External Bindings and Wrappers
- Elixir binding for the HTML module (since 2.0 version)
- Crystal Fast HTML5 Parser with CSS selectors for Crystal language
- Python binding for modest and lexbor engines.
- D Fast HTML5 Parser with CSS selectors for D programming language
- Ruby Fast HTML5 Parser with both CSS selectors and XPath support.
- PHP's DOM extension uses Lexbor's HTML living standard parser and CSS selector support, starting from PHP 8.4.
You can create a binding or wrapper for the lexbor
and place the link here!
Documentation
Available on lexbor.com in Documentation section.
Roadmap
Please, see roadmap on lexbor.com.
Getting Help
- E-mail support@lexbor.com
SAST Tools
PVS-Studio - static analyzer for C, C++, C#, and Java code.
AUTHOR
Alexander Borisov borisov@lexbor.com
COPYRIGHT AND LICENSE
Lexbor.
Copyright 2018-2024 Alexander Borisov
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Please, see LICENSE file.
最近版本更新:(数据更新于 2024-09-09 06:51:16)
2023-08-18 02:36:04 v2.3.0
2023-04-06 19:42:53 v2.2.0
2021-08-07 01:35:58 v2.1.0
2020-03-14 06:55:43 v1.0.0
2019-11-19 03:19:06 v0.4.0
2019-03-13 03:47:59 0.2.0
2018-12-01 04:29:44 0.1.0
主题(topics):
c, fast, html
lexbor/lexbor同语言 C最近更新仓库
2024-11-21 10:58:30 EdgeTX/edgetx
2024-11-15 10:03:16 hanwckf/bl-mt798x
2024-11-09 07:41:43 XITRIX/Moonlight-Switch
2024-11-04 17:16:21 redis/redis
2024-10-31 09:06:25 Spooks4576/Ghost_ESP
2024-10-31 03:40:05 tursodatabase/libsql