diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20daeb42cd..47d6f0b563 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,11 +57,12 @@ documentation: paths: - .cache/pip/http before_script: - - pip install sphinx-lint + - pip install sphinx-lint rstcheck[sphinx] script: - cd "${PACKAGE}" - python -m sphinx -T -E -W -n -b html ${DOC_DIR} _build/html - python -m sphinxlint ${DOC_DIR} + - rstcheck --recursive ${DOC_DIR} - | if [ "${CHECK_LINK}" ]; then python -m sphinx -T -E -W -n -b linkcheck ${DOC_DIR} _build; diff --git a/.rstcheck.cfg b/.rstcheck.cfg new file mode 100644 index 0000000000..92c37dd4d6 --- /dev/null +++ b/.rstcheck.cfg @@ -0,0 +1,3 @@ +[rstcheck] +ignore_directives = include +ignore_messages = (Hyperlink target .* is not referenced)|(Duplicate implicit target name:.*) diff --git a/modules/country/doc/setup.rst b/modules/country/doc/setup.rst index beb59aa228..7bfffc3ab3 100644 --- a/modules/country/doc/setup.rst +++ b/modules/country/doc/setup.rst @@ -33,8 +33,8 @@ the `Postal Codes ` in Tryton from the `GeoNames Database`_. It is run with: -.. code-block:: bash +.. code-block:: console - trytond_import_postal_codes -c trytond.conf -d + $ trytond_import_postal_codes -c trytond.conf -d .. _GeoNames Database: https://www.geonames.org/ diff --git a/modules/currency/doc/setup.rst b/modules/currency/doc/setup.rst index 6e56b223fb..3853259939 100644 --- a/modules/currency/doc/setup.rst +++ b/modules/currency/doc/setup.rst @@ -15,6 +15,6 @@ updates `Currencies `. You can run it with: -.. code-block:: bash +.. code-block:: console - trytond_import_currencies -c trytond.conf -d + $ trytond_import_currencies -c trytond.conf -d diff --git a/modules/product/doc/design.rst b/modules/product/doc/design.rst index c31888385c..7a1a38c28b 100644 --- a/modules/product/doc/design.rst +++ b/modules/product/doc/design.rst @@ -24,9 +24,8 @@ product variant is based exclusively on one product template. A product's full code is made up from a prefix code which is defined on the product template and a suffix code which is specified on the product variant. -The full product code can then be used as the product's |SKU|_. +The full product code can then be used as the product's SKU_. -.. |SKU| replace:: :abbr:`SKU (Stock Keeping Unit)` .. _SKU: https://en.wikipedia.org/wiki/Stock_keeping_unit .. _model-product.template: diff --git a/modules/stock/doc/setup.rst b/modules/stock/doc/setup.rst index d6f794a50e..d1c195fd6a 100644 --- a/modules/stock/doc/setup.rst +++ b/modules/stock/doc/setup.rst @@ -45,16 +45,13 @@ you must enter this initial stock in the correct way. The right way of doing this is to create a set of individual `Stock Moves `. These moves can be created in the view that is opened from the -|Inventory & Stock --> Moves|__ main menu item. +:menuselection:`Inventory & Stock --> Moves` main menu item. Each of the stock moves should move some stock of a `Product ` from a supplier `Location ` to the appropriate storage location. These stock moves must have their unit prices set to their product's cost price. -.. |Inventory & Stock --> Moves| replace:: :menuselection:`Inventory & Stock --> Moves` -__ https://demo.tryton.org/model/stock.move - .. note:: As these moves are for your initial stock they have no origin, and diff --git a/trytond/doc/topics/models/fields_default_value.rst b/trytond/doc/topics/models/fields_default_value.rst index 7b39dad66a..5b8ce16b7d 100644 --- a/trytond/doc/topics/models/fields_default_value.rst +++ b/trytond/doc/topics/models/fields_default_value.rst @@ -9,6 +9,7 @@ is set with the default value if exists. The following class method: +.. rstcheck: ignore-next-code-block .. code-block:: python Model.default_() diff --git a/trytond/doc/topics/reports/index.rst b/trytond/doc/topics/reports/index.rst index 42b4756666..57560c34cf 100644 --- a/trytond/doc/topics/reports/index.rst +++ b/trytond/doc/topics/reports/index.rst @@ -122,7 +122,7 @@ Additional objects can be passed to a report. This is discussed below in `Passing custom values to a report`_ Within Tryton the model, the report is based on, can be found by opening the -menu item: +menu item:: |Administration --> Models --> Models|__ @@ -130,7 +130,7 @@ menu item: __ https://demo.tryton.org/model/ir.model Furthermore in Tryton the fields for that model can be found by opening the -menu item: +menu item:: |Administration --> Models --> Models --> Fields|__ @@ -142,7 +142,7 @@ Creating a simple report template for a model from the client ------------------------------------------------------------- Once you have created a report template it has to be uploaded to the server. -This can be done by creating a new record by opening the menu item: +This can be done by creating a new record by opening the menu item:: |Administration --> User Interface --> Actions --> Reports|__ @@ -214,18 +214,20 @@ Then you must create your new sale report: .. code-block:: xml - - Sale - sale.sale - sale.sale - my_module/sale.odt - odt - - - form_print - sale.sale,-1 - - + + + Sale + sale.sale + sale.sale + my_module/sale.odt + odt + + + form_print + sale.sale,-1 + + + Passing custom values to a report --------------------------------- diff --git a/trytond/doc/tutorial/module/report.rst b/trytond/doc/tutorial/module/report.rst index ef4e94c146..f468d5b874 100644 --- a/trytond/doc/tutorial/module/report.rst +++ b/trytond/doc/tutorial/module/report.rst @@ -78,7 +78,7 @@ selected record instances. Here is an example of the directives to insert in the document: -.. code-block:: +.. code-block:: text Opportunity: diff --git a/trytond/doc/tutorial/module/table_query.rst b/trytond/doc/tutorial/module/table_query.rst index 213bc3c18c..e02a1b82ff 100644 --- a/trytond/doc/tutorial/module/table_query.rst +++ b/trytond/doc/tutorial/module/table_query.rst @@ -74,7 +74,7 @@ the :class:`~trytond.pool.Pool` as type ``model`` in :file:`__init__.py`: def register(): ... Pool.register( - ... + ..., opportunity.OpportunityMonthly, module='opportunity', type_='model') diff --git a/trytond/doc/tutorial/module/wizard.rst b/trytond/doc/tutorial/module/wizard.rst index 1909c7eeee..935b49fdfd 100644 --- a/trytond/doc/tutorial/module/wizard.rst +++ b/trytond/doc/tutorial/module/wizard.rst @@ -71,14 +71,14 @@ Now we can define the :class:`~trytond.wizard.Wizard` with a ``start`` ... class Opportunity(...): ... - @classmethod - @Workflow.transition('converted') - def convert(cls, opportunities, end_date=None): - pool = Pool() - Date = pool.get('ir.date') - cls.write(opportunities, { - 'end_date': end_date or Date.today(), - }) + @classmethod + @Workflow.transition('converted') + def convert(cls, opportunities, end_date=None): + pool = Pool() + Date = pool.get('ir.date') + cls.write(opportunities, { + 'end_date': end_date or Date.today(), + }) ... class Convert(Wizard): "Convert Opportunities"