1, 2: Fixed in Trunk.
3: I forgot the "svn." subdomain. Fixed.
4: Fixed on the website and in Trunk.
5: There are two reasons for this: one is because some browsers don't
understand some self-closed tags (ever tried viewing a page with a
<div/> in Safari? It's not pretty), and the other is backwards
compatibility. There needs to be some way to differentiate between
self-closed and non self-closed tags, and Hampton chose the "/" syntax.
Although, in retrospect, it might have been a better choice to have a
tag that specifies that an empty tag shouldn't be self-closed, at this
point, it would break too many layouts with empty divs that it's not
practical to make the switch.
6: Tags with inline content and nested content are invalid Haml syntax -
you're trying to provide content twice. This throws an error in Trunk,
which should get rid of any confusion.
Thanks for all the reports! This is how we know stuff is breaking :).
Thanks for the questions, too - it's good to know what confuses people.
That's how we figured out where to throw errors in the first place.
- Nathan
candlerb wrote:
> I've been playing with haml 1.0.5 downloaded as a gem, after seeing
> the ruby-talk announcement.
>
> I've got a few comments:
>
> (1) It doesn't work out-of-the-box as a standalone library when rails
> is not installed.
>
> $ cat haml.rb
> require 'rubygems'
> require 'haml/engine'
>
> template = File.read('haml-sample.haml')
> haml_engine = Haml::Engine.new(template)
> puts haml_engine.to_html
> $ ruby haml.rb
> /usr/lib/ruby/gems/1.8/gems/haml-1.0.5/lib/haml/helpers.rb:231:
> uninitialized constant ActionView (NameError)
> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
> 27:in `require'
> from /usr/lib/ruby/gems/1.8/gems/haml-1.0.5/lib/haml/engine.rb:
> 1
> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:
> 32:in `require'
> from haml.rb:2
>
> The solution was to add "module ActionView; end" to the top of my
> program, but I think that haml/engine.rb should do this itself, i.e.
>
> module ActionView
> class Base
> ...
> end
> end
>
> rather than "class ActionView::Base ..."
>
> (2) A comment at the top of haml/engine.rb gives the example
>
> # template = File.load('templates/really_cool_template.haml')
>
> but if you try this, it throws a "private method" error. It should be
> File.read(...)
>
> (3) The rails download instructions at http://haml.hamptoncatlin.com/download
> don't work - I get a 404 error for that URL. It seems that the files
> have been removed? (This is with rails 1.1.2)
>
> (4) I think there's a doc bug at http://haml.hamptoncatlin.com/reference.
> Where it says "The pipe character designates a multiline string" it
> gives a HAML example, and beneath that a compiled-to-HTML form, but
> that doesn't appear to have been compiled properly.
>
> (5) I was wondering why HAML has an explicit "empty tag" syntax, i.e.
> %hr/, when I thought this could be implied automatically from the
> indentation.
>
> I can't think of any examples of pre-XHTML tags where you'd need and
> explicit start and end tags *and* want to have empty content, e.g.
> <span></span>.
>
> (6) Tags which have content on the same line seem to cause some
> strangeness if you also try to have nested content. For example,
>
> %h1 foo
> %hr
> %hr
> %br
> test
>
> Here's the rendered output:
>
> <h1>foo</h1>
> <hr>
> <hr>
> </hr>
> <br>
> </br>
> test
> </hr>
>
> I was expecting:
>
> <h1>foo
> <hr>
> </hr>
> <hr>
> </hr>
> <br>
> </br>
> test
> </h1>
>
> But maybe I'm just doing something which isn't sensible anyway :-)
>
> Regards,
>
> Brian.
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---