|
@@ -24,6 +24,8 @@
|
24
|
24
|
<script type="text/javascript" src="../_static/underscore.js"></script>
|
25
|
25
|
<script type="text/javascript" src="../_static/doctools.js"></script>
|
26
|
26
|
<link rel="top" title="searx 0.8.0 documentation" href="../index.html" />
|
|
27
|
+ <link rel="next" title="How to contribute" href="contribution_guide.html" />
|
|
28
|
+ <link rel="prev" title="Search syntax" href="../user/search_syntax.html" />
|
27
|
29
|
|
28
|
30
|
|
29
|
31
|
<link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
|
|
@@ -38,7 +40,7 @@
|
38
|
40
|
<div class="body" role="main">
|
39
|
41
|
|
40
|
42
|
<div class="section" id="development-quickstart">
|
41
|
|
-<h1>Development Quickstart<a class="headerlink" href="#development-quickstart" title="Permalink to this headline">¶</a></h1>
|
|
43
|
+<span id="devquickstart"></span><h1>Development Quickstart<a class="headerlink" href="#development-quickstart" title="Permalink to this headline">¶</a></h1>
|
42
|
44
|
<p>This quickstart guide gets your environment set up with searx. Furthermore, it gives a
|
43
|
45
|
short introduction to the new manage.sh script.</p>
|
44
|
46
|
<div class="section" id="how-to-setup-your-development-environment">
|
|
@@ -46,12 +48,12 @@ short introduction to the new manage.sh script.</p>
|
46
|
48
|
<p>First, clone the source code of searx to the desired folder. In this case the source
|
47
|
49
|
is cloned to ~/myprojects/searx. Then create and activate the searx-ve
|
48
|
50
|
virtualenv and install the required packages using manage.sh.</p>
|
49
|
|
-<div class="code sh highlight-python"><div class="highlight"><pre>cd ~/myprojects
|
50
|
|
-git clone https://github.com/asciimoo/searx.git
|
51
|
|
-cd searx
|
52
|
|
-virtualenv searx-ve
|
53
|
|
-. ./searx-ve/bin/activate
|
54
|
|
-./manage.sh update_dev_packages
|
|
51
|
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">cd</span> <span class="o">~/</span><span class="n">myprojects</span>
|
|
52
|
+<span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">asciimoo</span><span class="o">/</span><span class="n">searx</span><span class="o">.</span><span class="n">git</span>
|
|
53
|
+<span class="n">cd</span> <span class="n">searx</span>
|
|
54
|
+<span class="n">virtualenv</span> <span class="n">searx</span><span class="o">-</span><span class="n">ve</span>
|
|
55
|
+<span class="o">.</span> <span class="o">./</span><span class="n">searx</span><span class="o">-</span><span class="n">ve</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
|
|
56
|
+<span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">update_dev_packages</span>
|
55
|
57
|
</pre></div>
|
56
|
58
|
</div>
|
57
|
59
|
</div>
|
|
@@ -66,7 +68,7 @@ virtualenv searx-ve
|
66
|
68
|
<li>Unit test coverage check</li>
|
67
|
69
|
</ul>
|
68
|
70
|
<p>For example unit tests are run with the command below:</p>
|
69
|
|
-<div class="code sh highlight-python"><div class="highlight"><pre>./manage.sh unit_tests
|
|
71
|
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">unit_tests</span>
|
70
|
72
|
</pre></div>
|
71
|
73
|
</div>
|
72
|
74
|
<p>For further test options, please consult the help of the manage.sh script.</p>
|
|
@@ -76,16 +78,16 @@ virtualenv searx-ve
|
76
|
78
|
<div class="section" id="how-to-build-styles">
|
77
|
79
|
<h3>How to build styles<a class="headerlink" href="#how-to-build-styles" title="Permalink to this headline">¶</a></h3>
|
78
|
80
|
<p>Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.</p>
|
79
|
|
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install nodejs
|
80
|
|
-sudo npm install -g less
|
|
81
|
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
|
|
82
|
+<span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">less</span>
|
81
|
83
|
</pre></div>
|
82
|
84
|
</div>
|
83
|
85
|
<p>OR</p>
|
84
|
|
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install node-less
|
|
86
|
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">node</span><span class="o">-</span><span class="n">less</span>
|
85
|
87
|
</pre></div>
|
86
|
88
|
</div>
|
87
|
89
|
<p>After satisfying the requirements styles can be build using manage.sh</p>
|
88
|
|
-<div class="code sh highlight-python"><div class="highlight"><pre>./manage.sh styles
|
|
90
|
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">styles</span>
|
89
|
91
|
</pre></div>
|
90
|
92
|
</div>
|
91
|
93
|
</div>
|
|
@@ -93,16 +95,38 @@ sudo npm install -g less
|
93
|
95
|
<h3>How to build the source of the oscar theme<a class="headerlink" href="#how-to-build-the-source-of-the-oscar-theme" title="Permalink to this headline">¶</a></h3>
|
94
|
96
|
<p>Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
|
95
|
97
|
Node has to be installed.</p>
|
96
|
|
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install nodejs
|
97
|
|
-sudo npm install -g grunt-cli
|
|
98
|
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
|
|
99
|
+<span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">grunt</span><span class="o">-</span><span class="n">cli</span>
|
98
|
100
|
</pre></div>
|
99
|
101
|
</div>
|
100
|
102
|
<p>After installing grunt, the files can be built using the following command:</p>
|
101
|
|
-<div class="code sh highlight-python"><div class="highlight"><pre>./manage.sh build_grunt
|
|
103
|
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">build_grunt</span>
|
102
|
104
|
</pre></div>
|
103
|
105
|
</div>
|
104
|
106
|
</div>
|
105
|
107
|
</div>
|
|
108
|
+<div class="section" id="tips-for-debugging-development">
|
|
109
|
+<h2>Tips for debugging/development<a class="headerlink" href="#tips-for-debugging-development" title="Permalink to this headline">¶</a></h2>
|
|
110
|
+<ol class="arabic">
|
|
111
|
+<li><dl class="first docutils">
|
|
112
|
+<dt>Turn on debug logging</dt>
|
|
113
|
+<dd><p class="first last">Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
|
|
114
|
+to turn on debug logging. When debug logging is enabled a stack trace appears,
|
|
115
|
+instead of the cryptic <code class="docutils literal"><span class="pre">Internal</span> <span class="pre">Server</span> <span class="pre">Error</span></code> message. It can be turned on by setting
|
|
116
|
+<code class="docutils literal"><span class="pre">debug:</span> <span class="pre">False</span></code> to <code class="docutils literal"><span class="pre">debug:</span> <span class="pre">True</span></code> in settings.yml.</p>
|
|
117
|
+</dd>
|
|
118
|
+</dl>
|
|
119
|
+</li>
|
|
120
|
+<li><dl class="first docutils">
|
|
121
|
+<dt>Run <code class="docutils literal"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> before creating a PR.</dt>
|
|
122
|
+<dd><p class="first last">Failing build on Travis is common because of PEP8 checks. So a new commit must be created
|
|
123
|
+containing these format fixes. This phase can be skipped if <code class="docutils literal"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> is run
|
|
124
|
+locally before creating a PR.</p>
|
|
125
|
+</dd>
|
|
126
|
+</dl>
|
|
127
|
+</li>
|
|
128
|
+</ol>
|
|
129
|
+</div>
|
106
|
130
|
</div>
|
107
|
131
|
|
108
|
132
|
|