Sphinx: [PATCH] Email role with obfuscation

Created on 2 Jan 2015  路  4Comments  路  Source: sphinx-doc/sphinx

This extension provides an email role that obfuscates addresses in HTML.

Usage:

:email:Name Surname <[email protected]> -> renders as "Name Surname" with the appropriate mailto link

:email:[email protected] -> renders as "[email protected]" with the
appropriate mailto link

I make use of

http://pypi.python.org/pypi/bud.nospam

that encodes the e-mail address using ROT13 and generates a javascript
snippet such as:

#!html


 <p><script type="text/javascript">document.write(
             "<n uers=\"znvygb:fgrsna\100fha\056np\056mn\">Fgrsna inaqre Jnyg <\057n>".replace(/[a-zA-Z]/g,
             function(c){
               return String.fromCharCode(
               (c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));
               </script></p>

enhancement

Most helpful comment

Will do, thanks for the quick reply.

All 4 comments

_From Pedro Algarvio on 2011-01-29 17:34:09+00:00_

Released on behalf of Kevin Teague:

http://pypi.python.org/pypi/sphinxcontrib-email

Could the PyPI release be updated? The version on https://github.com/thewtex/sphinx-contrib/blob/master/email/sphinxcontrib/email.py works for Python 3, but the old one on PyPI doesn't.

sphinxcontrib-email is not managed by sphinx-doc/sphinx repository.
Please contact to the owner of sphinxcontrib-email package.

Will do, thanks for the quick reply.

Was this page helpful?
0 / 5 - 0 ratings