Skip to content

Commit

Permalink
doc: Add menu links to the sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jul 7, 2024
1 parent 07f5e56 commit 50951dc
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
.. image:: https://zenodo.org/badge/23509035.svg
:target: https://zenodo.org/badge/latestdoi/23509035

.. placeholder-for-doc-index

`NIED Hi-net <https://www.hinet.bosai.go.jp/>`__ |
`Source Code <https://github.com/seisman/HinetPy>`__ |
Expand All @@ -24,6 +23,8 @@

----

.. placeholder-for-doc-index
`HinetPy <https://github.com/seisman/HinetPy>`_ is a Python package for accessing and
processing seismic data from `NIED Hi-net <https://www.hinet.bosai.go.jp/>`__.

Expand Down Expand Up @@ -91,7 +92,7 @@ following ways:
A formal paper is published on `The Journal of Open Source Software <https://joss.theoj.org/>`__
since HinetPy v0.9.0. This is the **preferred** way for citation.

Tian, D. (2024). HinetPy: A Python package for accessing and processing NIED Hi-net seismic data.
Tian, D. (2024). HinetPy: A Python package for accessing and processing NIED Hi-net seismic data.
Journal of Open Source Software, 9(98), 6840. https://doi.org/10.21105/joss.06840

**Cite a specific HinetPy version**
Expand Down
17 changes: 17 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{# Import the theme's layout. #}
{% extends "!layout.html" %}

{% block menu %}
{{ super() }}

{% if menu_links %}
<p class="caption">
<span class="caption-text">Links</span>
</p>
<ul>
{% for text, link in menu_links %}
<li class="toctree-l1"><a href="{{ link }}">{{ text }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
25 changes: 24 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']

html_context = {
"menu_links": [
(
'<i class="fa fa-github fa-fw"></i> Source Code',
"https://github.com/seisman/HinetPy",
),
(
'<i class="fa fa-globe fa-fw"></i> NIED Hi-net',
"https://www.hinet.bosai.go.jp/",
),
(
'<i class="fa fa-book fa-fw"></i> Documentation',
"https://seisman.github.io/HinetPy/",
),
(
'<i class="fa fa-book fa-fw"></i> 中文文档',
"https://seisman.github.io/HinetPy/zh_CN/",
)
]
}

# autodoc options
autodoc_member_order = "bysource"
autoclass_content = "both"
Expand All @@ -72,7 +93,9 @@
napoleon_use_admonition_for_references = True

# intersphinx configurations
intersphinx_mapping = {"https://docs.python.org/3/": None}
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None)
}

# Chinese translation
locale_dirs = ["locale/"] # path is example but recommended.
Expand Down

0 comments on commit 50951dc

Please sign in to comment.