WordPress Markdown 編輯器 – WP Editor.md
之前在 WordPress 上一直找不到好用的 Markdown
編輯器套件,三個月前終於讓我遇上了。
WP Editor.md (github)是目前用起來手感最好的 Markdown
套件,介面清楚之外,也支援各種相關套件,比如 Syntax Highlight、產生流程圖的 mermaid
、產生數學公式的 KaTex
等等!
Installation
由於作者不明原因棄更了,加上最後 release 的 9.9.9
版直接拔掉一些原本外掛上去的功能(Mermaid、KaTex),因此如果要有效的使用,需要自己 hack 一下。
- Clone source code
- Checkout to 6.1.5 tag(注意:是 tag)
- run
composer install
mkdir path/wp-content/plugins/wp-editormd
- 將
assets
、languages
、LICENSE
、readme.txt
、release.php
、src
、uninstall.php
、vendor
、wp-editormd.php
複製到path/wp-content/plugins/wp-editormd
- 修改
wp-editormd.php
最上方的註解,將版本號換成9.9.9
,避免 WordPress 更新 - 修改
wp-editormd.php
的WP_EDITORMD_VER
參數為9.9.9
Syntax Highlight 效果
// Coercive mode
function sumOfInts(int ...$ints)
{
return array_sum($ints);
}
var_dump(sumOfInts(2, '3', 4.1));