Cirru 是我的个人项目, 定义了一套基于缩进的语法, 然后这个语法很容易解析到语法树, 就可以用来玩和做一些比较有趣的事情, 但是我发现最有用的功能是用 Cirru 来替代 HTML 语法生成 HTML
比如这样一段 HTML, 不考虑缩进的话:
<meta charset="utf-8">
<div class="demo-a demo-b" data="root node">demo of text
<span>nothing</span>plain text</div>
<div id="entry" class="c demo"></div>
<div class="demo"></div>
<div id="demo">content</div>
<div class="class-a"></div>
我可以在 Cirru 的语法上加上一些特殊符号, 写成这样:
meta (:charset utf-8)
div (:class demo-a demo-b)
= demo of text
:data root node
span $ = nothing
= plain text
#entry.demo (:class c)
div.demo
div#demo $ = content
.class-a
主页刚刚更新 http://cirru.org/ GitHub 主页是 https://github.com/cirru 一个 Twitter 帐号 https://twitter.com/cirrulang
页面上都是抓子项目 README 生成的文档, 都是英文的… 相关的项目有下面这些… 都是很小的项目, 但是数量看起来, 呵呵:
- Parser
- Cirru Parser in CoffeeScript
- Cirru Parser in Go
- Evaluater
- Evaluater in Go
- Evaluater in CoffeeScript
- Cirru Shell
- Cirru Table: concept of debugging
- Converter
- Convert JSON to Cirru
- Convert Cirru to Mustache
- HTML templating in Cirru
- Write JavaScrip AST with Cirru
- Editor Support
- Sublime Text Package
- Cirru Editor
- Brackets Package
- CodeMorror support
- Ace Editor support
- Atom Editor support
- Highlighting
- Rainbow Plugin
- Highlight.js fork with Cirru syntax
- Pygments fork with Cirru syntax
- Custom-made Syntax Highlighting
14 回复