GithubHelp home page GithubHelp logo

addyosmani / robinson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mbrubeck/robinson

0.0 3.0 0.0 208 KB

A toy web rendering engine

Home Page: http://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html

License: MIT License

CSS 2.11% Rust 97.89%

robinson's Introduction

Robinson

A toy web rendering engine written in the Rust language, by Matt Brubeck ([email protected]).

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 Cargo and Rust.

  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.

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/robinson --html file.html --css file.css

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

robinson's People

Contributors

mbrubeck avatar zachwick avatar

Watchers

Addy Osmani avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.