diff --git a/docs/api/index.rst b/docs/api/index.rst index c6b4cfa8..86389688 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -2,7 +2,7 @@ API Documentation ================= .. toctree:: - :maxdepth: 2 + :maxdepth: 2 top-level providers diff --git a/docs/conf.py b/docs/conf.py index 380da2da..4de57da7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -72,7 +72,7 @@ release = version # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/docs/introduction/key_features.rst b/docs/introduction/key_features.rst index 0870ac11..1975e8fc 100644 --- a/docs/introduction/key_features.rst +++ b/docs/introduction/key_features.rst @@ -31,7 +31,7 @@ Key features of the ``Dependency Injector``: The framework stands on the `PEP20 (The Zen of Python) `_ principle: -.. code-block:: plain +.. code-block:: text Explicit is better than implicit diff --git a/docs/tutorials/aiohttp.rst b/docs/tutorials/aiohttp.rst index 57b1c959..10b33b49 100644 --- a/docs/tutorials/aiohttp.rst +++ b/docs/tutorials/aiohttp.rst @@ -257,7 +257,7 @@ Let's check that it works. Open another terminal session and use ``httpie``: You should see: -.. code-block:: json +.. code-block:: http HTTP/1.1 200 OK Content-Length: 844 @@ -596,7 +596,7 @@ and make a request to the API in the terminal: You should see: -.. code-block:: json +.. code-block:: http HTTP/1.1 200 OK Content-Length: 492 diff --git a/docs/tutorials/cli.rst b/docs/tutorials/cli.rst index 88014ff3..ea3c8467 100644 --- a/docs/tutorials/cli.rst +++ b/docs/tutorials/cli.rst @@ -84,7 +84,7 @@ Create next structure in the project root directory. All files are empty. That's Initial project layout: -.. code-block:: bash +.. code-block:: text ./ ├── movies/ @@ -109,7 +109,7 @@ Now it's time to install the project requirements. We will use next packages: Put next lines into the ``requirements.txt`` file: -.. code-block:: bash +.. code-block:: text dependency-injector pyyaml @@ -134,7 +134,7 @@ We will create a script that creates database files. First add the folder ``data/`` in the root of the project and then add the file ``fixtures.py`` inside of it: -.. code-block:: bash +.. code-block:: text :emphasize-lines: 2-3 ./ @@ -205,13 +205,13 @@ Now run in the terminal: You should see: -.. code-block:: bash +.. code-block:: text OK Check that files ``movies.csv`` and ``movies.db`` have appeared in the ``data/`` folder: -.. code-block:: bash +.. code-block:: text :emphasize-lines: 4-5 ./ @@ -289,7 +289,7 @@ After each step we will add the provider to the container. Create the ``entities.py`` in the ``movies`` package: -.. code-block:: bash +.. code-block:: text :emphasize-lines: 10 ./ @@ -356,7 +356,7 @@ Let's move on to the finders. Create the ``finders.py`` in the ``movies`` package: -.. code-block:: bash +.. code-block:: text :emphasize-lines: 11 ./ @@ -465,7 +465,7 @@ The configuration file is ready. Move on to the lister. Create the ``listers.py`` in the ``movies`` package: -.. code-block:: bash +.. code-block:: text :emphasize-lines: 12 ./ @@ -613,7 +613,7 @@ Run in the terminal: You should see: -.. code-block:: plain +.. code-block:: text Francis Lawrence movies: - Movie(title='The Hunger Games: Mockingjay - Part 2', year=2015, director='Francis Lawrence') @@ -752,7 +752,7 @@ Run in the terminal: You should see: -.. code-block:: plain +.. code-block:: text Francis Lawrence movies: - Movie(title='The Hunger Games: Mockingjay - Part 2', year=2015, director='Francis Lawrence') @@ -868,7 +868,7 @@ Run in the terminal line by line: The output should be similar for each command: -.. code-block:: plain +.. code-block:: text Francis Lawrence movies: - Movie(title='The Hunger Games: Mockingjay - Part 2', year=2015, director='Francis Lawrence') @@ -888,7 +888,7 @@ We will use `pytest `_ and Create ``tests.py`` in the ``movies`` package: -.. code-block:: bash +.. code-block:: text :emphasize-lines: 13 ./ @@ -977,7 +977,7 @@ Run in the terminal: You should see: -.. code-block:: +.. code-block:: text platform darwin -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 plugins: cov-3.0.0 diff --git a/docs/tutorials/flask.rst b/docs/tutorials/flask.rst index 8c22aa5a..b8f81adf 100644 --- a/docs/tutorials/flask.rst +++ b/docs/tutorials/flask.rst @@ -280,7 +280,7 @@ Now let's fill in the layout. Put next into the ``base.html``: -.. code-block:: html +.. code-block:: jinja @@ -313,7 +313,7 @@ And put something to the index page. Put next into the ``index.html``: -.. code-block:: html +.. code-block:: jinja {% extends "base.html" %} diff --git a/docs/wiring.rst b/docs/wiring.rst index 456f1e89..912b320e 100644 --- a/docs/wiring.rst +++ b/docs/wiring.rst @@ -127,6 +127,7 @@ To inject the provider itself use ``Provide[foo.provider]``: def foo(bar_provider: Factory[Bar] = Provide[Container.bar.provider]): bar = bar_provider(argument="baz") ... + You can also use ``Provider[foo]`` for injecting the provider itself: .. code-block:: python