quickstart.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <!DOCTYPE html>
  2. <html lang="en" data-content_root="../">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Development Quickstart &#8212; SearXNG Documentation (2025.4.30+fd33559cf)</title>
  8. <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=6625fa76" />
  9. <link rel="stylesheet" type="text/css" href="../_static/searxng.css?v=52e4ff28" />
  10. <script src="../_static/documentation_options.js?v=b12b0e12"></script>
  11. <script src="../_static/doctools.js?v=9a2dae69"></script>
  12. <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
  13. <script data-project="searxng" data-version="2025.4.30+fd33559cf" src="../_static/describe_version.js?v=fa7f30d0"></script>
  14. <link rel="index" title="Index" href="../genindex.html" />
  15. <link rel="search" title="Search" href="../search.html" />
  16. <link rel="next" title="Runtime Management" href="rtm_asdf.html" />
  17. <link rel="prev" title="Developer documentation" href="index.html" />
  18. </head><body>
  19. <div class="related" role="navigation" aria-label="Related">
  20. <h3>Navigation</h3>
  21. <ul>
  22. <li class="right" style="margin-right: 10px">
  23. <a href="../genindex.html" title="General Index"
  24. accesskey="I">index</a></li>
  25. <li class="right" >
  26. <a href="../py-modindex.html" title="Python Module Index"
  27. >modules</a> |</li>
  28. <li class="right" >
  29. <a href="rtm_asdf.html" title="Runtime Management"
  30. accesskey="N">next</a> |</li>
  31. <li class="right" >
  32. <a href="index.html" title="Developer documentation"
  33. accesskey="P">previous</a> |</li>
  34. <li class="nav-item nav-item-0"><a href="../index.html">SearXNG Documentation (2025.4.30+fd33559cf)</a> &#187;</li>
  35. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Developer documentation</a> &#187;</li>
  36. <li class="nav-item nav-item-this"><a href="">Development Quickstart</a></li>
  37. </ul>
  38. </div>
  39. <div class="document">
  40. <div class="documentwrapper">
  41. <div class="bodywrapper">
  42. <div class="body" role="main">
  43. <section id="development-quickstart">
  44. <span id="devquickstart"></span><h1>Development Quickstart<a class="headerlink" href="#development-quickstart" title="Link to this heading">¶</a></h1>
  45. <aside class="sidebar">
  46. <p class="sidebar-title">further read</p>
  47. <ul class="simple">
  48. <li><p><a class="reference internal" href="makefile.html#makefile"><span class="std std-ref">Makefile &amp; ./manage</span></a></p></li>
  49. <li><p><a class="reference internal" href="../admin/buildhosts.html#buildhosts"><span class="std std-ref">Buildhosts</span></a></p></li>
  50. </ul>
  51. </aside>
  52. <p>SearXNG loves developers; Developers do not need to worry about tool chains, the
  53. usual developer tasks can be comfortably executed via <a class="reference internal" href="makefile.html#makefile"><span class="std std-ref">make</span></a>.</p>
  54. <p>Don’t hesitate, just clone SearXNG’s sources and start hacking right now ..</p>
  55. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/searxng/searxng.git<span class="w"> </span>searxng
  56. </pre></div>
  57. </div>
  58. <p>Here is how a minimal workflow looks like:</p>
  59. <ol class="arabic simple">
  60. <li><p><em>start</em> hacking</p></li>
  61. <li><p><em>run</em> your code: <a class="reference internal" href="makefile.html#make-run"><span class="std std-ref">make run</span></a></p></li>
  62. <li><p><em>format &amp; test</em> your code: <a class="reference internal" href="makefile.html#make-format-python"><span class="std std-ref">make format.python</span></a> and <a class="reference internal" href="makefile.html#make-test"><span class="std std-ref">make test</span></a></p></li>
  63. </ol>
  64. <p>If you think at some point something fails, go back to <em>start</em>. Otherwise,
  65. choose a meaningful commit message and we are happy to receive your pull
  66. request. To not end in <em>wild west</em> we have some directives, please pay attention
  67. to our “<a class="reference internal" href="contribution_guide.html#how-to-contribute"><span class="std std-ref">How to contribute</span></a>” guideline.</p>
  68. <aside class="sidebar">
  69. <p class="sidebar-title">further read</p>
  70. <ul class="simple">
  71. <li><p><a class="reference internal" href="makefile.html#make-nvm"><span class="std std-ref">NVM make nvm.install nvm.status</span></a></p></li>
  72. <li><p><a class="reference internal" href="makefile.html#make-themes"><span class="std std-ref">make themes.*</span></a></p></li>
  73. </ul>
  74. </aside>
  75. <p>If you implement themes, you will need to setup a <a class="reference internal" href="makefile.html#make-node-env"><span class="std std-ref">Node.js environment</span></a>. Before you call <em>make run</em> (2.), you need to compile the
  76. modified styles and JavaScript: <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">node.clean</span> <span class="pre">themes.all</span></code>. If <a class="reference external" href="https://eslint.org/">eslint</a> or
  77. <a class="reference external" href="https://stylelint.io/">stylelint</a> report some issues, try <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">themes.fix</span></code>.</p>
  78. <p>Alternatively you can also compile selective the theme you have modified,
  79. e.g. the <em>simple</em> theme.</p>
  80. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>make<span class="w"> </span>themes.simple
  81. </pre></div>
  82. </div>
  83. <div class="admonition tip">
  84. <p class="admonition-title">Tip</p>
  85. <p>To get live builds while modifying CSS &amp; JS use: <code class="docutils literal notranslate"><span class="pre">LIVE_THEME=simple</span> <span class="pre">make</span> <span class="pre">run</span></code></p>
  86. </div>
  87. <aside class="sidebar">
  88. <p class="sidebar-title">further read</p>
  89. <ul class="simple">
  90. <li><p><a class="reference internal" href="makefile.html#make-static-build"><span class="std std-ref">make static.build.*</span></a></p></li>
  91. </ul>
  92. </aside>
  93. <p>If you finished your <em>tests</em> you can start to commit your changes. To separate
  94. the modified source code from the build products first run:</p>
  95. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>make<span class="w"> </span>static.build.restore
  96. </pre></div>
  97. </div>
  98. <p>This will restore the old build products and only your changes of the code
  99. remain in the working tree which can now be added &amp; committed. When all sources
  100. are committed, you can commit the build products simply by:</p>
  101. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>make<span class="w"> </span>static.build.commit
  102. </pre></div>
  103. </div>
  104. <p>Committing the build products should be the last step, just before you send us
  105. your PR. There is also a make target to rewind this last build commit:</p>
  106. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>make<span class="w"> </span>static.build.drop
  107. </pre></div>
  108. </div>
  109. </section>
  110. <div class="clearer"></div>
  111. </div>
  112. </div>
  113. </div>
  114. <span id="sidebar-top"></span>
  115. <div class="sphinxsidebar" role="navigation" aria-label="Main">
  116. <div class="sphinxsidebarwrapper">
  117. <p class="logo"><a href="../index.html">
  118. <img class="logo" src="../_static/searxng-wordmark.svg" alt="Logo of SearXNG"/>
  119. </a></p>
  120. <h3><a href="../index.html">Table of Contents</a></h3>
  121. <ul class="current">
  122. <li class="toctree-l1"><a class="reference internal" href="../user/index.html">User information</a></li>
  123. <li class="toctree-l1"><a class="reference internal" href="../own-instance.html">Why use a private instance?</a></li>
  124. <li class="toctree-l1"><a class="reference internal" href="../admin/index.html">Administrator documentation</a></li>
  125. <li class="toctree-l1 current"><a class="reference internal" href="index.html">Developer documentation</a><ul class="current">
  126. <li class="toctree-l2 current"><a class="current reference internal" href="#">Development Quickstart</a></li>
  127. <li class="toctree-l2"><a class="reference internal" href="rtm_asdf.html">Runtime Management</a></li>
  128. <li class="toctree-l2"><a class="reference internal" href="contribution_guide.html">How to contribute</a></li>
  129. <li class="toctree-l2"><a class="reference internal" href="extended_types.html">Extended Types</a></li>
  130. <li class="toctree-l2"><a class="reference internal" href="engines/index.html">Engine Implementations</a></li>
  131. <li class="toctree-l2"><a class="reference internal" href="result_types/index.html">Result Types</a></li>
  132. <li class="toctree-l2"><a class="reference internal" href="templates.html">Simple Theme Templates</a></li>
  133. <li class="toctree-l2"><a class="reference internal" href="search_api.html">Search API</a></li>
  134. <li class="toctree-l2"><a class="reference internal" href="plugins/index.html">Plugins</a></li>
  135. <li class="toctree-l2"><a class="reference internal" href="answerers/index.html">Answerers</a></li>
  136. <li class="toctree-l2"><a class="reference internal" href="translation.html">Translation</a></li>
  137. <li class="toctree-l2"><a class="reference internal" href="lxcdev.html">Developing in Linux Containers</a></li>
  138. <li class="toctree-l2"><a class="reference internal" href="makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
  139. <li class="toctree-l2"><a class="reference internal" href="reST.html">reST primer</a></li>
  140. <li class="toctree-l2"><a class="reference internal" href="searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
  141. </ul>
  142. </li>
  143. <li class="toctree-l1"><a class="reference internal" href="../utils/index.html">DevOps tooling box</a></li>
  144. <li class="toctree-l1"><a class="reference internal" href="../src/index.html">Source-Code</a></li>
  145. </ul>
  146. <h3>Project Links</h3>
  147. <ul>
  148. <li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
  149. <li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
  150. <li><a href="https://searx.space">Public instances</a>
  151. <li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
  152. </ul><h3>Navigation</h3>
  153. <ul>
  154. <li><a href="../index.html">Overview</a>
  155. <ul>
  156. <li><a href="index.html">Developer documentation</a>
  157. <ul>
  158. <li>Previous: <a href="index.html" title="previous chapter">Developer documentation</a>
  159. <li>Next: <a href="rtm_asdf.html" title="next chapter">Runtime Management</a></ul>
  160. </li>
  161. </ul>
  162. </li>
  163. </ul>
  164. <search id="searchbox" style="display: none" role="search">
  165. <h3 id="searchlabel">Quick search</h3>
  166. <div class="searchformwrapper">
  167. <form class="search" action="../search.html" method="get">
  168. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  169. <input type="submit" value="Go" />
  170. </form>
  171. </div>
  172. </search>
  173. <script>document.getElementById('searchbox').style.display = "block"</script>
  174. <div role="note" aria-label="source link">
  175. <h3>This Page</h3>
  176. <ul class="this-page-menu">
  177. <li><a href="../_sources/dev/quickstart.rst.txt"
  178. rel="nofollow">Show Source</a></li>
  179. </ul>
  180. </div>
  181. </div>
  182. </div>
  183. <div class="clearer"></div>
  184. </div>
  185. <div class="footer" role="contentinfo">
  186. &#169; Copyright SearXNG team.
  187. </div>
  188. </body>
  189. </html>