searx/dev/contribution_guide.html

284 lines
15 KiB
HTML
Raw Normal View History

2019-12-30 18:31:17 +01:00
<!DOCTYPE html>
2015-11-17 23:38:25 +01:00
2020-06-19 11:15:15 +02:00
<html>
2015-11-17 23:38:25 +01:00
<head>
2019-12-30 18:31:17 +01:00
<meta charset="utf-8" />
2020-09-30 10:35:05 +02:00
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2019-12-30 18:31:17 +01:00
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How to contribute &#8212; Searx Documentation (Searx-0.18.0.tex)</title>
2015-11-17 23:38:25 +01:00
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/searx.css" type="text/css" />
2020-09-30 10:35:05 +02:00
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/segment.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/menu.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/tabs.css" />
2020-02-15 10:08:58 +01:00
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
2016-11-04 21:56:14 +01:00
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
2016-07-09 22:32:57 +02:00
<link rel="next" title="Engine overview" href="engine_overview.html" />
2016-04-21 13:15:04 +02:00
<link rel="prev" title="Development Quickstart" href="quickstart.html" />
2019-12-30 18:31:17 +01:00
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '../';</script>
2015-11-17 23:38:25 +01:00
2019-12-30 18:31:17 +01:00
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
2019-12-30 18:31:17 +01:00
<li class="right" >
<a href="engine_overview.html" title="Engine overview"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="quickstart.html" title="Development Quickstart"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-0.18.0.tex)</a> &#187;</li>
2020-09-30 10:35:05 +02:00
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">How to contribute</a></li>
2019-12-30 18:31:17 +01:00
</ul>
</div>
2015-11-17 23:38:25 +01:00
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="how-to-contribute">
2019-12-30 18:31:17 +01:00
<span id="id1"></span><h1>How to contribute<a class="headerlink" href="#how-to-contribute" title="Permalink to this headline"></a></h1>
2020-06-19 11:15:15 +02:00
<div class="contents local topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#prime-directives-privacy-hackability" id="id3">Prime directives: Privacy, Hackability</a></p>
<ul>
<li><p><a class="reference internal" href="#privacy-by-design" id="id4">Privacy-by-design</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#code" id="id5">Code</a></p></li>
<li><p><a class="reference internal" href="#translation" id="id6">Translation</a></p></li>
<li><p><a class="reference internal" href="#documentation" id="id7">Documentation</a></p>
<ul>
<li><p><a class="reference internal" href="#live-build" id="id8">live build</a></p></li>
<li><p><a class="reference internal" href="#deploy-on-github-io" id="id9">deploy on github.io</a></p></li>
</ul>
</li>
</ul>
</div>
2015-11-17 23:38:25 +01:00
<div class="section" id="prime-directives-privacy-hackability">
2020-06-19 11:15:15 +02:00
<h2><a class="toc-backref" href="#id3">Prime directives: Privacy, Hackability</a><a class="headerlink" href="#prime-directives-privacy-hackability" title="Permalink to this headline"></a></h2>
2019-12-30 18:31:17 +01:00
<p>Searx has two prime directives, <strong>privacy-by-design and hackability</strong> . The
2015-12-10 21:40:22 +01:00
hackability comes in three levels:</p>
2015-11-17 23:38:25 +01:00
<ul class="simple">
2019-12-30 18:31:17 +01:00
<li><p>support of search engines</p></li>
<li><p>plugins to alter search behaviour</p></li>
<li><p>hacking searx itself</p></li>
2015-11-17 23:38:25 +01:00
</ul>
2019-12-30 18:31:17 +01:00
<p>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 its quite uncommon unfortunately.</p>
2015-11-17 23:38:25 +01:00
<div class="section" id="privacy-by-design">
2020-06-19 11:15:15 +02:00
<h3><a class="toc-backref" href="#id4">Privacy-by-design</a><a class="headerlink" href="#privacy-by-design" title="Permalink to this headline"></a></h3>
2019-12-30 18:31:17 +01:00
<p>Searx was born out of the need for a <strong>privacy-respecting</strong> search tool which
can be extended easily to maximize both, its search and its privacy protecting
capabilities.</p>
<p>A few widely used features work differently or turned off by default or not
implemented at all <strong>as a consequence of privacy-by-design</strong>.</p>
<p>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.</p>
<p>Also, if you think that something works weird with searx, its 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. <code class="docutils literal notranslate"><span class="pre">GET</span></code> vs <code class="docutils literal notranslate"><span class="pre">POST</span></code>
requests in various browsers).</p>
<p>Remember the other prime directive of searx is to be hackable, so if the above
privacy concerns do not fancy you, simply fork it.</p>
<blockquote>
<div><p><em>Happy hacking.</em></p>
</div></blockquote>
2015-11-17 23:38:25 +01:00
</div>
</div>
<div class="section" id="code">
2020-06-19 11:15:15 +02:00
<h2><a class="toc-backref" href="#id5">Code</a><a class="headerlink" href="#code" title="Permalink to this headline"></a></h2>
2019-12-30 18:31:17 +01:00
<div class="sidebar">
<p class="sidebar-title">Create good commits!</p>
<ul class="simple">
<li><p><a class="reference external" href="https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes">Structural split of changes</a></p></li>
<li><p><a class="reference external" href="https://www.conventionalcommits.org/">Conventional Commits</a></p></li>
<li><p><a class="reference external" href="https://wiki.openstack.org/wiki/GitCommitMessages">Git Commit Good Practice</a></p></li>
<li><p>some like to use: <a class="reference external" href="https://gitmoji.carloscuesta.me/">gitmoji</a></p></li>
<li><p>not yet active: <a class="reference external" href="https://github.com/zeke/semantic-pull-requests">Semantic PR</a></p></li>
</ul>
</div>
2015-12-10 21:40:22 +01:00
<p>In order to submit a patch, please follow the steps below:</p>
2019-12-30 18:31:17 +01:00
<ul>
<li><p>Follow coding conventions.</p>
2015-12-10 21:40:22 +01:00
<ul class="simple">
2019-12-30 18:31:17 +01:00
<li><p><a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP8</a> standards apply, except the convention of line length</p></li>
<li><p>Maximum line length is 120 characters</p></li>
2015-12-10 21:40:22 +01:00
</ul>
</li>
2019-12-30 18:31:17 +01:00
<li><p>The cardinal rule for creating good commits is to ensure there is only one
<em>logical change</em> per commit / read <a class="reference external" href="https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes">Structural split of changes</a></p></li>
<li><p>Check if your code breaks existing tests. If so, update the tests or fix your
code.</p></li>
<li><p>If your code can be unit-tested, add unit tests.</p></li>
2020-09-30 10:35:05 +02:00
<li><p>Add yourself to the <a class="reference external" href="https://github.com/searx/searx/blob/master/AUTHORS.rst">git://AUTHORS.rst</a> file.</p></li>
<li><p>Choose meaningful commit messages, read <a class="reference external" href="https://www.conventionalcommits.org/">Conventional Commits</a></p>
2019-12-30 18:31:17 +01:00
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;type&gt;[optional scope]: &lt;description&gt;
[optional body]
[optional footer(s)]
</pre></div>
</div>
</li>
<li><p>Create a pull request.</p></li>
2015-12-10 21:40:22 +01:00
</ul>
2016-04-21 13:15:04 +02:00
<p>For more help on getting started with searx development, see <a class="reference internal" href="quickstart.html#devquickstart"><span class="std std-ref">Development Quickstart</span></a>.</p>
2015-11-17 23:38:25 +01:00
</div>
<div class="section" id="translation">
2020-06-19 11:15:15 +02:00
<h2><a class="toc-backref" href="#id6">Translation</a><a class="headerlink" href="#translation" title="Permalink to this headline"></a></h2>
2019-12-30 18:31:17 +01:00
<p>Translation currently takes place on <a class="reference internal" href="translation.html#translation"><span class="std std-ref">transifex</span></a>.</p>
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>Please, do not update translation files in the repo.</p>
</div>
2015-11-17 23:38:25 +01:00
</div>
<div class="section" id="documentation">
2020-06-19 11:15:15 +02:00
<span id="contrib-docs"></span><h2><a class="toc-backref" href="#id7">Documentation</a><a class="headerlink" href="#documentation" title="Permalink to this headline"></a></h2>
2019-12-30 18:31:17 +01:00
<div class="sidebar">
<p class="sidebar-title">The reST sources</p>
2020-09-30 10:35:05 +02:00
<p>has been moved from <code class="docutils literal notranslate"><span class="pre">gh-branch</span></code> into <code class="docutils literal notranslate"><span class="pre">master</span></code> (<a class="reference external" href="https://github.com/searx/searx/blob/master/docs">git://docs</a>).</p>
2019-12-30 18:31:17 +01:00
</div>
<p>The documentation is built using <a class="reference external" href="https://www.sphinx-doc.org">Sphinx</a>. So in order to be able to generate
2019-12-30 18:31:17 +01:00
the required files, you have to install it on your system. Much easier, use
our <a class="reference internal" href="makefile.html#makefile"><span class="std std-ref">Makefile Targets</span></a>.</p>
<p>Here is an example which makes a complete rebuild:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ make docs-clean docs
...
The HTML pages are in dist/docs.
</pre></div>
</div>
<div class="section" id="live-build">
2020-06-19 11:15:15 +02:00
<span id="make-docs-live"></span><h3><a class="toc-backref" href="#id8">live build</a><a class="headerlink" href="#live-build" title="Permalink to this headline"></a></h3>
2019-12-30 18:31:17 +01:00
<div class="sidebar">
<p class="sidebar-title">docs-clean</p>
<p>It is recommended to assert a complete rebuild before deploying (use
<code class="docutils literal notranslate"><span class="pre">docs-clean</span></code>).</p>
</div>
<p>Live build is like WYSIWYG. If you want to edit the documentation, its
recommended to use. The Makefile target <code class="docutils literal notranslate"><span class="pre">docs-live</span></code> builds the docs, opens
URL in your favorite browser and rebuilds every time a reST file has been
changed.</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ make docs-live
...
The HTML pages are in dist/docs.
... Serving on http://0.0.0.0:8000
2019-12-30 18:31:17 +01:00
... Start watching changes
</pre></div>
</div>
<p>Live builds are implemented by <a class="reference external" href="https://github.com/executablebooks/sphinx-autobuild/blob/master/README.md">sphinx-autobuild</a>. Use environment
<code class="docutils literal notranslate"><span class="pre">$(SPHINXOPTS)</span></code> to pass arguments to the <a class="reference external" href="https://github.com/executablebooks/sphinx-autobuild/blob/master/README.md">sphinx-autobuild</a> command. Except
option <code class="docutils literal notranslate"><span class="pre">--host</span></code> (which is always set to <code class="docutils literal notranslate"><span class="pre">0.0.0.0</span></code>) you can pass any
argument. E.g to find and use a free port, use:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ <span class="nv">SPHINXOPTS</span><span class="o">=</span><span class="s2">&quot;--port 0&quot;</span> make docs-live
...
... Serving on http://0.0.0.0:50593
...
</pre></div>
</div>
2019-12-30 18:31:17 +01:00
</div>
<div class="section" id="deploy-on-github-io">
2020-06-19 11:15:15 +02:00
<span id="id2"></span><h3><a class="toc-backref" href="#id9">deploy on github.io</a><a class="headerlink" href="#deploy-on-github-io" title="Permalink to this headline"></a></h3>
2020-09-30 10:35:05 +02:00
<p>To deploy documentation at <a class="reference external" href="https://searx.github.io/searx/.">github.io</a> use Makefile target
2019-12-30 18:31:17 +01:00
<a class="reference internal" href="makefile.html#make-gh-pages"><span class="std std-ref">make gh-pages</span></a>, which will builds the documentation, clones searx into a sub
folder <code class="docutils literal notranslate"><span class="pre">gh-pages</span></code>, cleans it, copies the doc build into and runs all the
needed git add, commit and push:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ make docs-clean gh-pages
...
SPHINX docs --&gt; file://&lt;...&gt;/dist/docs
The HTML pages are in dist/docs.
...
Cloning into <span class="s1">&#39;gh-pages&#39;</span> ...
...
<span class="nb">cd</span> gh-pages<span class="p">;</span> git checkout gh-pages &gt;/dev/null
Switched to a new branch <span class="s1">&#39;gh-pages&#39;</span>
...
2020-09-30 10:35:05 +02:00
doc available at --&gt; https://searx.github.io/searx
2019-12-30 18:31:17 +01:00
</pre></div>
</div>
</div>
2015-11-17 23:38:25 +01:00
</div>
</div>
2020-09-30 10:35:05 +02:00
<div class="clearer"></div>
2015-11-17 23:38:25 +01:00
</div>
</div>
</div>
2019-12-30 18:31:17 +01:00
<span id="sidebar-top"></span>
2015-11-17 23:38:25 +01:00
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
2019-12-30 18:31:17 +01:00
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
2020-09-30 10:35:05 +02:00
<li><a href="https://github.com/searx/searx">Source</a>
2019-12-30 18:31:17 +01:00
2020-09-30 10:35:05 +02:00
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
2019-12-30 18:31:17 +01:00
<li><a href="https://searx.space">Public instances</a>
2019-12-30 18:31:17 +01:00
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
<li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
2019-12-30 18:31:17 +01:00
</ul><h3>Navigation</h3>
2015-11-17 23:38:25 +01:00
<ul>
2019-12-30 18:31:17 +01:00
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Developer documentation</a>
<ul>
<li>Previous: <a href="quickstart.html" title="previous chapter">Development Quickstart</a>
<li>Next: <a href="engine_overview.html" title="next chapter">Engine overview</a></ul>
</li>
</ul>
</li>
2015-11-17 23:38:25 +01:00
</ul>
2019-12-30 18:31:17 +01:00
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
2015-11-17 23:38:25 +01:00
</div>
2020-02-15 10:08:58 +01:00
<script>$('#searchbox').show(0);</script>
2015-11-17 23:38:25 +01:00
</div>
</div>
<div class="clearer"></div>
</div>
2019-12-30 18:31:17 +01:00
<div class="footer" role="contentinfo">
2020-02-20 19:32:55 +01:00
&#169; Copyright 2015-2020, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.1.
2015-11-17 23:38:25 +01:00
</div>
2020-02-15 10:08:58 +01:00
<script src="../_static/version_warning_offset.js"></script>
2019-12-30 18:31:17 +01:00
2015-11-17 23:38:25 +01:00
</body>
</html>