Live data from Hacker News

Lisp-like html as a replacement to bbcode/markup/textile

94.249.190.129

11–20 of 83 posts

Re: Lisp-like html as a replacement to bbcode/markup/textile

#11
post #9

Minor downside: You have to ensure that the contents of a {code ..} block have all their open-brackets matched with close-brackets. This can be quite tricky with larger code examples. The bbcode [/code] equivalent is slightly less problematic. Other than that it looks like a good alternative.

In my opinion all tags should have an optional short/long form i.e.: {code ..} and {code}..{/code}.

Re: Lisp-like html as a replacement to bbcode/markup/textile

#13

I believe Clojure has something similar to what the OP is talking about thanks to Hiccup's macros: https://github.com/weavejester/hiccup

Also there's Hiccups older Common Lisp relative CL-WHO - http://weitz.de/cl-who/

Other languages also have similar solutions - http://stackoverflow.com/questions/671572/cl-who-like-html-t...

Re: Lisp-like html as a replacement to bbcode/markup/textile

#14
That look nice, but four things:

divs. How to write something like Test lore ipsum ? Does this have a chicken scheme style named parameters?

Inline HTML, especially useful for macros. {html i} should become i

A unification and . It's not that easy to translate to html, but i felt there should be one mechanism, since they all just embed a another medium. The sematics would make more sense IMO.

The macro expression takes a argument (the macro name). Can my macro aswell do this aswell? Any why doesn't the colour use it?

Re: Lisp-like html as a replacement to bbcode/markup/textile

#15
post #5

Looks interesting. I would have prefered the use of () in place of {} though.

Yep, my thoughts exactly.

If you call it lispy it's gotta use parens.

The curlies immediately suggest some broken json or perl hash.

I can see the lispy spirit in applying the car to the cdr, and I like it!

One first bug report (or feature removal request):

  makes it to the output, but is replaced with the U+00A0 character in the input textarea.

{p like   so}

What's the concern with a real lisp syntax?

I for one like it!

Re: Lisp-like html as a replacement to bbcode/markup/textile

#16
post #2

Looks a lot like TeX, which is a good thing. In fact this might even be better. I'm tired so I might be missing an obvious weakness but to take the analogy a bit further here are some comparisons between this suggestion and a more TeX-like version. The author's suggestion: {b {i This is in italics and bold.}} {Henny+Penny We can use google fonts anywhere if we just import them first with the google-font code} {macro…

Main problem with author's suggestion is that he mixes everything together, so he'll get into the markup version of DLL-hell.

E.g. How do I use relative links? Is {subdir Hello world} a relative link, a font-name, or a new and yet unsupported tag?

Html handles this: versus versus ...

Oh, and why support font names and colors directly in tags in 2012? He should support class names instead!

Why is "fontname from URL" hardcoded for Google fonts? Why not a generic syntax that handles whatever site you might want to use.

Why support simple macros without any support for formatting numbers and currency? Your server-site language should support this, so why send it to the browser?

Image (pic) elements are missing height/width, so we're back to the relayout flashes that the NCSA_Mosaic browser had whenever it loaded an image.

Exercise for the reader: let your editor remove one } by random. Figure out yourself where it's missing by just reading the source.

Re: Lisp-like html as a replacement to bbcode/markup/textile

#17
Hmm, an awful lot of
s in the generated code. Never mind that I'm not a big fan of explicit

's, either, as s-expression like formatting isn't that helpful once your actual content pushes the starting tag beyond the screen. SGML is actually not a bad idea if your markup content is pretty low (It's still a bit line-noisy compared against markdown and, well, I've yet to see a forum using bbcode properly.

Re: Lisp-like html as a replacement to bbcode/markup/textile

#18
This would never replace bbcode.

The best thing to replace that is markdown.

People don't really grok tags very well at all.

BBCode only works because of WYSIWYG editors that do the work for the user. That and the wide acceptance meaning that sites like Flickr produce BBCode embed statements.

Markdown works well for people just typing in plain text but still getting something formatted without trying to tag things.

If you have a WYSIWYG editor then who cares whether this is used... and as the embed stuff isn't compatible why pick this over BBCode?

If you don't have a WYSIWYG editor, and assuming you're in a web page and a textfield, then markdown works superbly well (ignoring the ugly image syntax).

I struggle to see, given the title and mention of BBCode, how the linked article overcomes any of the issues of the existing methods or offers any benefit.

Not to say that there isn't a place for this... but BBCode isn't it.

Re: Lisp-like html as a replacement to bbcode/markup/textile

#19
post #2

Looks a lot like TeX, which is a good thing. In fact this might even be better. I'm tired so I might be missing an obvious weakness but to take the analogy a bit further here are some comparisons between this suggestion and a more TeX-like version. The author's suggestion: {b {i This is in italics and bold.}} {Henny+Penny We can use google fonts anywhere if we just import them first with the google-font code} {macro…

Why don't browsers support TeX anyway? Maybe it could even be embedded in a HTML page, like SVG.

   
   
   Hello, World
   \bye
   
Post reply on HN