summaryrefslogtreecommitdiff
path: root/sphinx/ext/jsmath.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-07-08 23:38:16 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-07-09 00:22:03 +0900
commit4fbcb5bfd6611b4a63b8444f531a7bfe0061dcfd (patch)
treec0d70c624571883725ef97237ca37bf63f383050 /sphinx/ext/jsmath.py
parentb21ba6587366ddc911ee887f0866104b51b5135e (diff)
downloadsphinx-git-4fbcb5bfd6611b4a63b8444f531a7bfe0061dcfd.tar.gz
math: Add hyperlink marker to each equations in HTML output
Diffstat (limited to 'sphinx/ext/jsmath.py')
-rw-r--r--sphinx/ext/jsmath.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sphinx/ext/jsmath.py b/sphinx/ext/jsmath.py
index f36e12fed..9fb790e1b 100644
--- a/sphinx/ext/jsmath.py
+++ b/sphinx/ext/jsmath.py
@@ -13,6 +13,7 @@
from docutils import nodes
import sphinx
+from sphinx.locale import _
from sphinx.application import ExtensionError
from sphinx.ext.mathbase import setup_math as mathbase_setup
@@ -34,8 +35,9 @@ def html_visit_displaymath(self, node):
if i == 0:
# necessary to e.g. set the id property correctly
if node['number']:
- self.body.append('<span class="eqno">(%s)</span>' %
- node['number'])
+ self.body.append('<span class="eqno">(%s)' % node['number'])
+ self.add_permalink_ref(node, _('Permalink to this code'))
+ self.body.append('</span>')
self.body.append(self.starttag(node, 'div', CLASS='math'))
else:
# but only once!