Skip to content

[sysmda_md_download] — download the file

Renders a link that saves the Markdown as a file rather than opening it:

[sysmda_md_download]
<a class="sysmda-md-download"
href="https://example.com/my-post.md"
download="my-post.md">Download as Markdown</a>
AttributeDefaultMeaning
idcurrent postThe post to link to
textbuilt-in labelYour own link text
[sysmda_md_download text="Save this article"]
[sysmda_md_download id="123" text="Download"]

Entirely in the browser. The link is same-origin and carries the HTML download attribute, which is all a browser needs to save the target instead of navigating to it.

The response itself sends no Content-Disposition header, and the plugin reads no request argument to trigger one. This is deliberate: the .md URL has exactly one behaviour, and it does not change based on how a client intends to store the file. Every argument read from a URL is a public input to be validated forever, and this one would have bought only the case of pasting the URL into the address bar by hand — where the browser decides, as it always has.

Derived from the post slug, then reduced to a strictly safe character set (A–Z, a–z, 0–9, ., _, -). Accented characters are transliterated, percent-encoding is decoded first, and anything left over is dropped. If nothing usable survives, the name falls back to post-123.md.

So a post at /perché-il-markdown/ downloads as perche-il-markdown.md.

The link carries one class, sysmda-md-download, and nothing else — no inline styles, no data- attributes, no stylesheet. It is a plain anchor for your theme to style:

.sysmda-md-download {
display: inline-block;
padding: .5em 1em;
border: 1px solid currentColor;
border-radius: 4px;
text-decoration: none;
}

The plugin ships no CSS for it and will not: presentation belongs to your theme, which is the only thing that knows what the rest of your page looks like.

Same rule as every other Markdown control: if the post has no .md, the shortcode outputs nothing. No empty link, no dead button.