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

用 pelican 写 blog 的小伙伴,请教个 markdown 显示的问题

  •  
  •   joyc · Mar 28, 2019 · 1642 views
    This topic created in 2741 days ago, the information mentioned may be changed or developed.

    已知官方使用的是这个 markdown 扩展: 根据文档写日志时候加入代码块却没有正确表示

    文档中的说明: https://python-markdown.github.io/extensions/code_hilite/#syntax

    代码块表示是写三个冒号紧跟代码语言,代码段有 indent,如下是可以正常显示的。

    :::python
    # Code goes here ...
    

    但是我贴的代码中有<和>的时候,比如 js 或者 html,就给转义了,是我的写错了还是需要设置什么吗? 另文档说代码第一行有 Shebang (with path)就可以显示行号,我的 Code blocks 5 有却没有正常显示出来。

    我的测试日志如下: http://hython.com/articles/2019/01/04/markdown-examples-part-3/

    Code blocks 1 是:::python 正常显示没问题。
    Code blocks 2 是:::html 没有正常显示,<>被转义。
    Code blocks 4 是:::javascript 也没有正常显示>被转义成&gt。
    Code blocks 5 java 也是同样问题。
    Code blocks 6 加了#!/usr/bin/python也没有显示行号。

    希望有遇到相同问题的朋友或有经验的小伙伴告知,刚从 hexo 转到 pelican,我就想好好写个 blog 而已。

    1 replies  •  2019-03-28 22:04:54 +08:00
    frostming
        1
    frostming  
       Mar 28, 2019
    这个纯粹是 markdown parser 的问题吧,居然用非标准的三冒号

    hexo 不挺好的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4912 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 09:15 · PVG 17:15 · LAX 02:15 · JFK 05:15
    ♥ Do have faith in what you're doing.