diff --git a/.vimrc b/.vimrc
deleted file mode 100644
index 4621d11..0000000
--- a/.vimrc
+++ /dev/null
@@ -1,5 +0,0 @@
-let html_use_css=1
-let html_number_lines=1
-let html_no_pre=1
-syntax on
-
diff --git a/pylog.py b/pylog.py
index 5b0f153..299bbe7 100755
--- a/pylog.py
+++ b/pylog.py
@@ -3,25 +3,24 @@
import os,os.path, sys
import urllib, cgi
+import cgitb
+cgitb.enable()
+form = cgi.FieldStorage()
+
from datetime import datetime
from pylog_action import *
import pylog_config as cfg
-form = {}
-def init():
- global form
- import cgitb
- cgitb.enable()
- form = cgi.FieldStorage()
+
print 'Content-type: text/html\n\n'
def header():
print '
'
print ''
+ print ''
f = open(path)
- print f.read()
+ print markdown.markdown(f.read())
f.close()
- print '
'
+ print ' '
class BodyParser(HTMLParser):
body=False
@@ -68,15 +72,18 @@ def get_source_html(path):
#we use a fork of vim to generate a nice syntax highlighted html file
#TODO this requires further testing
p=subprocess.Popen(["/usr/bin/vim",path,\
- "-n",\
- "-cTOhtml",\
- "-cw! "+tmpfile,\
- "-cq!",\
- "-cq!"],\
- bufsize=2**16,stdout=subprocess.PIPE,stderr=subprocess.PIPE,env={"HOME":os.getcwd()})
+ "-nEs",\
+ "+syn on",\
+ "+let html_no_progress=1",\
+ "+let html_use_css=1",\
+ "+let html_number_lines=1",\
+ "+run! syntax/2html.vim",\
+ "+w! "+tmpfile,\
+ "+q!",\
+ "+q!"],\
+ stdout=subprocess.PIPE,stderr=subprocess.PIPE)
p.stdout.close()
p.stderr.close()
-# p.stdin.close()
p.wait() #wait for child to terminate
f=open(tmpfile,"r")
@@ -131,10 +138,10 @@ def prev(path):
def prev_txt(path):
fi = open(path)
txt=get_n_words(fi,40)
- print '