28 lines
1.7 KiB
Markdown
Executable File
28 lines
1.7 KiB
Markdown
Executable File
Embed a live Markdown file directly into your page — always showing the current version, with no copy-pasting.
|
|
|
|
## The problem it solves
|
|
|
|
Documentation, changelogs, and README files usually live in Markdown format in a repository, separate from your WordPress site. Keeping a WordPress page in sync with them means manually copying the content across every time it changes.
|
|
|
|
## How it helps
|
|
|
|
Point the Markdown Widget at any Markdown file URL — a GitHub README, a changelog, a docs page — and it fetches the file on your server and renders it as proper HTML headings, lists, code blocks, and links. Because the fetch happens server-side, it works with private and self-hosted repositories too, not just sources that permit cross-origin requests.
|
|
|
|
## The result
|
|
|
|
A documentation or changelog page on your WordPress site that's always current, sourced directly from wherever the Markdown file actually lives.
|
|
|
|
## One document per product, without one page per product
|
|
|
|
The widget also comes with a `[dj_markdown]` shortcode, which works anywhere a widget can't go — inside a WooCommerce product tab, a text editor, or a template.
|
|
|
|
Instead of a fixed URL, the shortcode can read the URL from a custom field on whatever is being displayed:
|
|
|
|
```
|
|
[dj_markdown acf_field="changelog_url"]
|
|
```
|
|
|
|
Add a URL field to your products, place that single shortcode once, and every product shows its own document. A software shop can give each plugin a live Changelog tab that updates itself from the repository — no per-product page building, and nothing to maintain by hand as versions ship.
|
|
|
|
It reads ACF fields where ACF is installed and falls back to standard custom fields where it isn't, so it fits whichever setup a site already uses.
|