From 88c6b09542a80cf2b771f66730933816e2e7f7b9 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Mon, 2 Oct 2023 21:41:29 +0800 Subject: [PATCH] docs: fix rst code block format --- BREEZE.rst | 39 ++++++++++--------- .../howto/docker-compose/index.rst | 18 ++++----- docs/apache-airflow/security/webserver.rst | 6 +-- docs/docker-stack/entrypoint.rst | 6 +-- 4 files changed, 36 insertions(+), 33 deletions(-) diff --git a/BREEZE.rst b/BREEZE.rst index d1cc15a7c32f9..2206d350a7db4 100644 --- a/BREEZE.rst +++ b/BREEZE.rst @@ -2553,9 +2553,10 @@ to add it to one of the providers, you need to add it to the ``provider.yaml`` f directory - but remember that this should be followed by running pre-commit that will automatically update the ``generated/provider_dependencies.json`` directory with the new dependencies: -``` -pre-commit run update-providers-dependencies --all-files -``` +.. code-block:: bash + + pre-commit run update-providers-dependencies --all-files + You can also run the pre-commit by ``breeze static-checks --type update-providers-dependencies --all-files`` command - which provides autocomplete. @@ -2565,17 +2566,18 @@ After you've updated the dependencies, you need to rebuild the image: Breeze will automatically detect when you updated dependencies and it will propose you to build image next time when you enter it. You can answer ``y`` during 10 seconds to get it done for you. -``` -breeze ci-image build -``` +.. code-block:: bash + + breeze ci-image build + Sometimes, when you have conflicting change in dependencies (i.e. dependencies in the old constraints are conflicting with the new specification, you might want to build the image with ``--upgrade-to-newer-dependencies`` flag: -``` -breeze ci-image build --upgrade-to-newer-dependencies -``` +.. code-block:: bash + + breeze ci-image build --upgrade-to-newer-dependencies System (debian) dependencies @@ -2592,9 +2594,9 @@ other scripts (for example ``install_postgres.sh`` or ``install_mysql.sh``). After you modify the dependencies in the scripts, you need to inline them by running pre-commit: -``` -pre-commit run update-inlined-dockerfile-scripts --all-files -``` +.. code-block:: bash + + pre-commit run update-inlined-dockerfile-scripts --all-files You can also run the pre-commit by ``breeze static-checks --type update-inlined-dockerfile-scripts --all-files`` command - which provides autocomplete. @@ -2605,17 +2607,18 @@ After you've updated the dependencies, you need to rebuild the image: Breeze will automatically detect when you updated dependencies and it will propose you to build image next time when you enter it. You can answer ``y`` during 10 seconds to get it done for you. -``` -breeze ci-image build -``` +.. code-block:: bash + + breeze ci-image build Sometimes, when you have conflicting change in dependencies (i.e. dependencies in the old constraints are conflicting with the new specification, you might want to build the image with ``--upgrade-to-newer-dependencies`` flag: -``` -breeze ci-image build --upgrade-to-newer-dependencies -``` +.. code-block:: bash + + breeze ci-image build --upgrade-to-newer-dependencies + Node (yarn) dependencies ........................ diff --git a/docs/apache-airflow/howto/docker-compose/index.rst b/docs/apache-airflow/howto/docker-compose/index.rst index 009302d5793c4..d493d4ba027cb 100644 --- a/docs/apache-airflow/howto/docker-compose/index.rst +++ b/docs/apache-airflow/howto/docker-compose/index.rst @@ -310,18 +310,18 @@ you should do those steps: ``docker-compose.yaml`` file. The relevant part of the docker-compose file of yours should look similar to (use correct image tag): -``` -#image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.6.1} -build: . -``` +.. code-block:: docker + + #image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.6.1} + build: . 2) Create ``Dockerfile`` in the same folder your ``docker-compose.yaml`` file is with content similar to: -``` -FROM apache/airflow:2.6.1 -ADD requirements.txt . -RUN pip install apache-airflow==${AIRFLOW_VERSION} -r requirements.txt -``` +.. code-block:: docker + + FROM apache/airflow:2.6.1 + ADD requirements.txt . + RUN pip install apache-airflow==${AIRFLOW_VERSION} -r requirements.txt It is the best practice to install apache-airflow in the same version as the one that comes from the original image. This way you can be sure that ``pip`` will not try to downgrade or upgrade apache diff --git a/docs/apache-airflow/security/webserver.rst b/docs/apache-airflow/security/webserver.rst index 282eabaa5b4d6..c7bf4eadd574e 100644 --- a/docs/apache-airflow/security/webserver.rst +++ b/docs/apache-airflow/security/webserver.rst @@ -313,9 +313,9 @@ setting the ``RATELIMIT_*`` configuration settings in ``webserver_config.py``. For example, to use Redis as a rate limit storage you can use the following configuration (you need to set ``redis_host`` to your Redis instance) -``` -RATELIMIT_STORAGE_URI = 'redis://redis_host:6379/0 -``` +.. code-block:: python + + RATELIMIT_STORAGE_URI = "redis://redis_host:6379/0" You can also configure other rate limit settings in ``webserver_config.py`` - for more details, see the `Flask Limiter rate limit configuration `_. diff --git a/docs/docker-stack/entrypoint.rst b/docs/docker-stack/entrypoint.rst index 77648a6ba1e9b..59f9b730f4c9b 100644 --- a/docs/docker-stack/entrypoint.rst +++ b/docs/docker-stack/entrypoint.rst @@ -43,9 +43,9 @@ This can be achieved in various ways - you can change USER when you extend or cu you can dynamically pass the user to ``docker run`` command, by adding ``--user`` flag in one of those formats (See `Docker Run reference `_ for details): -``` -[ user | user:group | uid | uid:gid | user:gid | uid:group ] -``` +.. code-block:: text + + [ user | user:group | uid | uid:gid | user:gid | uid:group ] In case of Docker Compose environment it can be changed via ``user:`` entry in the ``docker-compose.yaml``. See `Docker compose reference `_