diff --git a/docs/conf.py b/docs/conf.py index 2a09edbf4..038637fc4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,6 +37,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + 'sphinx.ext.autodoc', ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/index.rst b/docs/index.rst index 5015f7351..65312d3c1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -83,7 +83,7 @@ Some recipes on how to perform certain tasks in **django-SHOP**. Django compatibility table ========================== -=========== === === ==== ==== === === === === === +=========== === === ==== ==== === === === === django-SHOP Django ----------- ---------------------------------------- \ 1.8 1.9 1.10 1.11 2.0 2.1 2.2 3.0 diff --git a/docs/reference/inventory.rst b/docs/reference/inventory.rst index 55e109472..cc3c7b24f 100644 --- a/docs/reference/inventory.rst +++ b/docs/reference/inventory.rst @@ -31,7 +31,7 @@ In addition to the field storing the quantity in stock, add the mixin class :class:`shop.models.product.AvailableProductMixin` to the product model declaration. Example: .. code-block:: python - :filename: models.py + :caption: models.py from django.db import models from shop.models.product import BaseProduct, BaseProductManager, AvailableProductMixin @@ -61,7 +61,7 @@ quantity, we add a relation for each delivered charge. This model then holds a t next incoming delivery is expected. Example: .. code-block:: python - :filename: models.py + :caption: models.py from django.db import models from shop.models.product import BaseProduct, BaseProductManager @@ -87,7 +87,7 @@ Since we have a relation from the inventory to our product model, we must use an while creating our admin backend. Example: .. code-block:: python - :filename: admin.py + :caption: admin.py from django.contrib import admin from myshop.models import MyProduct, Inventory @@ -137,7 +137,7 @@ Independently of the chosen approach, replace ``AvailableProductMixin`` with ``R in the product's model declaration. Example for the simple approach: .. code-block:: python - :filename: models.py + :caption: models.py from shop.models.product import BaseProduct, ReserveProductMixin @@ -148,7 +148,7 @@ Example using the related inventory model. Here we use the class ``ReserveProduc the inventory module: .. code-block:: python - :filename: models.py + :caption: models.py from shop.models.product import BaseProduct from shop.models.inventory import ReserveProductMixin diff --git a/docs/reference/search.rst b/docs/reference/search.rst index 21410c069..1a8833950 100644 --- a/docs/reference/search.rst +++ b/docs/reference/search.rst @@ -24,17 +24,17 @@ elasticsearch-dsl_ together with django-elasticsearch-dsl_. It now supports up t version of Elasticsearch, which currently is 7.6. In this document we assume that the merchant only wants to index his products, but not any arbitrary -content, such as for example the terms and condition, as found outside **django-SHOP**, but inside -**django-CMS**. The latter would however be perfectly feasible. +content, such as for example the "Terms and Conditions" page, as found outside **django-SHOP**, but +usually inside **django-CMS**. Indexing CMS pages using Elasticsearch would be perfectly feasible, +but is not the topic of this documentation. Configuration ------------- Download and install the latest version of the Elasticsearch binary. During development, all tests -have been performed with version 7.5. After unzipping the file, start Elasticsearch in daemon mode: - -:samp:` ./path/to/elasticsearch-{version}/bin/elasticsearch -d ` +have been performed with version 7.5. After unzipping the file, start Elasticsearch in daemon mode +by invoking :samp:`./path/to/elasticsearch-{version}/bin/elasticsearch -d`. Check if the server answers on HTTP requests. Pointing a browser on `http://localhost:9200/ `_ should return something similar to this: @@ -47,8 +47,8 @@ Check if the server answers on HTTP requests. Pointing a browser on "cluster_name" : "elasticsearch", "cluster_uuid" : "P9HVZRPbUXjTEDO9iZHGDk", "version" : { - ... - }, + … + } } Install ``elasticsearch-dsl`` and ``django-elasticsearch-dsl`` using diff --git a/docs/tutorial/commodity-product.rst b/docs/tutorial/commodity-product.rst index e7e657fa2..9e77e7757 100644 --- a/docs/tutorial/commodity-product.rst +++ b/docs/tutorial/commodity-product.rst @@ -66,7 +66,7 @@ must contain the templatetag {% load cms_tags %} … -'' {% render_placeholder product.placeholder %} + {% render_placeholder product.placeholder %} Here the placeholder is a special field :class:`cms.models.fields.PlaceholderField` in our Django model ``Commodity``. It is the equivalent to the placeholder otherwise used in regular diff --git a/docs/tutorial/polymorphic-product.rst b/docs/tutorial/polymorphic-product.rst index e3f72c3a9..cfc66e68c 100644 --- a/docs/tutorial/polymorphic-product.rst +++ b/docs/tutorial/polymorphic-product.rst @@ -8,6 +8,7 @@ The demo provided by cookiecutter-django-shop_ using the product model "polymorp setup a shop, with different product types. This is where polymorphism_ enters the scene. In our example we use a combination from the simpler demos "commodity" and "smartcard". +.. _cookiecutter-django-shop: https://github.com/awesto/cookiecutter-django-shop .. _polymorphism: https://en.wikipedia.org/wiki/Polymorphism_(computer_science) Since in this example, we have to specialize our product out of a common base, the properties for