Update provider doc page headers

This commit is contained in:
Roman Mogylatov 2020-09-02 17:33:02 -04:00
parent 3eb7b9bc69
commit e4ca126188
10 changed files with 23 additions and 23 deletions

View File

@ -1,5 +1,5 @@
Callable provider Callable provider
----------------- =================
.. meta:: .. meta::
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Function,Method,Example :keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Function,Method,Example

View File

@ -1,5 +1,5 @@
Configuration provider Configuration provider
---------------------- ======================
.. meta:: .. meta::
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Configuration,Injection, :keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Configuration,Injection,
@ -20,7 +20,7 @@ Configuration provider
It implements the principle "use first, define later". It implements the principle "use first, define later".
Loading from an INI file Loading from an INI file
~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------
``Configuration`` provider can load configuration from an ``ini`` file using the ``Configuration`` provider can load configuration from an ``ini`` file using the
:py:meth:`Configuration.from_ini` method: :py:meth:`Configuration.from_ini` method:
@ -40,7 +40,7 @@ where ``examples/providers/configuration/config.ini`` is:
variable ``ENV_NAME``. variable ``ENV_NAME``.
Loading from a YAML file Loading from a YAML file
~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------
``Configuration`` provider can load configuration from a ``yaml`` file using the ``Configuration`` provider can load configuration from a ``yaml`` file using the
:py:meth:`Configuration.from_yaml` method: :py:meth:`Configuration.from_yaml` method:
@ -74,7 +74,7 @@ variable ``ENV_NAME``.
*Don't forget to mirror the changes in the requirements file.* *Don't forget to mirror the changes in the requirements file.*
Loading from a dictionary Loading from a dictionary
~~~~~~~~~~~~~~~~~~~~~~~~~ -------------------------
``Configuration`` provider can load configuration from a Python ``dict`` using the ``Configuration`` provider can load configuration from a Python ``dict`` using the
:py:meth:`Configuration.from_dict` method: :py:meth:`Configuration.from_dict` method:
@ -85,7 +85,7 @@ Loading from a dictionary
:emphasize-lines: 6-13 :emphasize-lines: 6-13
Loading from an environment variable Loading from an environment variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------------
``Configuration`` provider can load configuration from an environment variable using the ``Configuration`` provider can load configuration from an environment variable using the
:py:meth:`Configuration.from_env` method: :py:meth:`Configuration.from_env` method:
@ -96,7 +96,7 @@ Loading from an environment variable
:emphasize-lines: 6-8 :emphasize-lines: 6-8
Loading from the multiple sources Loading from the multiple sources
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------------
``Configuration`` provider can load configuration from the multiple sources. Loaded ``Configuration`` provider can load configuration from the multiple sources. Loaded
configuration is merged recursively over the existing configuration. configuration is merged recursively over the existing configuration.
@ -112,7 +112,7 @@ where ``examples/providers/configuration/config.local.yml`` is:
:language: ini :language: ini
Specifying the value type Specifying the value type
~~~~~~~~~~~~~~~~~~~~~~~~~ -------------------------
You can specify the type of the injected configuration value explicitly. You can specify the type of the injected configuration value explicitly.

View File

@ -1,5 +1,5 @@
Coroutine provider Coroutine provider
------------------ ==================
.. meta:: .. meta::
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Coroutine,Asynchronous, :keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Coroutine,Asynchronous,

View File

@ -1,5 +1,5 @@
Dependency provider Dependency provider
------------------- ===================
.. currentmodule:: dependency_injector.providers .. currentmodule:: dependency_injector.providers

View File

@ -41,7 +41,7 @@ injected following these rules:
:lines: 3- :lines: 3-
Passing arguments to the underlying providers Passing arguments to the underlying providers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------------------------
``Factory`` provider can pass the arguments to the underlying providers. This helps when you need ``Factory`` provider can pass the arguments to the underlying providers. This helps when you need
to assemble a nested objects graph and pass the arguments deep inside. to assemble a nested objects graph and pass the arguments deep inside.
@ -88,7 +88,7 @@ If ``<dependency>`` is found the underlying provider will receive the
.. _factory_providers_delegation: .. _factory_providers_delegation:
Passing providers to the objects Passing providers to the objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --------------------------------
When you need to inject the provider itself, but not the result of its call, use the ``.provider`` When you need to inject the provider itself, but not the result of its call, use the ``.provider``
attribute of the provider that you're going to inject. attribute of the provider that you're going to inject.
@ -105,7 +105,7 @@ attribute of the provider that you're going to inject.
.. _factory-specialize-provided-type: .. _factory-specialize-provided-type:
Specializing the provided type Specializing the provided type
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------
You can create a specialized ``Factory`` provider that provides only specific type. For doing You can create a specialized ``Factory`` provider that provides only specific type. For doing
this you need to create a subclass of the ``Factory`` provider and define the ``provided_type`` this you need to create a subclass of the ``Factory`` provider and define the ``provided_type``
@ -119,7 +119,7 @@ class attribute.
.. _abstract-factory: .. _abstract-factory:
Abstract factory Abstract factory
~~~~~~~~~~~~~~~~ ----------------
:py:class:`AbstractFactory` provider helps when you need to create a provider of some base class :py:class:`AbstractFactory` provider helps when you need to create a provider of some base class
and the particular implementation is not yet know. ``AbstractFactory`` provider is a ``Factory`` and the particular implementation is not yet know. ``AbstractFactory`` provider is a ``Factory``
@ -138,7 +138,7 @@ provider with two peculiarities:
:emphasize-lines: 32 :emphasize-lines: 32
Factory aggregate Factory aggregate
~~~~~~~~~~~~~~~~~ -----------------
:py:class:`FactoryAggregate` provider aggregates multiple factories. When you call the :py:class:`FactoryAggregate` provider aggregates multiple factories. When you call the
``FactoryAggregate`` it delegates the call to one of the factories. ``FactoryAggregate`` it delegates the call to one of the factories.

View File

@ -1,5 +1,5 @@
List provider List provider
------------- =============
.. meta:: .. meta::
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,List,Injection :keywords: Python,DI,Dependency injection,IoC,Inversion of Control,List,Injection

View File

@ -1,5 +1,5 @@
Object provider Object provider
--------------- ===============
.. meta:: .. meta::
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Object :keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Object

View File

@ -1,5 +1,5 @@
Injecting attributes, items, or call methods of the provided instance Injecting attributes, items, or call methods of the provided instance
--------------------------------------------------------------------- =====================================================================
.. currentmodule:: dependency_injector.providers .. currentmodule:: dependency_injector.providers

View File

@ -1,7 +1,7 @@
.. _selector-provider: .. _selector-provider:
Selector provider Selector provider
----------------- =================
.. meta:: .. meta::
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Configuration,Injection, :keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Configuration,Injection,

View File

@ -1,5 +1,5 @@
Singleton provider Singleton provider
------------------ ==================
.. meta:: .. meta::
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Singleton,Pattern,Example, :keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Singleton,Pattern,Example,
@ -33,7 +33,7 @@ factories:
- :ref:`abstract-factory` - :ref:`abstract-factory`
Resetting memorized object Resetting memorized object
~~~~~~~~~~~~~~~~~~~~~~~~~~ --------------------------
To reset a memorized object you need to call the ``.reset()`` method of the ``Singleton`` To reset a memorized object you need to call the ``.reset()`` method of the ``Singleton``
provider. provider.
@ -48,7 +48,7 @@ provider.
managed by the garbage collector. managed by the garbage collector.
Using singleton with multiple threads Using singleton with multiple threads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -------------------------------------
``Singleton`` provider is NOT thread-safe. You need to explicitly establish a synchronization for ``Singleton`` provider is NOT thread-safe. You need to explicitly establish a synchronization for
using the ``Singleton`` provider in the multi-threading application. Otherwise you could trap using the ``Singleton`` provider in the multi-threading application. Otherwise you could trap
@ -67,7 +67,7 @@ There are two thread-safe singleton implementations out of the box:
:emphasize-lines: 11,12 :emphasize-lines: 11,12
Implementing scopes Implementing scopes
~~~~~~~~~~~~~~~~~~~ -------------------
To implement a scoped singleton provider use a ``Singleton`` provider and reset its scope when To implement a scoped singleton provider use a ``Singleton`` provider and reset its scope when
needed. needed.