on 385dcbf help sign in
Idris-dev/docs/reference/semantic-highlighting.rst
50 lines 2.4 kB history raw
1****************************************
2Semantic Highlighting & Pretty Printing
3****************************************
5Since ``v0.9.18`` Idris comes with support for semantic highlighting.
6When using the ``REPL`` or IDE support, Idris will highlight your code accordingly to its meaning within the Idris structure. A precursor to semantic highlighting support is the pretty printing of definitions to console, LaTeX, or HTML.
8The default styling scheme used was inspired by Conor McBride's own set of stylings, informally known as *Conor Colours*.
11Legend
12======
14The concepts and their default stylings are as follows:
16+----------------+---------------+----------------+----------------+
17| Idris Term | HTML | LaTeX | IDE/REPL |
18+================+===============+================+================+
19| Bound Variable | Purple | Magenta | |
20+----------------+---------------+----------------+----------------+
21| Keyword | Bold | Underlined | |
22+----------------+---------------+----------------+----------------+
23| Function | Green | Green | |
24+----------------+---------------+----------------+----------------+
25| Type | Blue | Blue | |
26+----------------+---------------+----------------+----------------+
27| Data | Red | Red | |
28+----------------+---------------+----------------+----------------+
29| Implicit | Italic Purple | Italic Magenta | |
30+----------------+---------------+----------------+----------------+
32Pretty Printing
33===============
35Idris also supports the pretty printing of code to HTML and LaTeX using the commands:
37+ ``:pp <latex|html> <width> <function name>``
38+ ``:pprint <latex|html> <width> <function name>``
41Customisation
42=============
44If you are not happy with the colours used, the VIM and Emacs editor support allows for customisation of the colours. When pretty printing Idris code as LaTeX and HTML, commands and a CSS style are provided. The colours used by the REPL can be customised through the initialisation script.
47Further Information
48===================
50Please also see the `Idris Extras <https://github.com/idris-hackers/idris-extras>`_ project for links to editor support, and pre-made style files for LaTeX and HTML.