KISS-markdown-viewer
Simple plugin to load and render .md files in admin pages or front-end. Supports headlines, bold, italics, and hyperlinks. Provides API for other plugins to integrate and graceful fallback.
by KISS Plugins · github.com/kissplugins/kiss-markdown-viewer · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kissplugins/kiss-markdown-viewer/archive/refs/heads/main.zipReadme
KISS Markdown Viewer
Contributors: KISS Plugins
Tags: markdown, viewer, parsedown, admin, shortcode
Requires at least: 5.0
Tested up to: 6.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Plugin URI: https://github.com/kissplugins/KISS-markdown-viewer
Author: KISS Plugins
Author URI: https://kissplugins.com
A lightweight “Keep It Simple, Stupid” Markdown viewer for WordPress. Render .md files in the admin area or on the front end with minimal setup. Other plugins can hook in or fall back if it’s not installed.
Table of Contents
Installation
- Upload the plugin folder (
kiss-markdown-viewer/) to your/wp-content/plugins/directory. - Ensure the
vendor/parsedowndirectory is present (bundled or via Composer). - Activate KISS-markdown-viewer through the Plugins screen in WordPress.
Usage
Admin Preview
- Navigate to KISS Markdown Viewer → MD Preview to preview any
.mdfile in the plugin folder.
Front-End Shortcode
echo do_shortcode( '[kiss_mdv_render file="docs/my-doc.md"]' );
Or directly in post/page content:
[kiss_mdv_render file="docs/my-doc.md"]
Developer API
Programmatically render Markdown:
if ( function_exists( 'kiss_mdv_render_file' ) ) {
$html = kiss_mdv_render_file( '/path/to/file.md' );
} else {
// Fallback to plain text rendering
$markdown_file = '/path/to/file.md';
if ( file_exists( $markdown_file ) ) {
$content = file_get_contents( $markdown_file );
$html = '<pre>' . esc_html( $content ) . '</pre>';
} else {
$html = 'Markdown file not found.';
}
}
Shortcode
-
Tag:
[kiss_mdv_render file="relative/path/to.md"] -
Attributes:
file(required) – Path relative to the plugin root directory.
Filters & Actions
-
Filter:
kiss_mdv_renderer_htmlModify the rendered HTML before output:add_filter( 'kiss_mdv_renderer_html', function( $html, $file ) { // Alter $html as needed return $html; }, 10, 2 ); -
Suggested Action:
kiss_mdv_renderer_before_renderHook before parsing:add_action( 'kiss_mdv_renderer_before_render', function( $file ) { // Pre-render logic } );
Changelog
1.0.1
- Updated the example API call in the documentation to include a fallback that displays the Markdown file as plain text.
1.0.0
- Initial release: basic parsing, admin preview, shortcode, and API hooks.
Upgrade Notice
1.0.0
Initial stable version.
License
This plugin is distributed under the terms of the GNU General Public License v2.0. See the license text for details.