From 06836487be35c2f0d5a1a8b0369ce17db64687ee Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 18 Jun 2025 21:49:42 +0200 Subject: [PATCH] Add linting check for RST code blocks. Fix code block languages. (cherry picked from commit c1df4bc8da24f9e020f2439a649e96ba6de1052a) --- antsibull-nox.toml | 9 +++++++++ docs/docsite/rst/scenario_guide.rst | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 3d7a6166..5332b04f 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -41,6 +41,15 @@ [sessions.docs_check] validate_collection_refs="all" +codeblocks_restrict_types = [ + "ansible-output", + "console", + "yaml", + "yaml+jinja", +] +codeblocks_restrict_type_exact_case = true +codeblocks_allow_without_type = false +codeblocks_allow_literal_blocks = false [sessions.license_check] diff --git a/docs/docsite/rst/scenario_guide.rst b/docs/docsite/rst/scenario_guide.rst index 395b7100..c9e500b9 100644 --- a/docs/docsite/rst/scenario_guide.rst +++ b/docs/docsite/rst/scenario_guide.rst @@ -24,13 +24,13 @@ Note that plugins (inventory plugins and connection plugins) are always executed You can install the Docker SDK for Python for Python 3.6 or later as follows: -.. code-block:: bash +.. code-block:: console $ pip install docker For Python 2.7, you need to use a version between 2.0.0 and 4.4.4 since the Python package for Docker removed support for Python 2.7 on 5.0.0. You can install the specific version of the Docker SDK for Python as follows: -.. code-block:: bash +.. code-block:: console $ pip install 'docker==4.4.4'