Is there a command line utility for rendering GitHub flavored Markdown?

后端 未结 25 1796
一个人的身影
一个人的身影 2020-11-28 16:53

I\'m wondering if there is a command line utility for taking a GitHub flavored Markdown file and rendering it to HTML.

I\'m using a GitHub wiki to create website con

25条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 17:36

    I wrote a small CLI in Python and added GFM support. It's called Grip (Github Readme Instant Preview).

    Install it with:

    $ pip install grip
    

    And to use it, simply:

    $ grip
    

    Then visit localhost:5000 to view the readme.md file at that location.

    You can also specify your own file:

    $ grip CHANGES.md
    

    And change port:

    $ grip 8080
    

    And of course, specifically render GitHub-Flavored Markdown, optionally with repository context:

    $ grip --gfm --context=username/repo issue.md
    

    Notable features:

    • Renders pages to appear exactly like on GitHub
    • Fenced blocks
    • Python API
    • Navigate between linked files (thanks, vladwing!) added in 2.0
    • Export to a single file (thanks, iliggio!) added in 2.0
    • New: Read from stdin and export to stdout added in 3.0

    Hope this helps someone here. Check it out.

提交回复
热议问题