Skip to content

Commit

Permalink
add social icons theme option to docs (#167)
Browse files Browse the repository at this point in the history
- add `social` option to theme.conf
- add description of `social` option to customization.rst
- also adds common venv folders to gitignore which makes it easier to use an isolated venv on local dev machine.
  • Loading branch information
2bndy5 authored Sep 30, 2022
1 parent a8be60f commit a944f27
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ __pycache__/
/*.egg-info
/dist

# python virtual env
.env/
.venv/

# Unit test / coverage reports
.pytest_cache/

Expand Down
12 changes: 12 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@
],
# END: version_dropdown
"toc_title_is_page_title": True,
# BEGIN: social icons
"social": [
{
"icon": "fontawesome/brands/github",
"link": "https://github.com/jbms/sphinx-immaterial",
},
{
"icon": "fontawesome/brands/python",
"link": "https://pypi.org/project/sphinx-immaterial/",
},
],
# END: social icons
}
# end html_theme_options

Expand Down
19 changes: 17 additions & 2 deletions docs/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
.. role:: accent-blue-grey
.. role:: accent-white

.. _any of the icons bundled with this theme: https://github.com/squidfunk/mkdocs-material/tree/master/material/.icons

.. _customization:

=============
Expand Down Expand Up @@ -212,7 +214,7 @@ Configuration Options

The icon that represents the source code repository can be changed using the ``repo`` field of the
``icon`` `dict` (within the `html_theme_options` `dict`). Although this icon can be
`any of the icons bundled with this theme <https://github.com/squidfunk/mkdocs-material/tree/master/material/.icons>`_,
`any of the icons bundled with this theme`_,
popular choices are:

- |fa-git| ``fontawesome/brands/git``
Expand Down Expand Up @@ -361,7 +363,7 @@ Configuration Options
- The ``name`` field specifies the text in the tooltip.
- The ``icon`` field specifies an icon to use that visually indicates which scheme is
currently used.
Options must be `any of the icons bundled with this theme <https://github.com/squidfunk/mkdocs-material/tree/master/material/.icons>`_.
Options must be `any of the icons bundled with this theme`_.
Popular combinations are

.. csv-table::
Expand Down Expand Up @@ -470,6 +472,19 @@ Configuration Options
"toc_title_is_page_title": True,
}
.. themeconf:: social

A `list` of `dict`\ s that define iconic links in the site's footer. Each `dict` shall
have a :python:`"icon"` and a :python:`"link"` field.

- The :python:`"icon"` field can be specifed as `any of the icons bundled with this theme`_
- The :python:`"link"` field is simply the hyperlink target added to the icon specified.

.. literalinclude:: conf.py
:caption: This theme uses the following configuration:
:start-after: # BEGIN: social icons
:end-before: # END: social icons

.. themeconf:: version_dropdown

A `bool` flag indicating whether the version drop-down selector should be used. See
Expand Down
3 changes: 3 additions & 0 deletions sphinx_immaterial/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ analytics =
# See https://squidfunk.github.io/mkdocs-material/setup/adding-a-comment-system/#disqus
disqus =

# social icons in the footer
social =

# Repository integration
# See https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#configuration
# Set the repo url for the link to appear
Expand Down

0 comments on commit a944f27

Please sign in to comment.