
內容簡介
Markdown Editor會將預設的WordPress編輯器替換為一個Markdown編輯器,供您在文章和頁面中使用。此外,該外掛使用Jetpack Markdown模組將Markdown轉換為HTML,如果兩個外掛都已安裝,則它們可以很好地協同工作。
撰寫文章時可以選擇四種編輯版面配置:預設、預覽、全屏和分屏。更改將自動更新,使您能夠撰寫時預覽內容。
Markdown Editor預設僅對文章啟用,但您可以通過添加文章類型支援來啟用它以對頁面和自訂類型的文章進行支援。例如,要為頁面添加對Markdown的支援,請將以下代碼添加到您的佈景主題的functions.php文件中:
add_post_type_support( 'page', 'wpcom-markdown' );
要為“產品”自訂文章類型添加Markdown支援,請將以下代碼添加到您的佈景主題的functions.php文件中:
add_post_type_support( 'product', 'wpcom-markdown' );
語法高亮
Markdown Editor預設啟用代碼塊的語法高亮。您可以通過在您的佈景主題的functions.php文件中添加以下代碼來移除它:
add_filter( 'markdown_editor_highlight', '__return_false' );
點擊複製按鈕可以使用以下代碼移除:
add_filter( 'markdown_editor_clipboard', '__return_false' );
外掛標籤
開發者團隊
原文外掛簡介
Markdown Editor replaces the default WordPress editor with a Markdown editor for your posts and pages. This plugin uses the Jetpack Markdown module for converting Markdown into HTML and plays nicely with Jetpack if both plugins are installed.
There are 4 editor layouts to choose from when writing posts: default, preview, full-screen and split screen. Changes are updated automatically allowing you to preview your content as you write.
By default Markdown Editor is only enabled on Posts, but you can enable it on pages and custom post types by adding post type support. For example to add Markdown support to Pages, add the following line of code to your theme’s functions.php file:
add_post_type_support( 'page', 'wpcom-markdown' );
To add Markdown support to a ‘Product’ custom post type, add this to your theme’s functions.php file:
add_post_type_support( 'product', 'wpcom-markdown' );
Syntax Highlighting
By default, Markdown Editor enables syntax highlighting for code blocks. This can be removed by adding the following line of code to your theme’s functions.php file:
add_filter( 'markdown_editor_highlight', '__return_false' );
The click to copy button can be removed with the following line:
add_filter( 'markdown_editor_clipboard', '__return_false' );
