2017年9月18日 19:20:22 星期一javascript
因工做须要, 用PHP写了一个管理接口文档的小工具, 下边介绍一下:php
浏览器展现的效果:css
项目地址:(码云)html
例子(http://doc.hearu.top/)java
项目模块说明:nginx
特色描述:git
使用说明:github
注意: web
小技巧:算法
若是不想每次提交前都手动执行 `php compile.php` 命令去编译md文件, 能够利用 Git 或 SVN 的 hook 功能去自动执行这个命令:
下边以 小海龟git为例, 给git加hook脚本:
2018-2-10 15:51:28 星期六 更新
nginx 服务器虚拟机配置:
1 server { 2 listen 80; 3 server_name www.markdown.com; 4 5 autoindex on; 6 location / { 7 root E:\virtualbox\PHP-Summer-Doc\_book; 8 fastcgi_index index.html; 9 } 10 11 }
2018-2-9 15:32:18 星期五 更新
由于sf出的md解析器在处理单行多个 <br> 的时候会间隔处理, 因此替换了另外一款解析器类 parsedown.php
这个比较快, 但他官方说明没有进行安全校验, 若是担忧安全问题要使用其余插件帮助处理一下, 如下是官方说明
Security
Parsedown does not sanitize the HTML that it generates. When you deal with untrusted content (ex: user comments) you should also use a HTML sanitizer like HTML Purifier.