推荐学习书目
› 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
lu18887
V2EX  ›  Python

有用 Django+zinnia 建博客的同志吗,想在 markdown 里加代码高亮,有什么比较好的实践?

  •  
  •   lu18887 · Jul 24, 2014 · 5050 views
    This topic created in 4447 days ago, the information mentioned may be changed or developed.
    zinnia本身支持markdown编辑,是通过python-markdown实现的,python-markdown有一个codehilite 的扩展,codehilite 又依赖于 Pygments 。在安装了上述包且在project的settings.py有如下设置:

    ZINNIA_MARKUP_LANGUAGE='markdown'
    ZINNIA_MARKDOWN_EXTENSIONS='toc,codehilite'

    并且 pygmentize -S default -f html > pygment.css
    并将css引入到了头部。


    toc的功能正常,就是代码的高亮弄不上! 望点拨!
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2492 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 10:16 · PVG 18:16 · LAX 03:16 · JFK 06:16
    ♥ Do have faith in what you're doing.