summaryrefslogtreecommitdiff
path: root/docs/extensions/smarty.txt
blob: 84c64940075ea3f639e017b4bf313341dab29bde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
title: SmartyPants Extension
prev_title: Sane Lists Extension
prev_url:   sane_lists.html
next_title: Table of Contents Extension
next_url:   toc.html

SmartyPants
===========

Summary
-------

The SmartyPants extension converts ASCII dashes, quotes and ellipses to
their HTML entity equivalents.

ASCII symbol | Unicode replacements
------------ | --------------------
'        | ‘ ’
"       | “ ”
\...         | …
\--          | –
-\--         | —

Arguments
---------

All three arguments are set to `True` by default.

Argument         | Description
--------         | -----------
`smart_dashes`   | whether to convert dashes
`smart_quotes`   | whether to convert quotes
`smart_ellipses` | whether to convert ellipses

Usage
-----

Default configuration:

    >>> html = markdown.markdown(text,
    ...     extensions=['smarty']
    ... )

Disable quotes convertation:

    >>> html = markdown.markdown(text,
    ...     extensions=['smarty(smart_quotes=False)']
    ... )

Further reading
---------------

SmartyPants extension is based on the original SmartyPants implementation
by John Gruber. Please read it's [documentation][1] for details.

[1]: http://daringfireball.net/projects/smartypants/