XRB

XRB

XRB is a templating system built loosely on top of XHTML markup. It uses efficient native parsers where possible and compiles templates into efficient Ruby. It also includes a markup builder to assist with the generation of pleasantly formatted markup which is compatible with the included parsers.

Development Status

<h1>XRB Examples</h1>

<ul>
	<li>XRB uses normal string interpolation syntax: #{"Hello World"}</li>

	<?r if true ?>
	<li>XRB also adopts standard #{"<?r ... ?>"} script tags</li>
	<?r end ?>
	
	<!-- That's all of the syntax! -->
<ul>

Generates the following output using XRB::Template.load_file(path).to_string:

<h1>XRB Examples</h1>

<ul>
	<li>XRB uses normal string interpolation syntax: Hello World</li>

	<li>XRB also adopts standard &lt;?r ... ?&gt; script tags</li>
	
	<!-- That's all of the syntax! -->
<ul>

Is it fast?

Yes. XRB is designed to be fast. It uses a combination of efficient native parsers and Ruby code generation to ensure that templates are compiled into efficient Ruby code. This means that XRB is suitable for use in high performance applications. In comparison to ERB, it is generally about 10x faster.

Usage

Please browse the source code index or refer to the guides below.

Getting Started

This guide gives a brief overview of the XRB templating system and how to use it.

Capturing Output

This guide explains how to capture intermediate output during template rendering.

Markup Parser

This guide explains how to parse and manipulate Markup using the XRB templating system.

See Also

Contributing

We welcome contributions to this project.

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.

Developer Certificate of Origin

This project uses the Developer Certificate of Origin. All contributors to this project must agree to this document to have their contributions accepted.

Contributor Covenant

This project is governed by the Contributor Covenant. All contributors and participants agree to abide by its terms.