[PYTHON] In Vim: set to output html from markdown using pandoc with make

It's not necessary to summarize it, but as an amnesia. Like MacOSX

brew install pandoc

To install pandoc. Prepare the following script. Name it as make_markdown.py and put it in an appropriate folder.

import sys
import glob
import commands

param = sys.argv
if (len(param) == 2):
    f = param[1]
    h = f[0:-3] + '.html'
    command = "pandoc %s -s -o %s" % (f, h)
    commands.getoutput(command)
    quit()

Add the following to vimrc.

au FileType markdown setlocal makeprg=python\ ~/dotfiles/make_markdown.py\ %

Here, I installed it in ~ / dotfiles / make_markdown.py. This will issue a file like ʻa.html to ʻa.md with the: make command. If you want to do something richer, you should probably install vim-pandoc.

Recommended Posts

In Vim: set to output html from markdown using pandoc with make
Convert from Markdown to HTML in Python
Output the contents of ~ .xlsx in the folder to HTML with Python
I made a plugin to generate Markdown table from csv in Vim
Create a tool to automatically furigana with html using Mecab from Python3
Explain in detail how to make sounds with python
Try to make RESTful API with MVC using Flask 1.0.2
Markdown output with Django
Try to make it using GUI and PyQt in Python
How to output a document in pdf format with Sphinx
How to set the html class attribute in Django's forms.py
Things to keep in mind when using Python with AtCoder
I tried to make a stopwatch using tkinter in python
Things to keep in mind when using cgi with python.
Output to syslog with Loguru
Easy to make with syntax
Make it possible to output a log to a file with go echo
Re: Life in Heroku starting from scratch with Flask ~ PhantomJS to Heroku ~
Throw something to Kinesis with python and make sure it's in
I tried to make a todo application using bottle with python
Implement ranking processing with ties in Python using Redis Sorted Set
How to make a face image data set used in machine learning (3: Face image generation from candidate images Part 1)