Hi,
I think it is better to create your idea as a new extension.
Because sphinx.ext.extlink is a very small extension only to define
shortcut of hyperlink notations.
It could not customize the behavior of hyperlinks.
You can do it with following code (It's roughly, but works fine):
```
# -*- coding: utf-8 -*-
from docutils import nodes
class download_gist(nodes.Element, nodes.Inline):
pass
def visit_download_gist(self, node):
url = "
https://gist.github.com/%s" % node['reftarget']
self.body.append('<a class="reference download external" href="%s"
download="">' % url)
self.context.append('</a>')
def depart_download_gist(self, node):
self.body.append(self.context.pop())
def setup(app):
from sphinx.roles import XRefRole
app.add_role('gist-dl', XRefRole(nodeclass=download_gist))
app.add_node(download_gist,
html=(visit_download_gist, depart_download_gist))
```
Thanks,
Takeshi KOMIYA
2016-06-04 22:02 GMT+09:00 'Andreas Maier' via sphinx-dev
<
sphin...@googlegroups.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sphinx-dev+...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.