sphinx.ext.extlinks – Markup to shorten external links

优质
小牛编辑
116浏览
2023-12-01

New in version 1.0.

This extension is meant to help with the common pattern of having many external links that point to URLs on one and the same site, e.g. links to bug trackers, version control web interfaces, or simply subpages in other websites. It does so by providing aliases to base URLs, so that you only need to give the subpage name when creating a link.

Let’s assume that you want to include many links to issues at the Sphinx tracker, at http://bitbucket.org/birkenfeld/sphinx/issue/num. Typing this URL again and again is tedious, so you can use extlinks to avoid repeating yourself.

The extension adds one new config value:

Note

Since links are generated from the role in the reading stage, they appear as ordinary links to e.g. the linkcheck builder.