HEREDOC support?

24 views
Skip to first unread message

Michal Hantl

unread,
Nov 9, 2010, 1:26:16 AM11/9/10
to mi...@googlegroups.com
It seems that Mirah doesn't support HEREDOC.

I found HEREDOC to be extremely useful when you want to use HTML ("") and javascript (i tend to use '' in js) in a string and still use the lovely #{}.

<<HTML
  <a href="/" onclick="alert('we love heredoc')">#{site_name}</a>

  ... tons more html here ...

HTML

Using "" or '' to embed a few lines of html is far less convinient.

Are there plans for implementing heredoc?

--
S pozdravem, Regards
Michal Hantl

gtalk/jabber: mic...@hantl.cz
icq: 241813215

Rib Rdb

unread,
Nov 9, 2010, 11:21:21 AM11/9/10
to mi...@googlegroups.com
heredoc should work:

$ cat examples/broken.mirah 
site_name = "foobar"
puts <<HTML
  <a href="/" onclick="alert('we love heredoc')">#{site_name}</a>

  ... tons more html here ...

HTML
$ bin/mirah examples/broken.mirah 
  <a href="/" onclick="alert('we love heredoc')">foobar</a>

  ... tons more html here ...

What's the message you get when it doesn't work? Does this example not work for you?

Michal Hantl

unread,
Nov 10, 2010, 12:39:02 AM11/10/10
to mi...@googlegroups.com
It works! Sweeet :] 

Michal Hantl

unread,
Nov 10, 2010, 1:43:22 AM11/10/10
to mi...@googlegroups.com
I've created some documentation :)

As for putting the pages to Mirah wiki - I won't be able to maintain multiple versions of the wiki, but feel free to use those pages.

You could also automatically pull the wiki from google code ... but I don't see much point in it. 

Google Code is very easy to use and read, looks good and provides plenty of features:
  - user management
  - comments <- very important
  - issues
  - great syntax and widgets

consiliens

unread,
Nov 10, 2010, 2:24:41 AM11/10/10
to mi...@googlegroups.com
Google Code doesn't support git natively and runs a proprietary wiki.
Github's gollum wiki is open source and based around git instead of svn.

https://github.com/github/gollum

Consider selecting a content license for the mirah-on-gae wiki so that
it's easy to remix.

http://google-opensource.blogspot.com/2008/07/content-licenses-now-available-for-your.html

It'd be nice to have everything in one place. As long as the content is
freely licensed, mirroring to a comprehensive archive shouldn't be a
problem.

On 11/09/2010 11:43 PM, Michal Hantl wrote:
> I've created some documentation :)
> http://code.google.com/p/mirah-on-gae/wiki/LanguageHeredoc
>
> As for putting the pages to Mirah wiki - I won't be able to maintain
> multiple versions of the wiki, but feel free to use those pages.
>
> You could also automatically pull the wiki from google code ... but I
> don't see much point in it.
>
> Google Code is very easy to use and read, looks good and provides plenty
> of features:
> - user management
> - comments <- very important
> - issues
> - great syntax and widgets
>

> <http://code.google.com/p/mirah-on-gae/wiki/LanguageHeredoc>


>
> On 10 November 2010 06:39, Michal Hantl <michal...@gmail.com

> <mailto:michal...@gmail.com>> wrote:
>
> It works! Sweeet :]
>
> On 9 November 2010 17:21, Rib Rdb <rib...@gmail.com

> gtalk/jabber: mic...@hantl.cz <mailto:mic...@hantl.cz>


> icq: 241813215
>
>
>
>
>
> --
> S pozdravem, Regards
> Michal Hantl
>

> gtalk/jabber: mic...@hantl.cz <mailto:mic...@hantl.cz>


> icq: 241813215
>
>
>
>
> --
> S pozdravem, Regards
> Michal Hantl
>

> gtalk/jabber: mic...@hantl.cz <mailto:mic...@hantl.cz>
> icq: 241813215

Michal Hantl

unread,
Nov 10, 2010, 6:24:41 AM11/10/10
to mi...@googlegroups.com
On 10 November 2010 08:24, consiliens <consi...@gmail.com> wrote:
Google Code doesn't support git natively and runs a proprietary wiki. Github's gollum wiki is open source and based around git instead of svn.

https://github.com/github/gollum

Consider selecting a content license for the mirah-on-gae wiki so that it's easy to remix.

http://google-opensource.blogspot.com/2008/07/content-licenses-now-available-for-your.html

Thanks.
 


It'd be nice to have everything in one place.  As long as the content is freely licensed, mirroring to a comprehensive archive shouldn't be a problem.

I like github, but there is too much noise when you are looking at the wiki pages and its wiki doesn't look like wiki.

Also it doesn't have comments. I want people to be able to comment.
icq: 241813215
Reply all
Reply to author
Forward
0 new messages