great code formatting with pygment

โอ้ว หลังจากงง อยู่่นานก็หา วิธี ใส่ รูปแบบการแสดง โค้ด จนได้หนะคับเนี่ย โดยใช้งานโมดูล pygment
ตัวอย่างเช่น

import os
print os.VERSION
for i in range(1000):
print 'round %d' % (i)



โดยการใช้งานคำสั่ง
>> pygmentise -f html -o test.html test.py

การใช้งานเบื้องต้น ที่แสนจะเบื้องต้น ก็ประมาณนี้หละคับ รู้สึกเหมือนสีของไฮไลท์มันจะไม่มาด้วย อาจจะค้นหาในโอกาสวาระถัดไปหนะคับ

Comments

Popular posts from this blog

Difference between apt-get update and apt-get dis-upgrade