[2008-07-18 05:05:19] PHP Wiki语法解析类
//NOTOC
出于很多考虑,终于还是扔掉了[http://pear.php.net/|Pear]的[http://pear.php.net/package/Text_Wiki/redirected|Text_wiki]改用自己写的Wiki语法解析,专用于本[blog:av_framework|Framework]。比起Text_wiki来改善,或者说是按自己的习惯改变了很多方面:
#语法上综合了[http://wikipedia.org/|wikipedia]和[http://c2.com/cgi/wiki?PukiWiki|puki wiki]。
#支持html标记插入。
#生成的代码通过W3C Strict验证。
#即使不做解析,也是一篇表意良好,格式工整的text文档,而不像很多乍看上去如天书一般的Wiki语法
#解析速度比Text_wiki快
#加入了很多方便的特殊标记。
目前只是发布前的演示,正式版将附加在Framework中发布,有兴趣的同学可以索取源代码。那么,实验开始:
===Title Test===
Wiki代码:
=h1= ==h2== ===h3=== ====h4==== =====h5===== ======h6====== =======h7=======转换结果: =h1= ==h2== ===h3=== ====h4==== =====h5===== ======h6====== =======h7======= ---- ===Table Test=== Wiki代码:
! 1 ! 2 ! 3 ! 4 ! 5 ! ! 1 | 2 | 3 | 4 | 5 | ! 1 2 !| 3 | 4 | 5 | ! 1 2 || 3 | 4 | 5 | ! 1 | 2 3 || 4 | 5 | ! 1 | 2 | 3 4 || 5 | ! 1 | 2 | 3 | 4 5 || ! 1 2 3 !!| 4 | 5 | ! 1 | 2 3 4 ||| 5 | ! 1 | 2 | 3 4 5 ||| ! 1 2 3 4 !!!| 5 | ! 1 | 2 3 4 5 |||| ! 1 2 3 4 5 ||||| ! ---------- ! ----------- ! ---------- ! !left | right| middle |转换结果: ! 1 ! 2 ! 3 ! 4 ! 5 ! ! 1 | 2 | 3 | 4 | 5 | ! 1 2 !| 3 | 4 | 5 | ! 1 2 || 3 | 4 | 5 | ! 1 | 2 3 || 4 | 5 | ! 1 | 2 | 3 4 || 5 | ! 1 | 2 | 3 | 4 5 || ! 1 2 3 !!| 4 | 5 | ! 1 | 2 3 4 ||| 5 | ! 1 | 2 | 3 4 5 ||| ! 1 2 3 4 !!!| 5 | ! 1 | 2 3 4 5 |||| ! 1 2 3 4 5 ||||| ! ---------- ! ----------- ! ---------- ! !left | right| middle | ---- ===Paragraph Test=== Wiki代码:
//Remark will not be parse This is a normal paragraph. This is another normal paragraph. This is a paragraph with newline of br mark. This is a paragraph with newline of br mark. This is a paragraph with newline of br mark.转换结果: //Remark will not be parse This is a normal paragraph. This is another normal paragraph. This is a paragraph with newline of br mark. This is a paragraph with newline of br mark. This is a paragraph with newline of br mark. ---- ===Blockquote Test=== Wiki代码:
> Blockquote Level1 >> Blockquote Level2 >> Blockquote Level2 >>> Blockquote Level3转换结果: > Blockquote Level1 >> Blockquote Level2 >> Blockquote Level2 >>> Blockquote Level3 >>> Blockquote Level3 ---- ===List Test=== Wiki代码:
* ul list level1 ** ul list level2 ** ul list level2 *** ul list level3 **** ul list level4 **** ul list level4 * ul list level1 ** ul list level2 * ul list level1 # ol list level1 ## ol list level2 ## ol list level2 ### ol list level3 #### ol list level4 #### ol list level4 # ol list level1 ## ol list level2 # ol list level1转换结果: * ul list level1 ** ul list level2 ** ul list level2 *** ul list level3 **** ul list level4 **** ul list level4 * ul list level1 ** ul list level2 * ul list level1 # ol list level1 ## ol list level2 ## ol list level2 ### ol list level3 #### ol list level4 #### ol list level4 # ol list level1 ## ol list level2 # ol list level1 ---- ===Advance Test=== Wiki代码:
Wiki Parser can identify a url [http://allo.ave7.net/] or an image [http://www.ave7.net/logo.gif] with [http://allo.ave7.net/|account]. You can also use <i><b>Html Marks</b></i> inline. How forcibly specify this is a url [link:http://www.ave7.net/logo.gif] or an image [img:http://allo.ave7.net/photo/picasa/allovince/5220926002522558673/5220926248939178194|photo].转换结果: Wiki Parser can identify a url [http://allo.ave7.net/] or an image [http://www.ave7.net/logo.gif] with [http://allo.ave7.net/|account]. You can also use Html Marks inline. How forcibly specify this is a url [link:http://www.ave7.net/logo.gif] or an image [img:http://allo.ave7.net/photo/picasa/allovince/5220926002522558673/5220926248939178194|photo]. Read More
[2008-04-14 08:33:56] Hello Blog
//NOTOC
虽然仍显仓促,虽然仍有无数的BUG和不足,但终于还是等不到开发进度100%了。
现在在你眼前的,是一个基于未完成的Framework构筑的未完成的Blog程序。框架的开发进度不过60%,blog也只能算是半成品,最终能够发布的版本尚遥遥无期,可能一个人去写Framework是超出我现在能力范围的,但自由的想象发挥却是非常愉快的开发过程。
所以在成熟的Wordpress面前,我还是固执的改用了自己的Blog。希望不要出现太多奇奇怪怪的问题。
Hello, My Blog!
====这个Blog有什么不同====
* 基于自己编写的PHP MVC Framework
* 设计、架构、程序、美工均个人独立完成
* 核心代码仅450行
* 通过目前最严格的[http://validator.w3.org/check?uri=referer|W3C Strict] 校验
* 通过[http://jigsaw.w3.org/css-validator/validator?uri=http://allo.ave7.net/skins/tsost.css|W3C Css2.1]校验
* 关闭所有Javascript,系统仍然能正常运作
* 通过Apache [http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html|Mod_rewrite]的URL规整化及简单Rest方案
* 所有表单通过分析数据库结构自动生成
* 所有Js作为[http://jquery.com/|JQuery]插件模块化运作
* 全基于View层的简洁Ajax实现及友好的浏览器回退问题解决策略
* 经过改进的综合Wikipedia和Puki wiki的Wiki语法解析
* 基于[http://code.google.com/p/syntaxhighlighter/|Syntaxhighlighter]的语法高亮
* 基于[http://tinymce.moxiecode.com/|Tinymce]的富文本编辑器
* 与[http://www.vbulletin.com/|vBulletin]论坛交互实现单点登录
* 与[http://picasa.google.com/|Picasa]交互实现的图片Rest构架
* Google Sitemaps自动生成
Read More
