Browse Source

add dev tips to quickstart

Noemi Vanyi 8 years ago
parent
commit
bac7dc57ee

+ 2
- 0
_sources/dev/contribution_guide.txt View File

64
 
64
 
65
 - Create a pull request.
65
 - Create a pull request.
66
 
66
 
67
+For more help on getting started with searx development, see :ref:`devquickstart`.
68
+
67
 
69
 
68
 Translation
70
 Translation
69
 ~~~~~~~~~~~
71
 ~~~~~~~~~~~

+ 18
- 0
_sources/dev/quickstart.txt View File

1
+.. _devquickstart:
2
+
1
 Development Quickstart
3
 Development Quickstart
2
 ----------------------
4
 ----------------------
3
 
5
 
88
 .. code:: sh
90
 .. code:: sh
89
 
91
 
90
     ./manage.sh build_grunt
92
     ./manage.sh build_grunt
93
+
94
+
95
+
96
+Tips for debugging/development
97
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98
+
99
+1. Turn on debug logging
100
+    Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
101
+    to turn on debug logging. When debug logging is enabled a stack trace appears,
102
+    instead of the cryptic ``Internal Server Error`` message. It can be turned on by setting
103
+    ``debug: False`` to ``debug: True`` in settings.yml.
104
+
105
+2. Run ``./manage.sh tests`` before creating a PR.
106
+    Failing build on Travis is common because of PEP8 checks. So a new commit must be created
107
+    containing these format fixes. This phase can be skipped if ``./manage.sh tests`` is run
108
+    locally before creating a PR.

+ 2
- 1
dev/contribution_guide.html View File

25
     <script type="text/javascript" src="../_static/doctools.js"></script>
25
     <script type="text/javascript" src="../_static/doctools.js"></script>
26
     <link rel="top" title="searx 0.8.0 documentation" href="../index.html" />
26
     <link rel="top" title="searx 0.8.0 documentation" href="../index.html" />
27
     <link rel="next" title="Installation" href="install/installation.html" />
27
     <link rel="next" title="Installation" href="install/installation.html" />
28
-    <link rel="prev" title="Search syntax" href="../user/search_syntax.html" />
28
+    <link rel="prev" title="Development Quickstart" href="quickstart.html" />
29
    
29
    
30
   
30
   
31
   <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
31
   <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
92
 <li>Add yourself to the AUTHORS file.</li>
92
 <li>Add yourself to the AUTHORS file.</li>
93
 <li>Create a pull request.</li>
93
 <li>Create a pull request.</li>
94
 </ul>
94
 </ul>
95
+<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>
95
 </div>
96
 </div>
96
 <div class="section" id="translation">
97
 <div class="section" id="translation">
97
 <h2>Translation<a class="headerlink" href="#translation" title="Permalink to this headline">¶</a></h2>
98
 <h2>Translation<a class="headerlink" href="#translation" title="Permalink to this headline">¶</a></h2>

+ 39
- 15
dev/quickstart.html View File

24
     <script type="text/javascript" src="../_static/underscore.js"></script>
24
     <script type="text/javascript" src="../_static/underscore.js"></script>
25
     <script type="text/javascript" src="../_static/doctools.js"></script>
25
     <script type="text/javascript" src="../_static/doctools.js"></script>
26
     <link rel="top" title="searx 0.8.0 documentation" href="../index.html" />
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
   <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
31
   <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
38
           <div class="body" role="main">
40
           <div class="body" role="main">
39
             
41
             
40
   <div class="section" id="development-quickstart">
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
 <p>This quickstart guide gets your environment set up with searx. Furthermore, it gives a
44
 <p>This quickstart guide gets your environment set up with searx. Furthermore, it gives a
43
 short introduction to the new manage.sh script.</p>
45
 short introduction to the new manage.sh script.</p>
44
 <div class="section" id="how-to-setup-your-development-environment">
46
 <div class="section" id="how-to-setup-your-development-environment">
46
 <p>First, clone the source code of searx to the desired folder. In this case the source
48
 <p>First, clone the source code of searx to the desired folder. In this case the source
47
 is cloned to ~/myprojects/searx. Then create and activate the searx-ve
49
 is cloned to ~/myprojects/searx. Then create and activate the searx-ve
48
 virtualenv and install the required packages using manage.sh.</p>
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
 </pre></div>
57
 </pre></div>
56
 </div>
58
 </div>
57
 </div>
59
 </div>
66
 <li>Unit test coverage check</li>
68
 <li>Unit test coverage check</li>
67
 </ul>
69
 </ul>
68
 <p>For example unit tests are run with the command below:</p>
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
 </pre></div>
72
 </pre></div>
71
 </div>
73
 </div>
72
 <p>For further test options, please consult the help of the manage.sh script.</p>
74
 <p>For further test options, please consult the help of the manage.sh script.</p>
76
 <div class="section" id="how-to-build-styles">
78
 <div class="section" id="how-to-build-styles">
77
 <h3>How to build styles<a class="headerlink" href="#how-to-build-styles" title="Permalink to this headline">¶</a></h3>
79
 <h3>How to build styles<a class="headerlink" href="#how-to-build-styles" title="Permalink to this headline">¶</a></h3>
78
 <p>Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.</p>
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
 </pre></div>
83
 </pre></div>
82
 </div>
84
 </div>
83
 <p>OR</p>
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
 </pre></div>
87
 </pre></div>
86
 </div>
88
 </div>
87
 <p>After satisfying the requirements styles can be build using manage.sh</p>
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
 </pre></div>
91
 </pre></div>
90
 </div>
92
 </div>
91
 </div>
93
 </div>
93
 <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>
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
 <p>Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
96
 <p>Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
95
 Node has to be installed.</p>
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
 </pre></div>
100
 </pre></div>
99
 </div>
101
 </div>
100
 <p>After installing grunt, the files can be built using the following command:</p>
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
 </pre></div>
104
 </pre></div>
103
 </div>
105
 </div>
104
 </div>
106
 </div>
105
 </div>
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
 </div>
130
 </div>
107
 
131
 
108
 
132
 

+ 2
- 0
docs/dev/contribution_guide.rst View File

64
 
64
 
65
 - Create a pull request.
65
 - Create a pull request.
66
 
66
 
67
+For more help on getting started with searx development, see :ref:`devquickstart`.
68
+
67
 
69
 
68
 Translation
70
 Translation
69
 ~~~~~~~~~~~
71
 ~~~~~~~~~~~

+ 18
- 0
docs/dev/quickstart.rst View File

1
+.. _devquickstart:
2
+
1
 Development Quickstart
3
 Development Quickstart
2
 ----------------------
4
 ----------------------
3
 
5
 
88
 .. code:: sh
90
 .. code:: sh
89
 
91
 
90
     ./manage.sh build_grunt
92
     ./manage.sh build_grunt
93
+
94
+
95
+
96
+Tips for debugging/development
97
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98
+
99
+1. Turn on debug logging
100
+    Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
101
+    to turn on debug logging. When debug logging is enabled a stack trace appears,
102
+    instead of the cryptic ``Internal Server Error`` message. It can be turned on by setting
103
+    ``debug: False`` to ``debug: True`` in settings.yml.
104
+
105
+2. Run ``./manage.sh tests`` before creating a PR.
106
+    Failing build on Travis is common because of PEP8 checks. So a new commit must be created
107
+    containing these format fixes. This phase can be skipped if ``./manage.sh tests`` is run
108
+    locally before creating a PR.