From c3f47a4f4b65f4fd2f1c304db506fb190bd7683c Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 21:55:16 +0200 Subject: [PATCH 01/10] Add disqus.js --- docs/_static/disqus.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docs/_static/disqus.js diff --git a/docs/_static/disqus.js b/docs/_static/disqus.js new file mode 100644 index 00000000..881ab6de --- /dev/null +++ b/docs/_static/disqus.js @@ -0,0 +1,10 @@ +var disqus_shortname; +var disqus_identifier; +(function() {{ + var disqus_thread = $("#disqus_thread"); + disqus_shortname = disqus_thread.data('disqus-shortname'); + disqus_identifier = disqus_thread.data('disqus-identifier'); + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); +}})(); From 4a575abbde8f8127217f364acc5016eeb185b613 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 21:55:57 +0200 Subject: [PATCH 02/10] Add shpinxcontrib-disqus to the list of development dependencies --- requirements-dev.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index 87d34508..7e82b16e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,6 +4,7 @@ unittest2 sphinx sphinx_rtd_theme sphinx_autobuild +sphinxcontrib-disqus autodoc coverage flake8 From f90deae8f7593e5120b49c4dec62606fd94a2479 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 21:56:55 +0200 Subject: [PATCH 03/10] Add disqus extension to the config --- docs/conf.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 018f77c3..f310c444 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,7 +29,8 @@ sys.path.insert(0, os.path.abspath('..')) # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.autodoc'] +extensions = ['sphinx.ext.autodoc', + 'sphinxcontrib.disqus'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -140,7 +141,7 @@ html_theme = 'default' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = [] +html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied @@ -298,3 +299,5 @@ texinfo_documents = [ #texinfo_no_detailmenu = False autodoc_member_order = 'bysource' + +disqus_shortname = 'python-dependency-injector' From 0077114cd4b3da9a425e2e5f0b0f872a1e4d090f Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 22:00:08 +0200 Subject: [PATCH 04/10] Add disqus comments for introduction documents --- docs/introduction/di_in_python.rst | 3 +++ docs/introduction/key_features.rst | 3 +++ docs/introduction/structure.rst | 3 +++ docs/introduction/what_is_di.rst | 3 +++ 4 files changed, 12 insertions(+) diff --git a/docs/introduction/di_in_python.rst b/docs/introduction/di_in_python.rst index 710d6f1e..81fa0dc1 100644 --- a/docs/introduction/di_in_python.rst +++ b/docs/introduction/di_in_python.rst @@ -129,3 +129,6 @@ using :doc:`Dependency Injector <../index>`: .. literalinclude:: ../../examples/miniapps/engines_cars/example_ioc_containers.py :language: python :linenos: + + +.. disqus:: diff --git a/docs/introduction/key_features.rst b/docs/introduction/key_features.rst index 0209c6ab..928da18b 100644 --- a/docs/introduction/key_features.rst +++ b/docs/introduction/key_features.rst @@ -43,3 +43,6 @@ Components of *Dependency Injector* framework could be used: Main idea of *Dependency Injector* framework is to be useful tool for the right thing. + + +.. disqus:: diff --git a/docs/introduction/structure.rst b/docs/introduction/structure.rst index c085138e..195b3d39 100644 --- a/docs/introduction/structure.rst +++ b/docs/introduction/structure.rst @@ -45,3 +45,6 @@ Containers could be: + Overridden by each other. + Copied from each other. + Extended. + + +.. disqus:: diff --git a/docs/introduction/what_is_di.rst b/docs/introduction/what_is_di.rst index 0f1cf595..fb9caa62 100644 --- a/docs/introduction/what_is_di.rst +++ b/docs/introduction/what_is_di.rst @@ -116,6 +116,9 @@ And `John Munsch`_ provided absolutely Great answer: down to eat. +.. disqus:: + + .. _Dependency injection: http://en.wikipedia.org/wiki/Dependency_injection .. _Inversion of control: https://en.wikipedia.org/wiki/Inversion_of_control .. _Dependency inversion: https://en.wikipedia.org/wiki/Dependency_inversion_principle From 4fdf2fb08f0d18203f304b90fa421c6f07eda57c Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 22:05:00 +0200 Subject: [PATCH 05/10] Add disqus comments for main documents --- docs/main/changelog.rst | 3 +++ docs/main/feedback.rst | 3 +++ docs/main/installation.rst | 3 +++ 3 files changed, 9 insertions(+) diff --git a/docs/main/changelog.rst b/docs/main/changelog.rst index 83d77953..df4bcd66 100644 --- a/docs/main/changelog.rst +++ b/docs/main/changelog.rst @@ -470,4 +470,7 @@ Previous versions - While *Objects* was in alpha state, changes were not tracked. +.. disqus:: + + .. _Semantic versioning: http://semver.org/ diff --git a/docs/main/feedback.rst b/docs/main/feedback.rst index c5a60c18..dc51dae2 100644 --- a/docs/main/feedback.rst +++ b/docs/main/feedback.rst @@ -7,3 +7,6 @@ Feel free to post questions, bugs, feature requests, proposals etc. on https://github.com/ets-labs/python-dependency-injector/issues Your feedback is quite important! + + +.. disqus:: diff --git a/docs/main/installation.rst b/docs/main/installation.rst index b3956207..0ef7403e 100644 --- a/docs/main/installation.rst +++ b/docs/main/installation.rst @@ -40,3 +40,6 @@ Verification of currently installed version could be done using .. _PyPi: https://pypi.python.org/pypi/dependency_injector .. _GitHub: https://github.com/ets-labs/python-dependency-injector .. _GitHub releases page: https://github.com/ets-labs/python-dependency-injector/releases + + +.. disqus:: From 1375e42749b51570551c2ae1fe3d2bb0b0575dd7 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 22:07:12 +0200 Subject: [PATCH 06/10] Add disqus comments for provider documents --- docs/providers/callable.rst | 3 +++ docs/providers/custom.rst | 3 +++ docs/providers/external_dependency.rst | 3 +++ docs/providers/factory.rst | 3 +++ docs/providers/object.rst | 3 +++ docs/providers/overriding.rst | 3 +++ docs/providers/singleton.rst | 3 +++ 7 files changed, 21 insertions(+) diff --git a/docs/providers/callable.rst b/docs/providers/callable.rst index 15857ca4..9497641f 100644 --- a/docs/providers/callable.rst +++ b/docs/providers/callable.rst @@ -56,3 +56,6 @@ Delegation of :py:class:`Callable` providers is the same as :ref:`factory_providers_delegation` section for examples (with exception about using :py:class:`DelegatedCallable` instead of :py:class:`DelegatedFactory`). + + +.. disqus:: diff --git a/docs/providers/custom.rst b/docs/providers/custom.rst index 7eb319a3..6cfdcbc3 100644 --- a/docs/providers/custom.rst +++ b/docs/providers/custom.rst @@ -33,3 +33,6 @@ Example: .. literalinclude:: ../../examples/providers/custom_factory.py :language: python :linenos: + + +.. disqus:: diff --git a/docs/providers/external_dependency.rst b/docs/providers/external_dependency.rst index 949622bb..94c845bb 100644 --- a/docs/providers/external_dependency.rst +++ b/docs/providers/external_dependency.rst @@ -40,3 +40,6 @@ Example: .. literalinclude:: ../../examples/providers/external_dependency.py :language: python :linenos: + + +.. disqus:: diff --git a/docs/providers/factory.rst b/docs/providers/factory.rst index 46c61ebf..e626f218 100644 --- a/docs/providers/factory.rst +++ b/docs/providers/factory.rst @@ -105,3 +105,6 @@ provided type: .. literalinclude:: ../../examples/providers/factory_provided_type.py :language: python :linenos: + + +.. disqus:: diff --git a/docs/providers/object.rst b/docs/providers/object.rst index f48a5ffc..00bae167 100644 --- a/docs/providers/object.rst +++ b/docs/providers/object.rst @@ -10,3 +10,6 @@ Example: .. literalinclude:: ../../examples/providers/object.py :language: python :linenos: + + +.. disqus:: diff --git a/docs/providers/overriding.rst b/docs/providers/overriding.rst index 9673050c..a21a9926 100644 --- a/docs/providers/overriding.rst +++ b/docs/providers/overriding.rst @@ -44,3 +44,6 @@ Example: .. literalinclude:: ../../examples/providers/overriding_users_model.py :language: python :linenos: + + +.. disqus:: diff --git a/docs/providers/singleton.rst b/docs/providers/singleton.rst index 81573319..0b3f00f4 100644 --- a/docs/providers/singleton.rst +++ b/docs/providers/singleton.rst @@ -98,3 +98,6 @@ Example: .. literalinclude:: ../../examples/providers/singleton_thread_locals.py :language: python :linenos: + + +.. disqus:: From 256abed2ef5315648556111649743a747fc24bb5 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 22:08:52 +0200 Subject: [PATCH 07/10] Add disqus comments for container documents --- docs/containers/declarative.rst | 3 +++ docs/containers/dynamic.rst | 3 +++ docs/containers/overriding.rst | 3 +++ docs/containers/specialization.rst | 3 +++ 4 files changed, 12 insertions(+) diff --git a/docs/containers/declarative.rst b/docs/containers/declarative.rst index 8d64c1ce..2f9f994c 100644 --- a/docs/containers/declarative.rst +++ b/docs/containers/declarative.rst @@ -53,3 +53,6 @@ Example of declarative containers's provider injections: .. literalinclude:: ../../examples/containers/declarative_injections.py :language: python :linenos: + + +.. disqus:: diff --git a/docs/containers/dynamic.rst b/docs/containers/dynamic.rst index ed296d4f..85224916 100644 --- a/docs/containers/dynamic.rst +++ b/docs/containers/dynamic.rst @@ -25,3 +25,6 @@ configuration: .. literalinclude:: ../../examples/containers/dynamic_runtime_creation.py :language: python :linenos: + + +.. disqus:: diff --git a/docs/containers/overriding.rst b/docs/containers/overriding.rst index 7937e46a..b2b501b1 100644 --- a/docs/containers/overriding.rst +++ b/docs/containers/overriding.rst @@ -38,3 +38,6 @@ properties that help to work with container overridings: :py:class:`DynamicContainer` has exactly the same functionality, except of :py:func:`override` decorator. + + +.. disqus:: diff --git a/docs/containers/specialization.rst b/docs/containers/specialization.rst index 3fb4dcd0..1c8c1bf0 100644 --- a/docs/containers/specialization.rst +++ b/docs/containers/specialization.rst @@ -22,3 +22,6 @@ as well: .. literalinclude:: ../../examples/containers/dynamic_provider_type.py :language: python :linenos: + + +.. disqus:: From f0b0a7c6da250987bb344320eaf54f84d24d7970 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 22:11:52 +0200 Subject: [PATCH 08/10] Add disqus comments for example documents --- docs/examples/movie_lister.rst | 4 ++++ docs/examples/services_miniapp.rst | 3 +++ 2 files changed, 7 insertions(+) diff --git a/docs/examples/movie_lister.rst b/docs/examples/movie_lister.rst index c982746d..331c6abf 100644 --- a/docs/examples/movie_lister.rst +++ b/docs/examples/movie_lister.rst @@ -123,4 +123,8 @@ Listing of ``app_db_csv.py``: :language: python :linenos: + +.. disqus:: + + .. _GitHub: https://github.com/ets-labs/python-dependency-injector/tree/master/examples/miniapps/movie_lister diff --git a/docs/examples/services_miniapp.rst b/docs/examples/services_miniapp.rst index 33ea11ac..b274e8bc 100644 --- a/docs/examples/services_miniapp.rst +++ b/docs/examples/services_miniapp.rst @@ -71,3 +71,6 @@ Listing of ``run.py``: .. literalinclude:: ../../examples/miniapps/services/run.py :language: python :linenos: + + +.. disqus:: From 372bbf3a9594d0014e9d3319f326b05d3ff8d1c2 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 22:12:07 +0200 Subject: [PATCH 09/10] Add disqus comments for api documents --- docs/api/containers.rst | 3 +++ docs/api/errors.rst | 3 +++ docs/api/providers.rst | 3 +++ docs/api/top_level.rst | 3 +++ 4 files changed, 12 insertions(+) diff --git a/docs/api/containers.rst b/docs/api/containers.rst index 79678008..9433d480 100644 --- a/docs/api/containers.rst +++ b/docs/api/containers.rst @@ -4,3 +4,6 @@ .. automodule:: dependency_injector.containers :members: :special-members: + + +.. disqus:: diff --git a/docs/api/errors.rst b/docs/api/errors.rst index c37ad8f7..8c3d3036 100644 --- a/docs/api/errors.rst +++ b/docs/api/errors.rst @@ -3,3 +3,6 @@ .. automodule:: dependency_injector.errors :members: + + +.. disqus:: diff --git a/docs/api/providers.rst b/docs/api/providers.rst index b5f3ecc1..ef30f154 100644 --- a/docs/api/providers.rst +++ b/docs/api/providers.rst @@ -5,3 +5,6 @@ :members: :inherited-members: :show-inheritance: + + +.. disqus:: diff --git a/docs/api/top_level.rst b/docs/api/top_level.rst index e679d4de..8b9d52da 100644 --- a/docs/api/top_level.rst +++ b/docs/api/top_level.rst @@ -3,3 +3,6 @@ .. automodule:: dependency_injector :members: VERSION + + +.. disqus:: From c5cddd91af230d3f118350bedb3d0459556864db Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Tue, 28 Feb 2017 22:16:49 +0200 Subject: [PATCH 10/10] Move docs requirements to separate file --- requirements-dev.txt | 5 ----- requirements-doc.txt | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 requirements-doc.txt diff --git a/requirements-dev.txt b/requirements-dev.txt index 7e82b16e..598f82de 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,11 +1,6 @@ cython tox unittest2 -sphinx -sphinx_rtd_theme -sphinx_autobuild -sphinxcontrib-disqus -autodoc coverage flake8 pydocstyle diff --git a/requirements-doc.txt b/requirements-doc.txt new file mode 100644 index 00000000..2a3b9cb6 --- /dev/null +++ b/requirements-doc.txt @@ -0,0 +1,5 @@ +sphinx +sphinx_rtd_theme +sphinx_autobuild +sphinxcontrib-disqus +autodoc