theming.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. =======
  4. Theming
  5. =======
  6. .. contents:: Table of Contents
  7. :depth: 2
  8. :local:
  9. Setting up your environment
  10. ===========================
  11. In order to theme converse.js, you first need to set up a :ref:`development` environment.
  12. You'll also want to preview the changes you make in your browser, for which a
  13. webserver will be useful.
  14. To both set up the development environment and also start up a web browser to
  15. serve the files for you, simply run::
  16. make serve
  17. .. note::
  18. To run the "make" commands, you'll need `GNUMake <https://www.gnu.org/software/make>`_
  19. installed on your computer. If you use GNU/Linux or \*BSD, it should be installed or
  20. available via your package manager. For Mac, I think you need to install XCode and in
  21. Windows you can use `Chocolatey <https://chocolatey.org/>`_.
  22. After running ``make serve`` you can open http://localhost:8000 in your webbrowser you'll
  23. see the converse.js website.
  24. However, when developing or changing the theme, you'll want to load all the
  25. unminified JS and CSS resources as separate files. To do this, open http://localhost:8000/dev.html
  26. instead.
  27. Mockups
  28. =======
  29. Converse.js contains some mockups in the ``./mockup`` directory against which you
  30. can preview and tweak your changes.
  31. The ``./mockup/index.html`` file contains the most comprehensive mockup, while
  32. the other files focus on particular UI aspects.
  33. To see it in your browser, simply open: http://localhost:8000/mockup
  34. Modifying the HTML templates of Converse.js
  35. ===========================================
  36. The HTML markup of converse.js is contained in small ``.html`` files in the
  37. ``./src/templates`` directory.
  38. You can modify HTML markup that converse.js generates by modifying these files.
  39. Modifying the CSS
  40. =================
  41. The CSS files are generated from `Sass <http://sass-lang.com>`_ files in the ``./sass`` directory.
  42. To generate the CSS you can run::
  43. make css
  44. Creating builds
  45. ===============
  46. Once you've themed converse.js, you'll want to create new minified builds of
  47. the Javascript and CSS files.
  48. Please refer to the :doc:`builds` section for information on how this is done.