Skip to content

Commit 507287f

Browse files
authored
Merge pull request #167 from FoamyGuy/docs_link_readme
add docs link to documentation section in readme
2 parents 46e5e67 + 26e2e42 commit 507287f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

{{ cookiecutter and 'tmp_repo' }}/README.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@
1111
{%- endif -%}
1212
{%- set full_repo_name = cookiecutter.github_user + "/" + repo_name -%}
1313
{%- set pypi_name = cookiecutter.library_name|lower|replace("_", "-")|replace(" ", "-") -%}
14+
{%- if cookiecutter.target_bundle == 'Adafruit' -%}
15+
{%- set docs_url = 'https://docs.circuitpython.org/projects/' + cookiecutter.library_name | lower | replace(" ", "-") + '/en/latest/' -%}
16+
{%- else -%}
17+
{%- set docs_url = 'https://circuitpython-' + cookiecutter.library_name | lower | replace(" ", "-") | replace("_", "-") + '.readthedocs.io/' -%}
18+
{%- endif -%}
1419
Introduction
1520
============
1621

1722
{% if cookiecutter.sphinx_docs | lower in ["yes", "y"] %}
1823
.. image:: https://readthedocs.org/projects/{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower | replace("_", "-")}}-{% endif %}circuitpython-{{ cookiecutter.library_name | lower | replace(" ", "-") | replace("_", "-") }}/badge/?version=latest
1924
{%- if cookiecutter.target_bundle == 'Adafruit' %}
20-
:target: https://docs.circuitpython.org/projects/{{ cookiecutter.library_name | lower | replace(" ", "-") }}/en/latest/
25+
:target: {{ docs_url }}
2126
{%- else %}
22-
:target: https://circuitpython-{{ cookiecutter.library_name | lower | replace(" ", "-") | replace("_", "-") }}.readthedocs.io/
27+
:target: {{ docs_url }}
2328
{%- endif %}
2429
:alt: Documentation Status
2530
{% endif %}
@@ -142,6 +147,7 @@ before contributing to help this project stay welcoming.
142147
143148
Documentation
144149
=============
150+
API documentation for this library can be found on `Read the Docs <{{ docs_url }}>`_.
145151
146152
For information on building library documentation, please check out
147153
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

0 commit comments

Comments
 (0)