Skip to content

Commit 1f91670

Browse files
committed
TLDR-916 added contributing and support info into docs
1 parent 582c209 commit 1f91670

File tree

5 files changed

+130
-1
lines changed

5 files changed

+130
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. _check_documentation:
2+
3+
Check documentation
4+
-------------------
5+
6+
1. To build automatic documentation, it is recommended to install the following dependencies:
7+
8+
.. code-block:: bash
9+
10+
pip install .[docs]
11+
12+
2. Documentation files should be located in the `docs/ <https://github.com/ispras/dedoc/blob/master/docs>`_ directory,
13+
which must contain the `docs/source/conf.py <https://github.com/ispras/dedoc/blob/master/docs/source/conf.py>`_ (build settings)
14+
and `docs/source/index.rst <https://github.com/ispras/dedoc/blob/master/docs/source/index.rst>`_ (documentation main page) files.
15+
16+
3. Build documentation into HTML pages is done as follows:
17+
18+
.. code-block:: bash
19+
20+
python -m sphinx -T -E -W -b html -d docs/_build/doctrees -D language=en docs/source docs/_build
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
.. _contributing:
2+
3+
Support and Contributing
4+
========================
5+
6+
Support
7+
-------
8+
If you are stuck with a problem using Dedoc, please do get in touch at our `Issues <https://github.com/ispras/dedoc/issues>`_ (recommend)
9+
or `Dedoc Chat <https://t.me/dedoc_chat>`_. The developers are willing to help.
10+
11+
You can save time by following this procedure when reporting a problem:
12+
13+
* Do try to solve the problem on your own first. Read the documentation, including using the search feature, index and reference documentation.
14+
15+
* Search the issue archives to see if someone else already had the same problem.
16+
17+
* Before writing, try to create a minimal example that reproduces the problem (with the api parameters and files you used).
18+
You’ll get the fastest response if you can send just a handful of lines of code that show what isn’t working.
19+
20+
21+
Contributing Rules
22+
------------------
23+
24+
* To add new features to the project repository yourself, you should follow
25+
the `general contributing rules of github <https://github.com/firstcontributions/first-contributions>`_.
26+
In your Pull Request, set `develop` as the target branch.
27+
28+
* We recommend using `Pycharm IDE` and `virtualenv` package for development.
29+
30+
* It is strongly recommended to use in development those versions of libraries that are already used in the project.
31+
Thus, it is necessary to avoid using an excessive number of libraries with the same functionality in the project.
32+
This leads to the growth of the dedoc library image.
33+
34+
* We strongly recommend using the already used ML library `torch` in development. For example,
35+
using `tensorflow` library instead of `torch` is justified only in case of extreme necessity.
36+
37+
* If you add new functionality to dedoc, be sure to add python `unitests` to test the added functionality
38+
(you can add api tests in `tests/api_tests <https://github.com/ispras/dedoc/blob/master/tests/api_tests>`_,
39+
you can add unit tests in `tests/unit_tests <https://github.com/ispras/dedoc/blob/master/tests/unit_tests>`_).
40+
These tests are run automatically in the Continuous Integration pipeline.
41+
42+
* Before each commit, check the code style using the automatic checker using the `flake8` library.
43+
Instructions for using flake8 are provided here :ref:using_flake8`.
44+
45+
* We recommend setting up pre-commit for convenience and speeding up development according to the instructions :ref:`using_precommit` .
46+
This will run a style check of the changed code with each commit.
47+
48+
* In case of any change in the online documentation of the project (for example, when adding a new api parameter),
49+
be sure to check locally that the changed documentation is successfully built and looks as expected.
50+
Building online documentation using `sphinx` is described here :ref:`check_documentation`.
51+
52+
.. toctree::
53+
:maxdepth: 1
54+
55+
using_flake8
56+
using_precommit
57+
check_documentation
58+
59+
60+
61+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.. _using_flake8:
2+
3+
Using Flake8 (Linting)
4+
----------------------
5+
6+
To check Python code for compliance with all style standards, you can use the automatic checking tool `flake8`.
7+
Flake8 checks code according to configuration file `.flake8 <https://github.com/ispras/dedoc/blob/master/.flake8>`_.
8+
9+
1. Install all requirements for `flake8` package:
10+
11+
.. code-block:: bash
12+
13+
pip3 install .[lint]
14+
15+
2. Run `flake8` package:
16+
17+
.. code-block:: bash
18+
19+
flake8 .
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. _using_precommit:
2+
3+
Using Pre-commit
4+
----------------
5+
6+
In addition to running the style check yourself, it is possible to configure a `precommit-hook <https://pre-commit.com>`_,
7+
which will run the style check before committing (`git commit`). The `pre-commit` is configured in
8+
the `.pre-commit-config.yaml <https://github.com/ispras/dedoc/blob/master/.pre-commit-config.yaml>`_ configuration file.
9+
10+
1. You will need to install the dependency `pre-commit` and set up the hook:
11+
12+
.. code-block:: bash
13+
14+
pip3 install pre-commit
15+
pre-commit install
16+
17+
2. Check the hook (or do `git commit`):
18+
19+
.. code-block:: bash
20+
21+
pre-commit run --all
22+
23+
.. seealso::
24+
If you want to commit without checking the tests, you need to add the option `--no-verify`
25+
26+
.. code-block:: bash
27+
28+
git commit -m "your message" --no-verify

docs/source/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ This type of structure is configurable (see :ref:`using_patterns`).
282282

283283
.. toctree::
284284
:maxdepth: 2
285-
:caption: Notes
285+
:caption: Development Notes
286286
:hidden:
287287

288+
contributing/contributing
288289
changelog

0 commit comments

Comments
 (0)