Re: Embed asciidoc into Haml

Posted by mojavelinux on
URL: https://discuss.asciidoctor.org/Embed-asciidoc-into-Haml-tp683p691.html

Jason nailed it. Haml is migrating filters for markup languages like Textile, AsciiDoc and Markdown to a separate gem, ambiguously named haml-contrib.

I'm a bit frustrated with the Haml project. I first submitted a pull request for an AsciiDoc filter at the beginning of the year. That pull request was rejected with a request to resubmit the change to the haml-contrib project. I appealed for them to reconsider since adding an extra dependency introduces unnecessary complexity. I got no response to my post [1]. After I while, I accepted it was a hopeless argument and sent a pull request to haml-contrib as requested [2]. That pull request has been sitting there for over 3 months. There's no indication from the developers when its going to be merged.

If we don't see any life from the Haml project, I think we should consider putting the filter into Awestruct so that it can be activated with a simple 'require' statement in _ext/pipeline.rb.

If you are open to alternatives, this is one of several reasons why I strongly recommend Slim over Haml. Slim accepted the AsciiDoc filter almost immediately and you can start using it immediately. Slim is also much more concise than Haml. He're an example:

[source,slim]
----
.span6
  asciidoc:
    I'm writin' me some *AsciiDoc*!
----

NOTE: The colon goes at the end of the filter name in Slim.

You can also render inline AsciiDoc in either Haml or Slim as so:

[source,slim]
----
.span6
  p Here's a paragraph with #{Asciidoctor.render '*strong*', :doctype => :inline} text.
----

Hope that helps!

-Dan

[1] https://github.com/haml/haml/pull/644
[2] https://github.com/haml/haml-contrib/pull/4



On Thu, Oct 3, 2013 at 4:00 PM, LightGuardjp [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Sorry, my bad, it's haml-contrib and it isn't in there: https://github.com/haml/haml-contrib/pull/4. You'd have to do the same thing Dan did in that pull request in your awestruct code. You could create a ruby file with the lines in https://github.com/mojavelinux/haml-contrib/blob/edd0cc1dc32fc05972052380bd6cb5197c0f2dbf/lib/haml/filters/asciidoc.rb and require that file at the top of the _ext/pipeline.rb.


On Thu, Oct 3, 2013 at 1:42 PM, fleurystephane [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks for your answer.

But I use haml4.0.3 (in my gem list)
What is haml-compat ? (not found in gems repository)


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Embed-asciidoc-into-Haml-tp683p687.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Embed-asciidoc-into-Haml-tp683p688.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | http://google.com/profiles/dan.j.allen