jade学习
发布于 8 年前 作者 i5ting 4262 次浏览 来自 分享

jade学习

html转jade是比较省力的一种方法

使用场景:尤其是写bootstrap的时候,当然静态页面转jade也一样

hade是一个html2jade.org的copy,平常打开这个网站比较慢,索性还是在本地弄一个,用的时候一条命令打开

[sudo] npm install -g hade
hade

好处

  • html和jade互转
  • 对于学习jade是比较好的练习

详见https://github.com/i5ting/hade

2 回复

源码里有部分的socket.io和ace用法,代码没处理,先凑合着用

如果有写 CoffeeScript 的同学我想推荐这个, 模仿 React 风格, 简单粗暴: https://github.com/teambition/coffee-webpack-starter/blob/master/template.coffee

module.exports = (data) ->
  stir.render stir.doctype(),
    html null,
      head null,
        title null, "Coffee Webpack Starter"
        meta charset: 'utf-8'
        link
          rel: 'icon'
          href: 'http://tp4.sinaimg.cn/5592259015/180/5725970590/1'
        link
          rel: 'stylesheet'
          href: if data.dev then 'src/main.css' else data.style
        script src: data.vendor, defer: true
        script src: data.main, defer: true
      body null,
        div class: 'intro',
          div class: 'title', "This is a demo of Webpack usage."
          line "Open Console to see how it loads."
          div null,
            span null, "Read more at "
            a href: 'http://github.com/teambition/coffee-webpack-starter',
              'github.com/teambition/coffee-webpack-starter'
            span null, '.'
        div class: 'demo',
          React.renderToString Page()
回到顶部