While I agree that the inline stuff isn't ideal... every proposal for a solution hasn't been up to the spec of looking beautiful and readable. Honestly, even this simple example is confusing syntactically.
Keep thinking on it though. I'm more than happy if someone can make it simple, easy, and obvious. But, until that point... the other options are servicable and I believe, better than badly designed syntax. Sorry. :P But, keep up the brainstorming! -hampton. On Fri, Dec 4, 2009 at 1:25 AM, Yaohan Chen <[email protected]> wrote: > When writing inline elements in HAML, one usually has to resort to writing > raw > HTML or using a filter like markdown. For example to produce the following > HTML: > <p>Please <a href="contact">contact us</a> for any questions!</p> > > One can use raw HTML for the inline element, sacrificing some readability: > %p Please <a href="contact">contact us</a> for any questions! > > Or one can use markdown, which might lack control or features. Either of > these > solutions requires working in "an additional language", which I think > almost > undoes HAML's effort in simplifying markup. > > I would like to propose a substitution feature to improve this. Below are > three examples using it: > > / Most simple form > %p Please ^contact_us for any questions! > ^contact_us %a(href="contact") contact us > > / The substitution place holder can be wrapped in { } > / Useful when there are word characters following it > %p Please ^{contact_us} for any questions! > ^contact_us %a(href="contact") contact us > > %p Please ^contact_us for any questions! > ^contact_us > / Multiple lines of substitution content can be written in indentation > %a(href="contact") contact us > > This is similar to ReStructuredText's approach with dealing with inline > markup. > > What do you think, and has any similar idea been considered or already > implemented? > > > Yaohan Chen > > -- > > 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] <haml%[email protected]>. > For more options, visit this group at > http://groups.google.com/group/haml?hl=en. > > > -- 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.
