MKD-EXTENSIONS(7)

πŸ“¦
version 3.0.2.0 Β· 2 versions
, in arch rolling, debian bookworm, debian trixie, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ MKD-EXTENSIONS ✨

okay bestie, so this is a page from the Miscellaneous Information Manual all about mkd-extensions β€” aka the Extensions to the Markdown text formatting syntax. it's the glow-up your regular markdown never knew it needed πŸ’…


🌸 DESCRIPTION 🌸

so this version of markdown has been extended in a few ways, and honestly? she ate. the extensions came from three places: extending existing markup, creating brand-new markup from scratch, and borrowing markup from other markup languages. iconic behavior fr fr πŸŽ€


πŸ–ΌοΈ Image dimensions

markdown's embedded images got an upgrade β€” you can now specify the dimensions of the image by adding a new argument =/height/x/width/ to the link description. yes, the dimensions go height first, then width, no cap.

the new image syntax is:

![alt text](image =/height/x/width/ "title")

πŸ”— pseudo-protocols

five pseudo-protocols have been added to links. five! a whole little squad 🫢

  • id: β€” the alt text is marked up and written to the output, wrapped with <a id=id> and </a>.
  • class: β€” the alt text is marked up and written to the output, wrapped with <span class=class> and </span>.
  • raw: β€” the title is written β€” with no further processing β€” to the output. the alt text is discarded. (yeah, she's the chaotic one πŸ’€)
  • abbr: β€” the alt text is marked up and written to the output, wrapped with <abbr title=abbr> and </abbr>.
  • lang: β€” the alt text s marked up and written to the output, wrapped with <span lang=lang> and </span>.

πŸ“„ Pandoc headers

the markdown source document can have a 3-line Pandoc header, formatted like:

% title
% author(s)
% date

and that whole thing gets made available to the mkd_doc_title(), mkd_doc_author(), and mkd_doc_date() functions. cute little metadata moment ✨


πŸ“ Definition lists

a definition list item is defined as:

=tag=
    description

(that is a =, followed by text, another =, a newline, 4 spaces of intent, and then more text.)

alternatively, definition list items are defined as:

tag
: description

(this is the format that PHP Markdown Extra uses.)

two ways to do the same thing? very "two moods" energy 🌈


🎨 embedded stylesheets

stylesheets may be defined and modified in a <style> block. a style block is parsed like any other block level html; <style> starting on column 1, raw html (or, in this case, css) following it, and either ending with a </style> at the end of the line or a </style> at the beginning of a subsequent line.

⚠️ be warned that style blocks work like footnote links β€” no matter where you define them they are valid for the entire document. so like, no hiding your css in a corner, it's gonna apply everywhere bestie 😭

πŸ”€ alpha lists

alphabetic lists (like regular numeric lists, but with alphabetic items) are supported. so:

a. this
b. is
c. an alphabetic
d. list

will produce:

<ol type=a>
<li>this</li>
<li>is</li>
<li>an alphabetic</li>
<li>list</li>
</ol>

πŸ“Š tables

PHP Markdown Extra tables are supported; input of the form:

header|header
------|------
 text | text

will produce:

<table>
<thead>
<tr>
<th>header</th>
<th>header</th>
</tr>
</thead>
<tbody>
<tr>
<td>text</td>
<td>text</td>
</tr>
</tbody>
</table>

the dashed line can also contain : characters for formatting; if a : is at the start of a column, it tells discount to align the cell contents to the left; if it's at the end, it aligns right, and if there's one at the start and at the end, it centers. alignment queen πŸ‘‘


~~strikethrough~~

a strikethrough syntax is supported in much the same way that ` is used to define a section of code. if you enclose text with two or more tildes, such as ~~erased text~~, it will be written as <del>erased text</del>. like code sections, you may use as many ~ as you want, but there must be as many starting tildes as closing tildes. balance is everything, periodt πŸ¦‹


πŸ”’ markdown extra-style footnotes

PHP Markdown Extra footnotes are supported. if a footnote link begins with a ^, the first use of that footnote will generate a link down to the bottom of the rendered document, which will contain a numbered footnote with a link back to where the footnote was called. it's giving little breadcrumb trail back home πŸ“


πŸ‘‘ AUTHOR

David Parsons http://www.pell.portland.or.us/~orc/


πŸ” SEE ALSO


and that's the whole page bestie!! this one's from the MASTODON manual, dated Dec 22, 2007 β€” yeah she's vintage but she's still serving πŸ’–βœ¨πŸŽ€