Skip to content

Commit

Permalink
Add warning to top of latest docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mesozoic committed Aug 6, 2023
1 parent f203ac9 commit 9b30651
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 10 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions docs/source/_warn_latest.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. only:: readthedocs_latest

.. warning::

This documentation was generated for an unreleased build of pyAirtable,
and might describe unreleased features. For the latest released version, see
https://pyairtable.readthedocs.io/en/stable/
4 changes: 3 additions & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.. include:: substitutions.rst
.. include:: _warn_latest.rst
.. include:: _substitutions.rst


API Reference
=============
Expand Down
12 changes: 12 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
import pyairtable.orm.fields
from pyairtable import __version__ as version

if typing.TYPE_CHECKING:
import sphinx.util.tags


extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.todo",
Expand Down Expand Up @@ -80,6 +84,14 @@ def typehints_formatter(annotation, config):
suppress_warnings = ["autoapi.python_import_resolution"]


# This allows us to insert a warning on the 'latest' build; see _warn_latest.rst
# and https://www.sphinx-doc.org/en/master/usage/configuration.html#conf-tags
# and https://docs.readthedocs.io/en/stable/reference/environment-variables.html
if _rtfd_version := os.environ.get("READTHEDOCS_VERSION"):
tags: "sphinx.util.tags.Tags" # this is just to help type-checking IDEs
tags.add(f"readthedocs_{_rtfd_version}") # noqa


################################
# CUSTOM
################################
Expand Down
6 changes: 3 additions & 3 deletions docs/source/getting-started.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.. include:: _warn_latest.rst
.. include:: _substitutions.rst


Getting Started
======================================


.. include:: substitutions.rst


Installation
------------

Expand Down
6 changes: 4 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.. include:: _warn_latest.rst
.. include:: _substitutions.rst

.. image:: _static/logo.svg
.. include:: substitutions.rst

pyAirtable
==========
Expand All @@ -14,7 +16,7 @@ pyAirtable
`GitHub <https://github.com/gtalarico/pyairtable>`_


Latest Release: |version|
Version: |version|


.. toctree::
Expand Down
4 changes: 3 additions & 1 deletion docs/source/metadata.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.. include:: substitutions.rst
.. include:: _warn_latest.rst
.. include:: _substitutions.rst


Metadata
==============
Expand Down
4 changes: 4 additions & 0 deletions docs/source/migrations.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. include:: _warn_latest.rst
.. include:: _substitutions.rst


Migration Guide
*****************

Expand Down
4 changes: 3 additions & 1 deletion docs/source/orm.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.. include:: substitutions.rst
.. include:: _warn_latest.rst
.. include:: _substitutions.rst


ORM
==============
Expand Down
6 changes: 4 additions & 2 deletions docs/source/tables.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.. include:: _warn_latest.rst
.. include:: _substitutions.rst


Working with Tables
==============================

.. include:: substitutions.rst


.. note::
Airtable imposes a `rate limit <https://airtable.com/developers/web/api/rate-limits>`__
Expand Down

0 comments on commit 9b30651

Please sign in to comment.