=================================================== Example of sphinxcontrib.linkattr with Font Awesome =================================================== `Homepage `_ Demo ==== - external link: `Font Awesome `_ - internal link: :doc:`subpage` .. toctree:: :maxdepth: 1 :caption: Contents: subpage Other Demos =========== - `*open in new tab* link `_ - `*open in new tab* link with a svg image icon `_ ----- From `README.md `_ =================================================================================================== A Sphinx extension, which overrides attributes of internal/external links. - `tests/fontawesome/ `_: (demo: this page) An example of the usage of `linkattr_suffix_external` as a `doctutils.nodes` object, which has a `Font Awesome `_ icon. - In `conf.py` .. code-block:: python html_static_path = ['_static', '_static/css', '_static/webfonts'] html_css_files = ['css/fontawesome-all.css', 'custom.css'] extensions += ['sphinxcontrib.linkattr'] linkattr_suffix_external = dict(node='raw', format='html', text='') - In `_static/custom.css` .. code-block:: css i.fas.fa-external-link-alt { color: #AAAAAA; font-size: 0.8em; letter-spacing: 0.2em; margin-left: 0.2em; } - You will need to download `fontawesome-*.zip `_ and place `css/fontawesome-all.css` and `webfonts/*` into `_static/` (See also `Hosting Font Awesome Yourself `_).