Tritium is a magical document modifying language. It's JavaScript-like and simple to learn. Think XSLT without the nightmare. It was designed by Hampton Catlin (@hcatlin), and has been heavily influenced by Aaron Leung (@akhleung).
HTML Go TypeScript HCL Protocol Buffer Shell
Switch branches/tags
Latest commit 6f0ee80 May 25, 2016 @beyondbill beyondbill Merge pull request #62 from moovweb/revert-61-pfst-1233
Revert "[Supprot for PFST-1233] Don't update source_host in env if already set & remove some comments"
Permalink
Failed to load latest commit information.
checker Update to new gokogiri_internal repo Apr 22, 2015
constants Merge Feature Branch go1.4.2 Apr 14, 2015
documentation new build May 2, 2012
engine_tests/tritium fixing the export functionality and corresponding test Apr 3, 2014
htmltransformer Update to new gokogiri_internal repo Apr 22, 2015
linker update golang protobuf repo Apr 29, 2015
packager update golang protobuf repo Apr 29, 2015
packages Merge Feature Branch go1.4.2 Apr 14, 2015
parser update golang protobuf repo Apr 29, 2015
proto Set FlagSet's output to Stdout so that Golang can validate the messages Jul 8, 2015
protoface Merge in go1.4.2 changes Apr 17, 2015
protolite update golang protobuf repo Apr 29, 2015
rewriter Merge Feature Branch go1.4.2 Apr 14, 2015
spec Update to new gokogiri_internal repo Apr 22, 2015
test Merge Feature Branch go1.4.2 Apr 14, 2015
transform Merge Feature Branch go1.4.2 Apr 14, 2015
tritstrings put xpath error in tritstrings Mar 20, 2015
util Merge Feature Branch go1.4.2 Apr 14, 2015
whale Revert "[Supprot for PFST-1233] Don't update source_host in env if al… May 25, 2016
.gitignore conflict in gitignore fixed Mar 13, 2013
CHANGELOG Add 2.0 to the changelog Jan 17, 2012
LICENSE now with a more open source license Dec 17, 2013
README removing some unnecessary info Jan 18, 2014
SYNTAX putting this here for the time being Mar 1, 2014
TODO changed the way that with and not work Nov 25, 2011
UPGRADE more upgrade notes Jan 18, 2012
VERSION its two.0 Jan 12, 2012
engine.go Merge Feature Branch go1.4.2 Apr 14, 2015
jenkins.sh compensating for new git plugin in jenkins that adds 'origin/' in fro… Mar 25, 2014

README

== Tritium ==

Tritium is a magical language that functions as a document modifying language.
It's JavaScript-like (except, without all that function() noise!) and simple to
learn.

It was designed by Hampton Catlin (@hcatlin), and has been heavily influenced
by Aaron Leung (@akhleung), the language's main engineer.

== Status ==

Tritium is proto-open source. We opened the source and changed the license.
It's still not very usable outside of a Moovweb build/run environment. If you
want to play around with the language, checkout http://tester.tritium.io

We are going to continue working hard to get this in shape for other uses outside
of Moovweb directly. 

Currently, it focuses on modifying XML documents only (HTML and XHTML count too). 

Check out the examples in /test/functional to get started... but basically.

  <html>
    <body>
      <div id="awesome" />
    </body>
  </html>
  
If you pass that in as an input to the following script.

  $("/html/body/div[@id='awesome']") {
    attribute("class", "even_awesomer!")
    wrap("div", class: "wrapper")
  }

You'd get back...

  <html>
    <body>
      <div class="wrapper">
        <div id="awesome" class="even_awesomer!"/>
      </div>
    </body>
  </html>