summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author宋文武 <iyzsong@member.fsf.org>2021-04-01 22:48:00 +0800
committer宋文武 <iyzsong@member.fsf.org>2021-04-02 18:31:54 +0800
commita890880cf66cd2f625d648898a5c55cf3222a451 (patch)
treeed2eba20393e3d423a68fc55700add86ea9ce537
parentbd9e14085668217b5657e57ca5b13a4a55360d9c (diff)
gnu: Add python-smartypants.
* gnu/packages/python-xyz.scm (python-smartypants): New variable.
-rw-r--r--gnu/packages/python-xyz.scm41
1 files changed, 41 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 55bd9360f2..68e53c3f92 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24331,3 +24331,44 @@ number of words, syllables, and sentences.")
"This package provides a Python library that can parse OPML, FOAF, and
iGoogle subscription lists.")
(license license:expat)))
+
+(define-public python-smartypants
+ (package
+ (name "python-smartypants")
+ (version "2.0.1")
+ (source
+ (origin
+ ;; There's no source tarball for 2.0.1 on PyPI.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/leohemsted/smartypants.py")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "00p1gnb9pzb3svdq3c5b9b332gsp50wrqqa39gj00m133zadanjp"))))
+ (build-system python-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ ;; Its `setup.py test` doesn't report failure with exit status, so
+ ;; we use `nose` instead.
+ (lambda _
+ (invoke "nosetests" "-v" "--exclude=^load_tests$"))))))
+ (native-inputs
+ ;; For tests.
+ `(("python-docutils" ,python-docutils)
+ ("python-nose" ,python-nose)
+ ("python-pygments" ,python-pygments)))
+ (home-page "https://github.com/leohemsted/smartypants.py")
+ (synopsis "Translate punctuation characters into smart quotes")
+ (description
+ "@command{smartpants} can perform the following transformations:
+@enumerate
+@item Straight quotes ( \" and ' ) into \"curly\" quote HTML entities
+@item Backticks-style quotes (``like this'') into \"curly\" quote HTML
+entities
+@item Dashes (-- and ---) into en- and em-dash entities
+@item Three consecutive dots (... or . . .) into an ellipsis entity
+@end enumerate")
+ (license license:bsd-3)))