Skip to content

Please consider adding "partial" functionality to this library #1

@bzerangue

Description

@bzerangue

Out of result of the following Twitter conversation, I would like to make a request to add "partial" functionality to the "Haml Contrib" project…

@bmz wrote: @compay is there a way to do partials with Haml outside of Rails? If not, is there a reason why it can't?

@compay wrote: @bmz No, it's not built in, because it's a framework feature rather than a language one. But it's easy to implement: semicomplete.com/blog/tags/haml

@compay wrote: @bmz that said, we've recently created a "Haml Contrib" project for things that don't belong in the language, but are generally useful...

@compay wrote: @bmz ...and I think a simple implementation of partials is a good candidate for inclusion there.

@compay wrote: @bmz Feel free to open an issue at github.com/haml/haml-cont… and share your thoughts on how you think it should work

I know Sass and Haml were once from the same library. Sass natively has always had a "partials" feature (or at least that I know), but Haml does not. I have never understood why that is.

I would love to have the opportunity to manage my HAML templates outside of a framework per se. I would like to have my CodeKit (or Terminal), my text editor, my browser and that's it. Why do I need to learn some framework language to manage my Haml templates in a modular and DRY way?

I think it would be a great benefit to add "partial" (or include) functionality to the "Haml Contrib" project. I love writing Haml and managing my templates with it, but would love to start modularizing it (or managing it in chunks). Partials would allow users to utilize DRY principles while managing their Haml markup without having to learn or rely on Rails or Sinatra or any other framework.

I envision it working similar to the way partials work in Sass. Add a file name with underscore preceding the name _nav.haml. This file would and could be included but not compiled by the Haml processor to a normal HTML file.

Please consider adding "partial" functionality to the "Haml Contrib" project.

Thank you for your consideration!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions