Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

ruby-syntax-tree/syntax_tree-xml

Repository files navigation

SyntaxTree::XML

Build Status

Syntax Tree support for ERB.

Work in progress!

This is not ready for production use just yet, still need to work on:

  • Comments
  • Blocks using do
  • Blank lines
  • Probably more

Currently handles

  • ERB tags with and without output
  • ERB tags inside strings
  • HTML tags with attributes
  • HTML tags with and without closing tags
  • ERB if, elsif and else statements
  • Text output
  • Formatting the ruby code inside the ERB tags (using syntax_tree itself)

Installation

Add this line to your application's Gemfile:

gem github: "davidwessman/syntax_tree-erb"

Usage

From code:

require "syntax_tree/erb"

pp SyntaxTree::ERB.parse(source) # print out the AST
puts SyntaxTree::ERB.format(source) # format the AST

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/davidwessman/syntax_tree-erb.

License

The gem is available as open source under the terms of the MIT License.

About

Syntax Tree support for XML

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages