Markdownviewer
This plugin adds a Markdown Viewer button to the frontend of your Typemill pages. It also exposes the raw Markdown source of every published page at a matching .md URL.

This is useful if you want to:
- Copy a page as Markdown for LLMs or other tools.
- View the raw Markdown source of a page in the browser.
- Share your content in a lightweight, plain-text format.
What it does
For every public page the plugin can add a small dropdown button with two actions:
- Copy page – fetches the
.mdversion of the current page and copies it to the clipboard. - View as Markdown – opens the current page with a
.mdextension in a new tab, showing the raw Markdown source.
Example: If your page is available at /my-folder/my-page, the Markdown source is exposed at /my-folder/my-page.md.
Configuration
Activate the plugin in the Typemill system settings. Then choose the button position in the plugin settings:
- In Widget – the button is added to the
widgets.markdownviewervariable. You must render this widget in your theme. - Below Headline – the button is inserted automatically at the beginning of the page content.
Add the button to your theme
If you choose the In Widget position, add the following snippet to your theme template where you want the button to appear (for example in a toolbar or sidebar):
{% if widgets.markdownviewer %}
<div id="markdownviewer" class="toolbar-icon f4 mr3">
{{ widgets.markdownviewer }}
</div>
{% endif %}
Important notes
- The
.mdendpoint only serves published pages that are visible in the public navigation. Hidden, restricted, unpublished or folder-restricted pages return a 404 response. - The plugin does not add the button to the admin or editor interface (
/tm/*).
Changelog
v1.1.0
- Rendered the widget button HTML server-side so the browser reserves the correct space before JavaScript runs. This removes the content shift when the button is placed below the headline.
- Fixed PHP 8.2+ undefined-array-key warnings and unsafe
substr()usage. - Added access control: the
.mdendpoint now returns 404 for unpublished, hidden, restricted and folder-restricted pages. - Fixed HTML entity decoding in the JavaScript URL handling.
- Added error handling for clipboard write failures.
- Prevented assets and widget markup from loading in the admin/editor area.
- Added
repofield and improved plugin metadata.
v1.0.1
- Added a setting to choose the button position: In Widget or Below Headline.
v1.0.0
- Initial release: Markdown Viewer button and
.mdendpoint for public pages.