jf<dZddlZddlZdZGddZdZedfdZedfd Zd@d Zd@d Z d@d Z d Z dZ dZ dZd@dZdAdZdZedkr{ddlZddlZ ejejdejdZn #dZYnxYweddZejddeZdedDZedZe e!eddD]JZ"ej#ee"D](Z$d%ege$RZ&e&ej'vre&Zn)eej'vreZHdZKddl(Z(e(j)dZ*e*+dd dd!"e*+d#d$d%d&"e*+d'd(ed)e"e*+d*d+d,d-.e*+d/d,d0.e*+d1d,d2.e*+d3d,d4.e*+d5d,d6.e*,Z-e-j.r e/edSe-j0r e/edSe-j1rne/e/d7e/d8e/d9e2ej'3D]Z4e/e4d:d;ej'e4dSe-j5r]ddl6Z6Gd<d=e6j7Z8e6j9:e8Z;e6j<=e;dSe-j>r:d>e-j?vr!e-j?d>de-_?ne-xj?d>z c_?ej@AZBe/eeBe-jCe-j??dSdS)Bu5- ========================= Smart Quotes for Docutils ========================= Synopsis ======== "SmartyPants" is a free web publishing plug-in for Movable Type, Blosxom, and BBEdit that easily translates plain ASCII punctuation characters into "smart" typographic punctuation characters. ``smartquotes.py`` is an adaption of "SmartyPants" to Docutils_. * Using Unicode instead of HTML entities for typographic punctuation characters, it works for any output format that supports Unicode. * Supports `language specific quote characters`__. __ https://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks Authors ======= `John Gruber`_ did all of the hard work of writing this software in Perl for `Movable Type`_ and almost all of this useful documentation. `Chad Miller`_ ported it to Python to use with Pyblosxom_. Adapted to Docutils_ by Günter Milde. Additional Credits ================== Portions of the SmartyPants original work are based on Brad Choate's nifty MTRegex plug-in. `Brad Choate`_ also contributed a few bits of source code to this plug-in. Brad Choate is a fine hacker indeed. `Jeremy Hedley`_ and `Charles Wiltgen`_ deserve mention for exemplary beta testing of the original SmartyPants. `Rael Dornfest`_ ported SmartyPants to Blosxom. .. _Brad Choate: http://bradchoate.com/ .. _Jeremy Hedley: http://antipixel.com/ .. _Charles Wiltgen: http://playbacktime.com/ .. _Rael Dornfest: http://raelity.org/ Copyright and License ===================== SmartyPants_ license (3-Clause BSD license): Copyright (c) 2003 John Gruber (http://daringfireball.net/) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name "SmartyPants" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. smartypants.py license (2-Clause BSD license): smartypants.py is a derivative work of SmartyPants. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. .. _John Gruber: http://daringfireball.net/ .. _Chad Miller: http://web.chad.org/ .. _Pyblosxom: http://pyblosxom.bluesock.org/ .. _SmartyPants: http://daringfireball.net/projects/smartypants/ .. _Movable Type: http://www.movabletype.org/ .. _2-Clause BSD license: https://opensource.org/licenses/BSD-2-Clause .. _Docutils: https://docutils.sourceforge.io/ Description =========== SmartyPants can perform the following transformations: - Straight quotes ( " and ' ) into "curly" quote characters - Backticks-style quotes (\`\`like this'') into "curly" quote characters - 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 characters within ``
``, ````, ````,
```` or ``