Par

Simple structured text parser
Download

Par Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Limodou
  • Publisher web site:
  • http://code.google.com/u/limodou/

Par Tags


Par Description

Par is a simple structured text parser written in Python, for new it supports google code wiki syntax(partial) and markdown syntax. And I also extend some new syntax for it.Paring Markdown ProgrammlyDo like this: from par.md import parseHtml template = '''< !doctype html > < html > < head > < title >%(title)s< /title > < /head > < body > %(body)s < /body > < /html >''' tag_class = {'table':'table'} text = """ # Test Markdown This is a pragraph """ print parseHtml(text, template, tag_class)Markdown Syntax ExpandTable Supportdo like this: || a || b || c || || c || d || e ||will get this: < table > < tr >< td > a < /td >< td > b < /td >< td > c < /td > < /tr > < tr >< td > b < /td >< td > c < /td >< td > d < /td > < /tr > < /table >Definition List supportdo like this: a -- abc b -- cdewill get this: < dl > < dt >a< /dt > < dd >< p >abc< /p > < /dd > < dt >b< /dt > < dd >< p >cde< /p > < /dd > < /dl >Directly linksYou can use: http://google.comin text.Other text decoratorsPar.md also adds some new text decorators, such as: ^text^ < sup >text< sup > ,,text,, < sub >text< sub > ~~text~~ < span style="text-decoration: line-through" >text< /span > *text* < strong >< em >text< /em >< /strong > ___text___ < strong >< em >text< /em >< /strong >Bootstrap Tab PagesSupport tab pages, the format is: ]: ` This is a test ` ]: this is a list testBootstrap Alert ]: Success ]: Error ]: Info ]: Message ]: #### Alert Title This is alert message ]: This is an alert. It'll has a close button.For bootstrap usage, you should invoke the code like this: from par.md import parseHtml from par.bootstrap_ext import blocks print parseHtml(text, template, block_callback=blocks)Product's homepage


Par Related Software