Skip to content
المشاريع

حول

إضافة محرر Markdown لـ WordPress.

الإنتاجية والأتمتة

كيف تُقاس هذه الأرقام

688 نجمة109 التفرعات +1 خلال 24 ساعة

النمو المقاس للنجوم

خلال 24 ساعة
+١
خلال 7 أيام
+١
خلال 15 يومًا
+١
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Githuber MD: Markdown editor for WordPress

English · 繁體中文 · 简体中文 · 日本語 · 한국어 · Français · Deutsch · Español · Português · Italiano · Русский · Türkçe · Tiếng Việt · Bahasa Indonesia · العربية

Githuber MD

Githuber MD lets you write WordPress posts and pages in Markdown. It replaces the classic editor's text box with a Markdown editor (CodeMirror 6) and a live preview. On your site it adds code highlighting, math, diagrams, emoji and a table of contents.

Every library ships with the plugin. Neither the editor nor your site loads anything from another server.

How it works

  1. Your Markdown is saved in wp_posts.post_content_filtered.
  2. When you save, the Markdown is converted to HTML and saved in wp_posts.post_content. That HTML is what visitors, feeds and other plugins see.
  3. On your site, one small script checks each page and loads only the libraries it needs. A post saved before you turned a feature on gets that feature too, without being saved again.

Requirements

  • WordPress 6.7 or later (tested up to 7.1)
  • PHP 7.4 or later

Download

Source Download
WordPress.org https://wordpress.org/plugins/wp-githuber-md
GitHub releases https://github.com/terrylinooo/githuber-md/releases

Installation

  1. Install the plugin from the Plugins screen, or upload the wp-githuber-md folder to /wp-content/plugins/.
  2. Activate it on the Plugins screen.
  3. Go to Githuber MD > Dashboard to turn features on, and to Githuber MD > Settings to adjust them.

Features

Markdown editor with live preview

The editor in split mode

  • Toolbar and keyboard shortcuts.
  • Three modes: edit only, split, or preview only.
  • Fullscreen, line numbers, and a light or dark theme.
  • The server renders the preview the same way it renders a saved post, so you see highlighted code, math and diagrams exactly as they will appear.
  • Toolbar buttons for "Read more" (<!--more-->) and "Page break" (<!--nextpage-->).

Paste or drop images

Paste an image into the editor

Paste or drop an image into the editor to upload it. It can go to:

  • the media library;
  • the uploads folder;
  • Imgur, sm.ms or Chevereto.

The Markdown for the image is inserted where you pasted.

HTML to Markdown

Convert an HTML post to Markdown

A post written in HTML shows a "Convert to Markdown" notice. The "HTML to Markdown" box beside the editor converts whatever text is in the editor.

On your site

Each picture is the whole browser window; click it to see it full size.

Screenshot Feature
Code highlighting Code highlighting
Prism or highlight.js, with a copy button.
Math Math
KaTeX or MathJax.
Mermaid Mermaid
Diagrams and charts written in Mermaid syntax.
Flowcharts Flowcharts
Flow charts drawn by flowchart.js.
Sequence diagrams Sequence diagrams
UML sequence diagrams written as text.
Table of contents Table of contents
In the post or as a widget.
Task lists and emoji Task lists and emoji
GitHub-style task lists, and Unicode emoji from :shortcode:.

Dashboard and settings

The Dashboard

The Githuber MD menu has a Dashboard with one card per feature: turn it on or off, see what it affects, and open its settings. The Settings page has tabs.

Settings: Editor tab

More

  • Markdown Extra, HTML5 figures with captions, and keyboard-key style for inline code.
  • Turn Markdown on or off for a single post. Works with the block editor and custom post types.
  • Optionally download remote images into your uploads folder when you save.
  • Yoast SEO readability analysis of the Markdown.
  • Every editor tool runs on a REST API (githuber-md/v1) that checks the user's capabilities.
  • Translations: Traditional Chinese (zh_TW) and Simplified Chinese (zh_CN).

Upgrading from 1.x

Version 2.0.0 is a rewrite of the whole plugin. Posts are not changed by the upgrade. What a 1.x user will notice:

  • Requirements: WordPress 6.7 and PHP 7.4 or later.
  • Editor: CodeMirror 6 replaces Editor.md. The spell-check dictionaries, the keyword suggestion tool and the Editor.md themes are gone.
  • No CDN: Every library ships with the plugin. Nothing is loaded from another site.
  • Settings: A new Githuber MD menu with a Dashboard and a Settings page. Your saved options are kept.
  • Security: Content is filtered more strictly. A link written in Markdown keeps only the URL schemes WordPress allows, and a post whose author cannot post unfiltered HTML is always filtered.

The full list of changes is in the changelog.

FAQ

What does uninstalling remove? Only with "Clear all Settings" turned on (General tab) are the plugin's options and post meta deleted. Post content, including the Markdown, is never deleted. On a multisite network, uninstalling cleans the site it runs on only; the other sites keep their options and post meta.

I switched a post to the rich editor. What happens to its Markdown? When you save the post from the rich editor, its HTML replaces the Markdown source. The revisions saved before still hold the Markdown and can be restored.

Author

Terry L. · Blog

Development

Only Docker and Make are needed on the host; PHP, Composer and Node run in containers.

make setup     # build images, start containers, install dependencies and WordPress

Visit http://localhost:8000 and log in with admin / admin. Set WP_PORT=8080 to use another port. Run make help for every target.

Command What it does
make assets Build the front end into build/ with Vite (make assets.watch rebuilds on change)
make lint WordPress Coding Standards (PHPCS with WPCS and PHPCompatibilityWP for PHP 7.4+) and ESLint (@wordpress/eslint-plugin)
make test.php PHPUnit: golden snapshots and integration tests
make test.js Vitest unit tests (builds first)
make test.e2e Playwright end-to-end tests: everything on the block theme, then the front-end specs on the classic fixture theme tests/e2e/fixtures/themes/githuber-classic
make dist Build dist/wp-githuber-md-<version>.zip (the release workflow uses the same script) and check its contents

License

GPLv3 or later

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…