推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
love
V2EX  ›  Python

看到一个脑洞大开的用 python 直接作模板语法的模板引擎

  •  
  •   love · Aug 13, 2014 · 5327 views
    This topic created in 4440 days ago, the information mentioned may be changed or developed.
    之前以为这是不可能的,因为python的语法比较严格,又有缩进,又没block语法,直接当DSL来写模板一定会死得很惨,直到看到这个奇葩:

    http://breve.twisty-industries.com/documentation

    把python模板写得几乎有原版HTML一样的可读性。
    6 replies  •  2014-08-15 09:52:04 +08:00
    WildCat
        1
    WildCat  
       Aug 13, 2014 via iPad
    Jade躺枪,TJ大大泪目
    fwee
        2
    fwee  
       Aug 13, 2014
    现在知道大括号的好了?
    love
        3
    love  
    OP
       Aug 13, 2014
    @WildCat 关Jade什么事?
    lyhapple
        4
    lyhapple  
       Aug 14, 2014
    果是个奇葩, 只有想不到,没有做不到.
    skywalker
        5
    skywalker  
       Aug 14, 2014   ❤️ 1
    编程语言直接做模板,看到过最舒服的是CoffeeKup
    bombless
        6
    bombless  
       Aug 15, 2014
    这个的确是Jade风格。
    在Jade之前包括Racket在内的Lisp系就是这种风格了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2979 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 15:01 · PVG 23:01 · LAX 08:01 · JFK 11:01
    ♥ Do have faith in what you're doing.