summaryrefslogtreecommitdiff
path: root/docs/dev/contribution_guide.rst
blob: 459dfb4485ee979b5fde2d1e0cd63522aaa7d36d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
.. _how to contribute:

=================
How to contribute
=================

Prime directives: Privacy, Hackability
======================================

Searx has two prime directives, **privacy-by-design and hackability** .  The
hackability comes in three levels:

- support of search engines
- plugins to alter search behaviour
- hacking searx itself

Note the lack of "world domination" among the directives.  Searx has no
intention of wide mass-adoption, rounded corners, etc.  The prime directive
"privacy" deserves a separate chapter, as it's quite uncommon unfortunately.

Privacy-by-design
-----------------

Searx was born out of the need for a **privacy-respecting** search tool which
can be extended easily to maximize both, its search and its privacy protecting
capabilities.

A few widely used features work differently or turned off by default or not
implemented at all **as a consequence of privacy-by-design**.

If a feature reduces the privacy preserving aspects of searx, it should be
switched off by default or should not implemented at all.  There are plenty of
search engines already providing such features.  If a feature reduces the
protection of searx, users must be informed about the effect of choosing to
enable it.  Features that protect privacy but differ from the expectations of
the user should also be explained.

Also, if you think that something works weird with searx, it's might be because
of the tool you use is designed in a way to interfere with the privacy respect.
Submitting a bugreport to the vendor of the tool that misbehaves might be a good
feedback to reconsider the disrespect to its customers (e.g. ``GET`` vs ``POST``
requests in various browsers).

Remember the other prime directive of searx is to be hackable, so if the above
privacy concerns do not fancy you, simply fork it.

  *Happy hacking.*

Code
====

.. _PEP8: https://www.python.org/dev/peps/pep-0008/
.. _Conventional Commits: https://www.conventionalcommits.org/
.. _Git Commit Good Practice: https://wiki.openstack.org/wiki/GitCommitMessages
.. _Structural split of changes:
    https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes
.. _gitmoji: https://gitmoji.carloscuesta.me/
.. _Semantic PR: https://github.com/zeke/semantic-pull-requests

.. sidebar:: Create good commits!

   - `Structural split of changes`_
   - `Conventional Commits`_
   - `Git Commit Good Practice`_
   - some like to use: gitmoji_
   - not yet active: `Semantic PR`_

In order to submit a patch, please follow the steps below:

- Follow coding conventions.

  - PEP8_ standards apply, except the convention of line length
  - Maximum line length is 120 characters

- The cardinal rule for creating good commits is to ensure there is only one
  *logical change* per commit / read `Structural split of changes`_

- Check if your code breaks existing tests.  If so, update the tests or fix your
  code.

- If your code can be unit-tested, add unit tests.

- Add yourself to the :origin:`AUTHORS.rst` file.

- Choose meaning full commit messages, read `Conventional Commits`_

  .. code::

     <type>[optional scope]: <description>

     [optional body]

     [optional footer(s)]

- Create a pull request.

For more help on getting started with searx development, see :ref:`devquickstart`.


Translation
===========

Translation currently takes place on :ref:`transifex <translation>`.

.. caution::

   Please, do not update translation files in the repo.


.. _contrib docs:

Documentation
=============

.. _Sphinx: http://www.sphinx-doc.org
.. _reST: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html

.. sidebar:: The reST sources

   has been moved from ``gh-branch`` into ``master`` (:origin:`docs`).

The documentation is built using Sphinx_.  So in order to be able to generate
the required files, you have to install it on your system.  Much easier, use
our :ref:`makefile`.

Here is an example which makes a complete rebuild:

.. code:: sh

   $ make docs-clean docs
   ...
   The HTML pages are in dist/docs.

.. _make docs-live:

live build
----------

.. sidebar:: docs-clean

   It is recommended to assert a complete rebuild before deploying (use
   ``docs-clean``).

Live build is like WYSIWYG.  If you want to edit the documentation, its
recommended to use.  The Makefile target ``docs-live`` builds the docs, opens
URL in your favorite browser and rebuilds every time a reST file has been
changed.

.. code:: sh

   $ make docs-live
   ...
   The HTML pages are in dist/docs.
   ... Serving on http://0.0.0.0:8080
   ... Start watching changes


.. _deploy on github.io:

deploy on github.io
-------------------

To deploy documentation at :docs:`github.io <.>` use Makefile target
:ref:`make gh-pages`, which will builds the documentation, clones searx into a sub
folder ``gh-pages``, cleans it, copies the doc build into and runs all the
needed git add, commit and push:

.. code:: sh

   $ make docs-clean gh-pages
   ...
   SPHINX    docs --> file://<...>/dist/docs
   The HTML pages are in dist/docs.
   ...
   Cloning into 'gh-pages' ...
   ...
   cd gh-pages; git checkout gh-pages >/dev/null
   Switched to a new branch 'gh-pages'
   ...
   doc available at --> https://asciimoo.github.io/searx