LoginSignup
2
2

More than 5 years have passed since last update.

Pandocを用いたソースコードの簡易カラー出力

Last updated at Posted at 2015-05-13

pandocを導入した上で、

function highlighter(){
    sed '1i```{.'$1' .numberLines}' | sed '$a```' | pandoc -s;
}
alias highlighter=highlighter
> highlighter cpp < input.cpp > output.html

wkhtmltopdfを導入すれば

> cat input.cpp | highlighter cpp | wkhtmltopdf - output.pdf

とすることで、PDF出力可能。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2