2010-04-23 python wiki pymark bottle
Берем свежую версию pymark
hg clone http://bitbucket.org/lega911/pymark
from bottle import run, debug, route, request
from pymark import mark1
def getpg(a='',b=''):
return '''<html><head>
<style type="text/css">
div.codebox {
BORDER-STYLE: solid;
BORDER-WIDTH: 1px;
WIDTH: 100%%; OVERFLOW: auto;
color: #001020;
} </style>
</head><body>
%s<hr />
<form action='/' method='post'>
<textarea name=text cols=100 rows=20>%s</textarea>
<br /><input type=submit />
</form>
</body></html>''' % (a,b)
@route('/')
def main():
return getpg()
@route('/', method='post')
def main_post():
a = request.POST.get('text','')
b = mark1(a)
return getpg(b,a)
run(host='', port=8080, reloader=True)
!Заголовок
* Отступ 1
* Отступ 2
**жинрным**, //курсив//, ##моноширинный##,
__подчеркивание__, --зачеркивается--
[{ html блок <a href="#">#</a> }]
[[@route('/')
def main():
return getpg()]]
[http://google.com Ссылка на гугл]
[google.com внутренняя ссылка]
[file:123 файл]
[image:13] тут картинка