============ Introduction ============ smartypants_ is a Python fork of SmartyPants__. .. _smartypants: https://bitbucket.org/livibetter/smartypants.py __ SmartyPantsPerl_ .. _SmartyPantsPerl: http://daringfireball.net/projects/smartypants/ smartypants can perform the following transformations: - Straight quotes (``"`` and ``'``) into “curly” quote HTML entities - Backticks-style quotes (````like this''``) into “curly” quote HTML entities - Dashes (``--`` and ``---``) into en- and em-dash entities - Three consecutive dots (``...`` or ``. . .``) into an ellipsis entity This means you can write, edit, and save your posts using plain old ASCII straight quotes, plain dashes, and plain dots, but your published posts (and final HTML output) will appear with smart quotes, em-dashes, and proper ellipses. smartypants does not modify contents in some HTML element, see :ref:`Skipped HTML Elements `. Typically, these tags are used to display text where smart quotes and other "smart punctuation" would not be appropriate, such as source code or example markup. Quick usage =========== To use it as a module: .. code:: python import smartypants text = '"SmartyPants" is smart, so is smartypants -- a Python port' print(smartypants.smartypants(text)) To use the command-line script ``smartypants``: .. code:: sh echo '"SmartyPants" is smart, so is smartypants -- a Python port' | smartypants Both produce:: “SmartyPants” is smart, so is smartypants — a Python port Installation ============ smartypants package on PyPI_ can be installed via ``pip``:: pip install smartypants .. _PyPI: https://pypi.python.org/pypi/smartypants/ If you want to install latest development code, you can run:: pip install hg+https://bitbucket.org/livibetter/smartypants.py or:: pip install hg+ssh://hg@bitbucket.org/livibetter/smartypants.py