开发工具 更新了我的模版引擎 Cirru HTML

jiyinyiyong · May 03, 2014 · Last by jiyinyiyong replied at May 18, 2014 · 2566 hits

想做成脚本语言结果 HTML 写得挺顺的 - -!

代码:https://github.com/Cirru/cirru-html

在线的 Demo: http://repo.cirru.org/html 可以修改左边的框框,点击按钮右边显示编译结果

借鉴了 Vue.js 模版的形态,所以一个列表是这样展开的:

@repeat (@ list)
  div
    = a line
    p $ = (@ @key)
    p $ = (@ @value)

    @if (@ @last)
      p $ = this is last one

    @if (@ @first)
      p $ = this is the first

目前我个人用这个工具来生成简单的 HTML.

这个项目是 Cirru 的一部分:http://cirru.org/ 另外目前代码可以尝试在 Chrome 当中编辑 http://v2ex.com/t/110156

Bug 略多,欢迎吐槽。

支持一下

#1 楼 @palytoxin 终于有人回复了.. 我考虑一下美化一下主页吧..

@jiyinyiyong 初看起来好像 slim

#3 楼 @zlfera 缩进语法的几个看起来都类似的,选择器语法都是从 CSS 类比过来的 至于属性和文本,以及控制语句各自会不一样

You need to Sign in before reply, if you don't have an account, please Sign up first.