From 7065f15cb129cacb9c80b3d5b899f347e35d4b7f Mon Sep 17 00:00:00 2001 From: Vincent <97131062+vincbeck@users.noreply.github.com> Date: Mon, 17 Apr 2023 15:25:55 -0600 Subject: [PATCH] Update robots.txt to crawl only latest version of documentation (#761) --- CONTRIBUTE.md | 3 +- sphinx_airflow_theme/README.md | 46 +++++++++++++++++++ .../sphinx_airflow_theme/__init__.py | 2 +- .../sphinx_airflow_theme/layout.html | 3 ++ 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index 17d6f725f16..d31005b477b 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -424,8 +424,7 @@ To release a new documentation, follow these steps: 2. To build documentation, run following commands: ```bash cd "${AIRFLOW_REPO}" && git checkout "${AIRFLOW_VERSION}" - cd "${AIRFLOW_REPO}" && pip3 install -e '.[doc]' - cd "${AIRFLOW_REPO}/docs/" && bash build.sh + cd "${AIRFLOW_REPO}" && breeze build-docs' ``` 3. Copy generated files from `${AIRFLOW_REPO}/docs/_build/html` to `${AIRFLOW_SITE_REPO}/docs-archive//` diff --git a/sphinx_airflow_theme/README.md b/sphinx_airflow_theme/README.md index 6cfb948cd19..0c370709415 100644 --- a/sphinx_airflow_theme/README.md +++ b/sphinx_airflow_theme/README.md @@ -46,6 +46,52 @@ In order to start working with the theme, please follow the instructions below. ./docs.sh build && ./docs.sh preview ``` +# Generate Airflow documentation with Sphinx theme changes + +If you made some modifications to Sphinx theme and want to generate Airflow documentation to check the end results, +please follow these steps: + +1. In `airflow-site` repository, build Airflow website: + ```shell script + ./site.sh build-site + ``` + +2. Package the Sphinx theme in a `whl` file: + ```shell script + cd ./sphinx_airflow_theme + python3 setup.py sdist bdist_wheel + ``` + +3. (Optional) Double-check your modifications to the Sphinx theme are in the `whl` file: + ```shell script + pip install wheel + wheel unpack ./sphinx_airflow_theme-0.0.11-py3-none-any.whl + ``` + +4. Copy the `whl` file to `files` directory in `airflow` repository: + ```shell script + cp ./sphinx_airflow_theme-0.0.11-py3-none-any.whl ${AIRFLOW_REPO}/files/ + ``` + +5. In `airflow` repository, initiate a new breeze environment: + ```shell script + breeze + ``` + +6. In the breeze container, generate the documentation after installing the theme: + ```shell script + pip install /files/sphinx_airflow_theme-0.0.11-py3-none-any.whl --force-reinstall + # Generate Airflow documentation only. If you need to generate the whole documentation (all providers), + # you can do it using `/opt/airflow/scripts/in_container/run_docs_build.sh`. It takes longer to execute. + /opt/airflow/scripts/in_container/run_docs_build.sh --package-filter apache-airflow + ``` + +7. Verify the documentation generated is correct and includes your modifications. The documentation is generated in +`docs/_build/docs/`. If you generated Airflow documentation only, you can check the results in +`docs/_build/docs/apache-airflow/latest/`. + + + # Install developer version To install the latest development version of a theme, run: diff --git a/sphinx_airflow_theme/sphinx_airflow_theme/__init__.py b/sphinx_airflow_theme/sphinx_airflow_theme/__init__.py index 9815b5074ef..fcd4e040602 100644 --- a/sphinx_airflow_theme/sphinx_airflow_theme/__init__.py +++ b/sphinx_airflow_theme/sphinx_airflow_theme/__init__.py @@ -18,7 +18,7 @@ from os import path from sphinx.application import Sphinx -__version__ = '0.0.11' +__version__ = '0.0.12' __version_full__ = __version__ diff --git a/sphinx_airflow_theme/sphinx_airflow_theme/layout.html b/sphinx_airflow_theme/sphinx_airflow_theme/layout.html index 857c51130da..f9b454d326b 100644 --- a/sphinx_airflow_theme/sphinx_airflow_theme/layout.html +++ b/sphinx_airflow_theme/sphinx_airflow_theme/layout.html @@ -297,6 +297,9 @@ {%- endif %} {%- endblock %} + + +