#!/usr/bin/env bash sudo yum install hightlight xclip #if highlight or xclip is not installed # for example you are going to post contents of t.cpp highlight --enclose-pre --inline-cs t.cpp | \ sed -n "/\<pre/,/pre\>/p" | \ xclip -selection clipboardThen you can just past the formatted codes in the editing frame(html mode) of Blogger.
Note that if you are doing this on a remote machine, xclip cannot be used. Either the content is in the remote clipboard, or the X-windows is not started.
没有评论:
发表评论