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

后端 未结 25 1709
一个人的身影
一个人的身影 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:45

    I've not found a quick and easy method for GitHub-flavoured Markdown, but I have found a slightly more generic version - Pandoc. It converts from/to a number of formats, including Markdown, Rest, HTML and others.

    I've also developed a Makefile to convert all .md files to .html (in large part to the example at Writing, Markdown and Pandoc):

    # 'Makefile'
    MARKDOWN = pandoc --from gfm --to html --standalone
    all: $(patsubst %.md,%.html,$(wildcard *.md)) Makefile
    
    clean:
        rm -f $(patsubst %.md,%.html,$(wildcard *.md))
        rm -f *.bak *~
    
    %.html: %.md
        $(MARKDOWN) $< --output $@
    

提交回复
热议问题