robinson

A toy web rendering engine

  • 所有者: mbrubeck/robinson
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Robinson

A toy web rendering engine written in the Rust language, by Matt Brubeck
(mbrubeck@limpet.net).

I'm writing this code purely for educational purposes. My goal is to create an
incomplete but extremely simple engine as a way to learn more about basic
implementation techniques, without worrying about complications like:

  • Real-world usability
  • Standards compliance
  • Performance and efficiency
  • Interoperability

These are all important goals, but there are other projects working on them.
By ignoring them completely, this project can focus on being as simple and
easy-to-understand as possible.

Why create a simple—but useless—toy rendering engine? Mostly because I
personally want to learn how to do it. If I succeed, I also hope that other
people can learn from my code by reading or modifying it, or learn from my
experience as they set out to build their own toy browser engines.

For more details see Let's build a browser engine!, a series of
how-to articles based on this project.

Status

Currently implemented:

  • Parse a small subset of HTML and build a DOM tree.
  • Parse a small subset of CSS.
  • Perform selector matching to apply styles to elements.
  • Basic block layout.

Coming soon, I hope:

  • Inline layout.
  • Paint text and boxes.
  • Load resources from network or filesystem.

Instructions

  1. Install Rust 1.0 beta or newer.

  2. Clone the robinson source code from https://github.com/mbrubeck/robinson

  3. Run cargo build to build robinson, and cargo run to run it.

To build and run with optimizations enabled, use cargo build --release and
cargo run --release.

By default, robinson will load test.html and test.css from the examples
directory. You can use the --html and --css arguments to the robinson
executable to change the input files:

./target/debug/robinson --html examples/test.html --css examples/test.css

The rendered page will be saved to a file named output.png. To change the
output filename, use the -o option. To switch to PDF output, use add
--format pdf.

主要指标

概览
名称与所有者mbrubeck/robinson
主编程语言Rust
编程语言Rust (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2014-07-03 21:43:14
推送于2024-07-16 23:41:43
最后一次提交2024-07-16 15:11:57
发布数0
用户参与
星数1.6k
关注者数34
派生数137
提交数205
已启用问题?
问题数11
打开的问题数4
拉请求数14
打开的拉请求数1
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?