Potential pitfalls with my new markup language?

Something that's really bothered me about XHTML, and XML in general is why it's necessary to indicate what tag you're closing. Things like `bold bold and italic just italic` aren't legal anyways. Thus I think using `{}` makes more sense. Anyway, here's what I came up with: doctype; html { head { title "my webpage" javascript ''' // code here // single quotes do not allow variable substitution, like PHP // triple quotes can be used like Python ''' } body { table { tr { td "cell 1" td "cell 2" td @var|filter1|filter2:arg } } p "variable @var in a string" p "variable @{var|withfilter}" input(type=password, value=secret); // attributes are specified like this br; // semi-colons are used on elements that don't have content p { "strings are" "automatically" "concatenated together" @andvars "too" } } } Tags that only contain one element do not need to be enclosed in braces (for example `td "cell 1"` the td is closed immediately after the text). Strings are outputted directly, except double-quoted strings allow variable substitution, and single quotes do not. I'm adopting a filtering scheme similar to Django's. The thing I'm most concerned about, I think, is variable substitution in double-quotes.. I don't want people to have to open and close single quotes everywhere because the syntax things are being treated as vars that shouldn't. I don't think the `@` character is very commonly used in code. I was going to use `$` like PHP, but jQuery uses that, and I want to allow people to do substitutions in their JS too (of course, if they don't need to, they should use single quotes!) Templates will use "dictionaries". By default, it uses this HTML dict, with familiar tags, but you can easily add your own. "Tags" may consist of not just one, but multiple HTML tags. Still need to decide how to do loops and including partials... **Edit:** Started [an open source project][1], for those interested. [1]: http://code.google.com/p/better-html/
Many features of the language you propose are remarkable similar to LaTeX...

以上就是Potential pitfalls with my new markup language?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » HTML5 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏