quickstart.rst 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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>`. Before you call *make run* (2.), you need to compile the
  28. modified styles and JavaScript: ``make node.clean themes.all``
  29. Alternatively you can also compile selective the theme you have modified,
  30. e.g. the *simple* theme.
  31. .. code:: bash
  32. make themes.simple
  33. .. tip::
  34. To get live builds while modifying CSS & JS use: ``LIVE_THEME=simple make run``
  35. .. sidebar:: further read
  36. - :ref:`make static.build`
  37. If you finished your *tests* you can start to commit your changes. To separate
  38. the modified source code from the build products first run:
  39. .. code:: bash
  40. make static.build.restore
  41. This will restore the old build products and only your changes of the code
  42. remain in the working tree which can now be added & committed. When all sources
  43. are committed, you can commit the build products simply by:
  44. .. code:: bash
  45. make static.build.commit
  46. Committing the build products should be the last step, just before you send us
  47. your PR. There is also a make target to rewind this last build commit:
  48. .. code:: bash
  49. make static.build.drop