quickstart.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. .. _devquickstart:
  2. ======================
  3. Development Quickstart
  4. ======================
  5. .. _npm: https://www.npmjs.com/
  6. .. _Node.js: https://nodejs.org/
  7. .. sidebar:: further read
  8. - :ref:`makefile`
  9. - :ref:`buildhosts`
  10. SearXNG loves developers; Developers do not need to worry about tool chains, the
  11. usual developer tasks can be comfortably executed via :ref:`make <makefile>`.
  12. Don't hesitate, just clone SearXNG's sources and start hacking right now ..
  13. .. code:: bash
  14. git clone https://github.com/searxng/searxng.git searxng
  15. Here is how a minimal workflow looks like:
  16. 1. *start* hacking
  17. 2. *run* your code: :ref:`make run`
  18. 3. *format & test* your code: :ref:`make format.python` and :ref:`make test`
  19. If you think at some point something fails, go back to *start*. Otherwise,
  20. choose a meaningful commit message and we are happy to receive your pull
  21. request. To not end in *wild west* we have some directives, please pay attention
  22. to our ":ref:`how to contribute`" guideline.
  23. .. sidebar:: further read
  24. - :ref:`make nvm`
  25. - :ref:`make themes`
  26. If you implement themes, you will need to setup a :ref:`Node.js environment
  27. <make node.env>`: ``make node.env``
  28. Before you call *make run* (2.), you need to compile the modified styles and
  29. JavaScript: ``make themes.all``
  30. Alternatively you can also compile selective the theme you have modified,
  31. e.g. the *simple* theme.
  32. .. code:: bash
  33. make themes.simple
  34. .. tip::
  35. To get live builds while modifying CSS & JS use: ``LIVE_THEME=simple make run``
  36. .. sidebar:: further read
  37. - :ref:`make static.build`
  38. If you finished your *tests* you can start to commit your changes. To separate
  39. the modified source code from the build products first run:
  40. .. code:: bash
  41. make static.build.restore
  42. This will restore the old build products and only your changes of the code
  43. remain in the working tree which can now be added & committed. When all sources
  44. are committed, you can commit the build products simply by:
  45. .. code:: bash
  46. make static.build.commit
  47. Committing the build products should be the last step, just before you send us
  48. your PR. There is also a make target to rewind this last build commit:
  49. .. code:: bash
  50. make static.build.drop