theming.rst 2.3 KB

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