I think that this is an interesting experiment, and reminds me of Clojure's hiccup[1] library. In hiccup, you model html to be rendered as nested vectors and maps, such that bar becomes (html [:span {:class "foo"} "bar"]) Where this is a real win is when you realize that it's just data: (html [:ol (for [x (range 1 4)] [:li x])]) Lisps are well suited to model html. [1] https://github.com/weavejester/hiccup
Lisp-like html as a replacement to bbcode/markup/textile
51–60 of 83 posts
Re: Lisp-like html as a replacement to bbcode/markup/textile
#52I think that this is an interesting experiment, and reminds me of Clojure's hiccup[1] library. In hiccup, you model html to be rendered as nested vectors and maps, such that bar becomes (html [:span {:class "foo"} "bar"]) Where this is a real win is when you realize that it's just data: (html [:ol (for [x (range 1 4)] [:li x])]) Lisps are well suited to model html. [1] https://github.com/weavejester/hiccup
It's an interesting concept, but I find that (1) it's hard to work on it together with designers and (2) for larger templates I don't find it that elegant.
Re: Lisp-like html as a replacement to bbcode/markup/textile
#53No. How does it replace markup?! It's still writing html but (more or less) using {} instead of . That's just silly, imo. Markup (and restructured text) are so much more concise because you don't need to know what's or or whatever. Also, the page itself uses markup in HTML (not CSS)... wow.. back in 1995 again, are we?
Line by line parsers are extremely limited and markdown makes use of everyday characters we use in text for their formatting. The page itself uses style tags at the top so not sure what you mean. This is just showing off my progress so far of something I plan to use. Not an announcement telling you this is the future.
Re: Lisp-like html as a replacement to bbcode/markup/textile
#54Looks 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
Re: Lisp-like html as a replacement to bbcode/markup/textile
#55I don't get how people likes Lisp syntax so much, for me it looks horrible. I would prefer markdown as a replacement for BBCode
Line by line parsers are much much more limited. This can support syntax transformations and html attributes. This is more of an html-alternative in terms of capability. Markdown links are ugly and you need double space instead of single space for every space you input. I could do something like replace things nested in as italics but I'd rather have normal characters not turned into formatting. Lisp might look ugly…
[Google][]
[google]: http://www.google.com/
[Google][1]
[1]: http://www.google.com/
[Google](http://www.google.com)
I'm not sure what you mean about double-spacing either. Line breaks () are made by adding two spaces to the end of a line. If you don't like that, try GitHub-flavored Markdown [2].[1]: http://daringfireball.net/projects/markdown/syntax#links [2]: http://github.github.com/github-flavored-markdown/
Re: Lisp-like html as a replacement to bbcode/markup/textile
#56Re: Lisp-like html as a replacement to bbcode/markup/textile
#57Hmm, 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.
A new BR for every enter I press. The goal was to make the text in the textarea readable. Maybe that's why markdown uses 2 line breaks for every but I'm not sure I want to do that.
Re: Lisp-like html as a replacement to bbcode/markup/textile
#58I think that this is an interesting experiment, and reminds me of Clojure's hiccup[1] library. In hiccup, you model html to be rendered as nested vectors and maps, such that bar becomes (html [:span {:class "foo"} "bar"]) Where this is a real win is when you realize that it's just data: (html [:ol (for [x (range 1 4)] [:li x])]) Lisps are well suited to model html. [1] https://github.com/weavejester/hiccup
Lua's table syntax is well-suited to this style of embedding html/xml syntax in a programming language, e.g., if you define the appropriate functions a and i to represent anchors and italics, then you can define an anchor element:
a {href=url, name="next",
"Go to the",
i "next",
"element"}Re: Lisp-like html as a replacement to bbcode/markup/textile
#59This 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. I…
Any board out there is full of posts with broken quotes and markup. I don't think BBCode works. It's widespread but it doesn't mean it works.
I otherwise agree with your points.
Re: Lisp-like html as a replacement to bbcode/markup/textile
#60Earlier quoted context omitted.
A new BR for every enter I press. The goal was to make the text in the textarea readable. Maybe that's why markdown uses 2 line breaks for every but I'm not sure I want to do that.
I still don't see a reason for manual linebreaks here, which would mostly be useful for things like poems etc, where you explicitely need to mandate a certain structure. For everything else paragraphs seem a better solution, especially compared to pervasive use for to simulate post-paragraph spacing.
either.