---
redirect_from: /docs/documentation.html
---
# Arbo
HTML Views in Ruby
{: .no_toc }
Table of contents
{: .text-delta }
- TOC
{:toc}
, which is mapped to `para`. JavaScript can be included by using `script { raw ... }` To include text that is not immediately part of a tag use `text_node`. ### Components Arbo DSL can be extended by defining new tags composed of other, simpler tags. This provides a simpler alternative to nesting partials. The recommended approach is to subclass Arbo::Component and implement a new builder method. The builder_method defines the method that will be called to build this component when using the DSL. The arguments passed into the builder_method will be passed into the #build method for you. For example: ```ruby class Panel < Arbo::Component builder_method :panel def build(title, attributes = {}) super(attributes) h3(title, class: "panel-title") end end ``` By default components are `div` tags with an HTML class corresponding to the component class name. This can be overridden by redefining the `tag_name` method. Several examples of Arbo components are [included in Active Admin](https://activeadmin.info/12-arbo-components.html) ### Contexts An [Arbo::Context](http://www.rubydoc.info/gems/arbo/Arbo/Context) is an object in which Arbo DSL is interpreted, providing a root for the Ruby DOM that can be [searched and manipulated](http://www.rubydoc.info/gems/arbo/Arbo/Element). A context is automatically provided when a `.arb` template or partial is loaded. Contexts can be used when developing or testing a component. Contexts are rendered by calling render_in. ```ruby html = Arbo::Context.new do div "Hello World", id: "my-panel" do span "Inside the panel" text_node "Plain text" end end puts html.render_in # => ``` ```html