Skip to content

Commit

Permalink
Use Furo theme for the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Mar 16, 2021
1 parent 45d8dc2 commit 9618f2f
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 34 deletions.
10 changes: 10 additions & 0 deletions doc-source/_static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* This file is managed by 'repo_helper'. Don't edit it directly. */

div.highlight {
-moz-tab-size: 4;
tab-size: 4;
}

.field-list dt, dl.simple dt {
margin-top: 0.5rem;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--- This file is managed by 'repo_helper'. Don't edit it directly. --->
{% extends "!layout.html" %}
{% extends "!base.html" %}
{% block extrahead %}
<link href="{{ pathto("_static/style.css", True) }}" rel="stylesheet" type="text/css">
{% endblock %}
12 changes: 12 additions & 0 deletions doc-source/_templates/sidebar/navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!---This file is managed by 'repo_helper'. Don't edit it directly.--->
<div class="sidebar-tree">
{{ furo_navigation_tree }}
</div>

<div class="sidebar-tree">
<p class="caption"><span class="caption-text">Links</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://github.com/domdfcoding/flake8-sphinx-links">GitHub</a></li>
<li class="toctree-l1"><a class="reference external" href="https://pypi.org/project/flake8_sphinx_links">PyPI</a></li>
</ul>
</div>
7 changes: 0 additions & 7 deletions doc-source/codes.rst

This file was deleted.

23 changes: 14 additions & 9 deletions doc-source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,23 @@
"sphinx": ("https://www.sphinx-doc.org/en/stable/", None),
}

html_theme = "domdf_sphinx_theme"
html_theme_options = {"logo_only": False}
html_theme = "furo"
html_theme_options = {
"light_css_variables": {
"toc-title-font-size": "12pt",
"toc-font-size": "12pt",
"admonition-font-size": "12pt",
},
"dark_css_variables": {
"toc-title-font-size": "12pt",
"toc-font-size": "12pt",
"admonition-font-size": "12pt",
},
}
html_theme_path = ["../.."]
html_show_sourcelink = True # True will show link to source

html_context = {
"display_github": True,
"github_user": "domdfcoding",
"github_repo": "flake8-sphinx-links",
"github_version": "master",
"conf_py_path": "/doc-source/",
}
html_context = {}
htmlhelp_basename = slug

latex_documents = [("index", f'{slug}.tex', project, author, "manual")]
Expand Down
17 changes: 1 addition & 16 deletions doc-source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ flake8_sphinx_links

.. end shields
For example, \`\`True\`\` should be py\:obj:\`True\`, which Sphinx will render as a link to the Python documentation.
See :doc:`examples` for further examples.

reStructuredText .rst files are not currently checked.

Installation
---------------
Expand All @@ -145,16 +140,6 @@ Installation
.. end installation
Use as a pre-commit hook
--------------------------

See `pre-commit <https://github.com/pre-commit/pre-commit>`_ for instructions

Sample ``.pre-commit-config.yaml``:

.. pre-commit:flake8:: 0.2.0
.. toctree::
:hidden:

Expand All @@ -164,7 +149,7 @@ Sample ``.pre-commit-config.yaml``:
:maxdepth: 3
:caption: Documentation

codes
usage
examples
API Reference<docs>

Expand Down
2 changes: 1 addition & 1 deletion doc-source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
autodocsumm>=0.2.0
default-values>=0.4.2
domdf-sphinx-theme>=0.3.0
extras-require>=0.2.0
furo>=2020.11.19b18
pyyaml>=5.3.1
repo-helper-sphinx-theme>=0.0.2
seed-intersphinx-mapping>=0.3.1
Expand Down
31 changes: 31 additions & 0 deletions doc-source/usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
========
Usage
========

This library provides the Flake8 plugin ``flake8-sphinx-links`` to check docstrings for double backticked
strings which should be links to the Python documentation.


For example, \`\`True\`\` should be py\:obj:\`True\`, which Sphinx will render as a link to the Python documentation.
See :doc:`examples` for further examples.

reStructuredText .rst files are not currently checked.


Flake8 codes
--------------

.. flake8-codes:: flake8_sphinx_links

SXL001


Pre-commit hook
----------------

``flake8-sphinx-links`` can also be used as a ``pre-commit`` hook
See `pre-commit <https://github.com/pre-commit/pre-commit>`_ for instructions

Sample ``.pre-commit-config.yaml``:

.. pre-commit:flake8:: 0.2.0
1 change: 1 addition & 0 deletions repo_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ short_desc: "A Flake8 plugin to check docstrings for double backticked strings w
python_deploy_version: 3.6
use_whey: true
min_coverage: 100
sphinx_html_theme: furo

conda_channels:
- conda-forge
Expand Down

0 comments on commit 9618f2f

Please sign in to comment.