Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

:format option for HAML #5

Open
jhindle opened this issue Nov 27, 2009 · 4 comments
Open

:format option for HAML #5

jhindle opened this issue Nov 27, 2009 · 4 comments

Comments

@jhindle
Copy link

jhindle commented Nov 27, 2009

Is there currently a way to set the ':format' option for HAML to change the doctype?

Like this:
http://haml-lang.com/docs/yardoc/HAML_REFERENCE.md.html#options

This would be good so the doctype could be changed to HTML4 or HTML5

@curthasselschwert
Copy link

I was thinking this as well, but you can just do this in your layout:

<!DOCTYPE html>
%html
  %head
    ...

@jhindle
Copy link
Author

jhindle commented Feb 22, 2010

HAML's :format option also effects how self-closing tags are formatted.

XHTML requires an ending slash:

<img src="foo.jpg" alt="bar" /> 

HTML4 and HTML 5 do not:

<img src="foo.jpg" alt="bar">

@curthasselschwert
Copy link

You're right! I hadn't even considered closing tags. I second the idea of the :format option for HAML.

@jou
Copy link

jou commented May 20, 2010

I have implemented a way to pass options to Haml in my branch, so you can put this in your _config.yml:

haml_options:
  format: :html5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants