From 5f941454f9f7c8b62efec24917b2c7ba983d603c Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 29 Aug 2014 22:18:10 -0400 Subject: Some docs cleanup. --- docs/extensions/smarty.txt | 54 ++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'docs/extensions/smarty.txt') diff --git a/docs/extensions/smarty.txt b/docs/extensions/smarty.txt index a1b8d6e..a0680af 100644 --- a/docs/extensions/smarty.txt +++ b/docs/extensions/smarty.txt @@ -13,33 +13,31 @@ Summary The SmartyPants extension converts ASCII dashes, quotes and ellipses to their HTML entity equivalents. -ASCII symbol | Replacements | HTML Entities ------------- | --------------- | ------------------- -`'` | ‘ ’ | `‘` `’` -`"` | “ ” | `“` `”` -`<< >>` | « » | `«` `»` -`...` | … | `…` -`--` | – | `–` -`---` | — | `—` +ASCII symbol | Replacements | HTML Entities | Substitution Keys +------------ | --------------- | ------------------- | ---------------------------------------- +`'` | ‘ ’ | `‘` `’` | `'left-single-quote'`, `'right-single-quote'` +`"` | “ ” | `“` `”` | `'left-double-quote'`, `'right-double-quote'` +`<< >>` | « » | `«` `»` | `'left-angle-quote'`, `'right-angle-quote'` +`...` | … | `…` | `'ellipsis'` +`--` | – | `–` | `'ndash'` +`---` | — | `—` | `'mdash'` Using the configuration option 'substitutions' you can overwrite the -default substitutions. Just pass a dict mapping (a subset of) the following +default substitutions. Just pass a dict mapping (a subset of) the keys to the substitution strings. - - 'mdash', 'ndash', 'ellipsis', - 'left-angle-quote', 'right-angle-quote', - 'left-single-quote', 'right-single-quote', - 'left-double-quote', 'right-double-quote' -Use e.g. the following config to get correct quotes for the German language: +For example, one might use the following config to get correct quotes for +the German language: extensionConfigs = { - 'smarty': [('substitutions', { - 'left-single-quote': '‚', # sb is not a typo! - 'right-single-quote': '‘', - 'left-double-quote': '„', - 'right-double-quote': '“' - })] + 'smarty': { + 'substitutions': { + 'left-single-quote': '‚', # sb is not a typo! + 'right-single-quote': '‘', + 'left-double-quote': '„', + 'right-double-quote': '“' + } + } } !!! note @@ -57,8 +55,8 @@ Use e.g. the following config to get correct quotes for the German language: Usage ----- -See [Extensions](index.html) for general extension usage, specify `markdown.extensions.smarty` -as the name of the extension. +See [Extensions](index.html) for general extension usage, specify +`markdown.extensions.smarty` as the name of the extension. See the [Library Reference](../reference.html#extensions) for information about configuring extensions. @@ -67,11 +65,11 @@ The following options are provided to configure the output: Option | Default value | Description ------ | ------------- | ----------- -`smart_dashes` | enabled | whether to convert dashes -`smart_quotes` | enabled | whether to convert straight quotes -`smart_angled_quotes` | disabled | whether to convert angled quotes -`smart_ellipses` | enabled | whether to convert ellipses -`substitutions` | {} | overwrite default substitutions +`smart_dashes` | `True` | whether to convert dashes +`smart_quotes` | `True` | whether to convert straight quotes +`smart_angled_quotes` | `False` | whether to convert angled quotes +`smart_ellipses` | `True` | whether to convert ellipses +`substitutions` | `{}` | overwrite default substitutions Further reading --------------- -- cgit v1.2.3