Par

Software Screenshot:
Par
Software Details:
Version: 0.7
Upload Date: 20 Feb 15
Developer: Limodou
Distribution Type: Freeware
Downloads: 93

Rating: nan/5 (Total Votes: 0)

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 Programmly

Do 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 Expand

Table Support

do 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 support

do like this:

 a --
 abc
 b --
 cde


will get this:

 < dl > < dt >a< /dt > < dd >< p >abc< /p > < /dd > < dt >b< /dt > < dd >< p >cde< /p > < /dd > < /dl >

Directly links

You can use:

 http://google.com

in text.

Other text decorators

Par.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 Pages

Support tab pages, the format is:

 [[tabs(id=hello)]]:
 ` This is a test `
 [[tabs(id=world)]]:

 this is a list
 test


Bootstrap Alert

 [[alert(class=success)]]:
 Success
 [[alert(class=error)]]:
 Error
 [[alert(class=info)]]:
 Info
 [[alert]]:
 Message
 [[alert]]:
 #### Alert Title This is alert message
 [[alert(class=info,close)]]:
 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)

Requirements:

  • Python

Similar Software

JiBX
JiBX

12 May 15

Rubber
Rubber

3 Jun 15

Apache XML-RPC
Apache XML-RPC

14 Apr 15

Other Software of Developer Limodou

Plugs
Plugs

20 Feb 15

Dict4Ini
Dict4Ini

5 Jun 15

Uliweb
Uliweb

17 Feb 15

Comments to Par

Comments not found
Add Comment
Turn on images!