@@ -8,118 +8,67 @@ Contributing to the Documentation
8
8
Setup Local Build
9
9
-----------------
10
10
11
- To get started, create or identify a working directory on your local machine.
11
+ To get started, check out and configure the repository for development::
12
12
13
- Open that directory and execute the following command in a terminal session::
13
+ git clone https://github.com/aboutcode-org/<your-repo>.git
14
14
15
- git clone https://github.com/aboutcode-org/skeleton.git
15
+ cd your-repo
16
+ ./configure --dev
16
17
17
- That will create an ``/skeleton `` directory in your working directory.
18
- Now you can install the dependencies in a virtualenv::
19
-
20
- cd skeleton
21
- ./configure --docs
18
+ (Or use "make dev")
22
19
23
20
.. note ::
24
21
25
- In case of windows, run ``configure --docs `` instead of this.
26
-
27
- Now, this will install the following prerequisites:
28
-
29
- - Sphinx
30
- - sphinx_rtd_theme (the format theme used by ReadTheDocs)
31
- - docs8 (style linter)
22
+ In case of windows, run ``configure --dev ``.
32
23
33
- These requirements are already present in setup.cfg and ` ./configure --docs ` installs them .
24
+ This will install and configure all requirements foer development including for docs development .
34
25
35
- Now you can build the HTML documents locally::
26
+ Now you can build the HTML documentation locally::
36
27
37
28
source venv/bin/activate
38
- cd docs
39
- make html
40
-
41
- Assuming that your Sphinx installation was successful, Sphinx should build a local instance of the
42
- documentation .html files::
43
-
44
- open build/html/index.html
45
-
46
- .. note ::
47
-
48
- In case this command did not work, for example on Ubuntu 18.04 you may get a message like “Couldn’t
49
- get a file descriptor referring to the console”, try:
50
-
51
- ::
52
-
53
- see build/html/index.html
29
+ make docs
54
30
55
- You now have a local build of the AboutCode documents.
31
+ This will build a local instance of the `` docs/_build `` directory::
56
32
57
- .. _ contrib_doc_share_improvements :
33
+ open docs/_build/index.html
58
34
59
- Share Document Improvements
60
- ---------------------------
61
-
62
- Ensure that you have the latest files::
63
-
64
- git pull
65
- git status
66
35
67
- Before commiting changes run Continious Integration Scripts locally to run tests. Refer
68
- :ref: `doc_ci ` for instructions on the same.
36
+ To validate the documentation style and content, use::
69
37
70
- Follow standard git procedures to upload your new and modified files. The following commands are
71
- examples::
72
-
73
- git status
74
- git add source/index.rst
75
- git add source/how-to-scan.rst
76
- git status
77
- git commit -m "New how-to document that explains how to scan"
78
- git status
79
- git push
80
- git status
81
-
82
- The Scancode-Toolkit webhook with ReadTheDocs should rebuild the documentation after your
83
- Pull Request is Merged.
38
+ source venv/bin/activate
39
+ make doc8
40
+ make docs-check
84
41
85
- Refer the `Pro Git Book <https://git-scm.com/book/en/v2/ >`_ available online for Git tutorials
86
- covering more complex topics on Branching, Merging, Rebasing etc.
87
42
88
43
.. _doc_ci :
89
44
90
45
Continuous Integration
91
46
----------------------
92
47
93
- The documentations are checked on every new commit through Travis-CI, so that common errors are
94
- avoided and documentation standards are enforced. Travis-CI presently checks for these 3 aspects
95
- of the documentation :
48
+ The documentations are checked on every new commit, so that common errors are avoided and
49
+ documentation standards are enforced. We checks for these aspects of the documentation:
96
50
97
51
1. Successful Builds (By using ``sphinx-build ``)
98
- 2. No Broken Links (By Using ``link-check ``)
99
- 3. Linting Errors (By Using ``Doc8 ``)
52
+ 2. No Broken Links (By Using ``linkcheck ``)
53
+ 3. Linting Errors (By Using ``doc8 ``)
100
54
101
- So run these scripts at your local system before creating a Pull Request ::
55
+ You myst run these scripts locally before creating a pull request ::
102
56
103
- cd docs
104
- ./scripts/sphinx_build_link_check.sh
105
- ./scripts/doc8_style_check.sh
57
+ make doc8
58
+ make check-docs
106
59
107
- If you don't have permission to run the scripts, run::
108
-
109
- chmod u+x ./scripts/doc8_style_check.sh
110
60
111
61
.. _doc_style_docs8 :
112
62
113
- Style Checks Using ``Doc8 ``
63
+ Style Checks Using ``doc8 ``
114
64
---------------------------
115
65
116
66
How To Run Style Tests
117
67
^^^^^^^^^^^^^^^^^^^^^^
118
68
119
69
In the project root, run the following commands::
120
70
121
- $ cd docs
122
- $ ./scripts/doc8_style_check.sh
71
+ make doc8
123
72
124
73
A sample output is::
125
74
@@ -143,11 +92,13 @@ A sample output is::
143
92
144
93
Now fix the errors and run again till there isn't any style error in the documentation.
145
94
95
+
146
96
What is Checked?
147
97
^^^^^^^^^^^^^^^^
148
98
149
99
PyCQA is an Organization for code quality tools (and plugins) for the Python programming language.
150
- Doc8 is a sub-project of the same Organization. Refer this `README <https://github.com/PyCQA/doc8/blob/main/README.rst >`_ for more details.
100
+ Doc8 is a sub-project of the same Organization. Refer this
101
+ `README <https://github.com/PyCQA/doc8/blob/main/README.rst >`_ for more details.
151
102
152
103
What is checked:
153
104
@@ -164,16 +115,19 @@ What is checked:
164
115
- no carriage returns (use UNIX newlines) - D004
165
116
- no newline at end of file - D005
166
117
118
+
167
119
.. _doc_interspinx :
168
120
169
121
Interspinx
170
122
----------
171
123
172
- ScanCode toolkit documentation uses `Intersphinx <https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html >`_
124
+ AboutCode documentation uses
125
+ `Intersphinx <https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html >`_
173
126
to link to other Sphinx Documentations, to maintain links to other Aboutcode Projects.
174
127
175
128
To link sections in the same documentation, standart reST labels are used. Refer
176
- `Cross-Referencing <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html >`_ for more information.
129
+ `Cross-Referencing <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html >`_
130
+ for more information.
177
131
178
132
For example::
179
133
@@ -223,6 +177,7 @@ Intersphinx, and you link to that label, it will create a link to the local labe
223
177
For more information, refer this tutorial named
224
178
`Using Intersphinx <https://my-favorite-documentation-test.readthedocs.io/en/latest/using_intersphinx.html >`_.
225
179
180
+
226
181
.. _doc_style_conv :
227
182
228
183
Style Conventions for the Documentaion
@@ -303,12 +258,14 @@ Style Conventions for the Documentaion
303
258
``rst_snippets/warning_snippets/ `` and then included to eliminate redundancy, as these are
304
259
frequently used in multiple files.
305
260
261
+
306
262
Converting from Markdown
307
263
------------------------
308
264
309
- If you want to convert a ``.md `` file to a ``.rst `` file, this `tool <https://github.com/chrissimpkins/md2rst >`_
310
- does it pretty well. You'd still have to clean up and check for errors as this contains a lot of
311
- bugs. But this is definitely better than converting everything by yourself.
265
+ If you want to convert a ``.md `` file to a ``.rst `` file, this
266
+ `tool <https://github.com/chrissimpkins/md2rst >`_ does it pretty well.
267
+ You will still have to clean up and check for errors as this contains a lot of bugs. But this is
268
+ definitely better than converting everything by yourself.
312
269
313
270
This will be helpful in converting GitHub wiki's (Markdown Files) to reStructuredtext files for
314
271
Sphinx/ReadTheDocs hosting.
0 commit comments