4 ms·
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 bi
by pjin 14y ago
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 foobar {u {b %s}}}
TeX-like (yes I'm making up the keywords):
{\b {\i This is in italics and bold.}}
{\font {Henny+Penny} We can use google fonts anywhere if we just import them first with the google-font code}
{\macro {foobar} {\u {\b #1}}}
I would definitely prefer the first alternative over the TeX-like. The analogy also suggests though that instead of HTML "<br />" you could have a TeX-like atom "\br" instead of "{br}"; saves only one character, but easy to see inside a block of text.
- silvestrov 14y agoMain 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: <a href='subdir'> versus <font name='subdir'> versus <subdir>... 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.
- JimmyRuska 14y agoyou can use the _style attribute with any element. For example {b_style="font-size:20;font-family:Courier New" content}. I intended it to work with other html attributes, so using multiple attributes would look like this {b_attr1='asdf'_attr2="asdf" content}. It would be just like html almost except for the quirky syntax. I only allow syntax for now because it's intended to be safe and I didn't want to allow things like onclick or anything javascript. Allowing a class attribute is also easy, but for now I didn't want to because the site I will be adding it to soon could use a previously defined class that's width 600 or something. Right now style is well controlled if you try to make things too wide or use something like display:none
- printer 14y agoWhy don't browsers support TeX anyway? Maybe it could even be embedded in a HTML page, like SVG. <!doctype html> <tex> Hello, World \bye </tex>
- cpach 14y agoThere is actually an XML version of TeX: http://getfo.org/texml/ http://getfo.org/texml/
- jimktrains2 14y agoI always thought it was an obvious chose given the people who started this (academics).