Grav Markdown Typography Plugin
The Markdown Typography plugin for Grav enables substitution of typographic characters during Markdown processing.
GPM (preferred method)
You can install the plugin by running
bin/gpm install markdown-typography or searching for
markdown-typography in the Admin Panel.
Alternatively, you can download the zip version of this repository, unzip to
/your/site/grav/user/plugins and rename the directory to
markdown-typography.yaml file contains several configuration options which allow each typographic substitution to be disabled.
enabled: true smart_quotes: true line_breaks: true dashes: true ellipsis: true interrobang: true plus_minus: true x_times: true arrows: enabled: true thin_arrows: "→,←,⟶,⟵" thick_arrows: "⇒,⇐,⟹,⟸"
Features and Usage
Replaces straight quotes ('/") with the appropriate curved quote marks (‘’/“”). You don't need to do anything special to use them!
While line breaks should be avoided most of the time, there are some times when they are useful. You can already get line breaks by adding two spaces at the end of a line, but if you prefer to have a more obvious and explicit notation, this plugin allows you to get a line break by adding
\ to the end your line.
First line\ Second line
This provides access to en dash (–) and em dash (—) via
You should use an en dash in number and time ranges, such as
Clauses can use either a spaced en dash " -- " (eg. "something – clause") or an em dash without spaces "---" (eg. "something—clause"). There's also a shortcut for en dashed clauses, so "something -- clause" can be written as "something - clause" instead.
Ellipsis is the set of three dots at the end of a sentence that trails off…
... will be converted to "…".
An interrobang consists of an exclamation point combined with a question mark. This is accessed simply by typing
!?, which gets converted to "‽".
There are two sets of arrows available, namely thin and thick, which use
= for the arrow shaft, respectively. The arrow symbols also come in two lengths, which are differentiated by the number of shaft characters (1 -> short, 2 -> long). If you set just one set of arrows (right and left), then they will be used for both lengths of arrow.
Note: Due to the way Parsedown currently operates, the left and right variants of the arrow are accessed by changing the direction of the arrow head, not by putting the arrow head at the start.
There are two ways to access the plus-minus symbol (±):
×. Note: at least one space on either side is required.
MIT license. See LICENSE