theming.rst 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .. raw:: html
  2. <div id="banner"><a href="https://github.com/jcbrand/converse.js/blob/master/docs/source/theming.rst">Edit me on GitHub</a></div>
  3. .. _theming:
  4. =======
  5. Theming
  6. =======
  7. Setting up your environment
  8. ===========================
  9. In order to theme Converse, you first need to set up a :ref:`development` environment.
  10. You'll also want to preview the changes you make in your browser, for which a
  11. webserver will be useful.
  12. To both set up the development environment and also start up a web browser to
  13. serve the files for you, simply run::
  14. make serve
  15. .. note::
  16. To run the "make" commands, you'll need `GNUMake <https://www.gnu.org/software/make>`_
  17. installed on your computer. If you use GNU/Linux or \*BSD, it should be installed or
  18. available via your package manager. For Mac, I think you need to install XCode and in
  19. Windows you can use `Chocolatey <https://chocolatey.org/>`_.
  20. After running ``make serve`` you can open http://localhost:8000 in your webbrowser you'll
  21. see the Converse website.
  22. However, when developing or changing the theme, you'll want to load all the
  23. unminified JS and CSS resources as separate files. To do this, open http://localhost:8000/dev.html
  24. instead.
  25. Modifying the HTML templates of Converse
  26. ========================================
  27. The HTML markup of Converse is contained in small ``.html`` files in the
  28. ``./src/templates`` directory.
  29. You can modify HTML markup that Converse generates by modifying these files.
  30. Modifying the CSS
  31. =================
  32. The CSS files are generated from `Sass <http://sass-lang.com>`_ files in the ``./sass`` directory.
  33. To generate the CSS you can run::
  34. make css
  35. Testing your changes
  36. ====================
  37. The recommended way to test your changes is to run the tests that are part of the Converse source code.
  38. By executing ``make test`` you'll run all tests (which live in the ``spec`` folder) which will open a browser window in which tests are processed.
  39. You can run a single test by changing ``it(`` to ``fit(`` so that only that one test runs. Then you click the "debug" button in the browser when the tests run. After the test has run, the opened chats will still be visible.
  40. Creating dist files
  41. ===================
  42. Once you've themed Converse, you'll want to create new minified distribution
  43. files of all the JavaScript and CSS.
  44. Please refer to the :doc:`builds` section for information on how this is done.