- Add an Enlighter Sourcecode block.
-
Paste or type in the code you want to display
-
In the right column, make sure that the Block tab is active, if not, click on it.
-
[optional]: Language menu : select a code formatting depending on the displayed language.
-
[optional]: Specialline field: Indicate the lines of code you wish to highlight by separating them with commas or a hyphen if they are contiguous. The code appears highlighted
Ex: 1,3,8 or 12-16. You can also combine e.g. 1,3,8,12-16. -
[optional]: Lineoffset field: By default the line numbering starts at 1. Enter a value if you want the numbering to start at another number.
-
[optional]: Theme menu. Choose a theme (look) in the drop-down menu.
-
[optional]: Linenumbers: Indicate whether you want to display line numbers or not. Note: They are displayed by default.
Example
<header role="banner" class="header"> <a class="logo" href="https://www.epfl.ch/fr/"> <img src="https://www.epfl.ch/wp-content/themes/wp-theme-2018/assets/svg/epfl-logo.svg?refresh=now" alt="Logo EPFL, École polytechnique fédérale de Lausanne" class="img-fluid"> </a> <ul id="top-menu" class="nav-header d-none d-xl-flex"><li id="menu-item--1" class="menu-item-has-children menu-item--1"><a href="https://www.epfl.ch/about/fr/a-propos/">À propos</a></li> <li id="menu-item--399" class="menu-item-has-children menu-item--399"><a href="https://www.epfl.ch/education/fr/education/">Éducation</a></li> <li id="menu-item--1249" class="menu-item-has-children menu-item--1249"><a href="https://www.epfl.ch/research/fr/recherche/">Recherche</a></li> <li id="menu-item--2517" class="menu-item-has-children menu-item--2517"><a href="https://www.epfl.ch/innovation/fr/innovation-2/">Innovation</a></li> <li id="menu-item--2573" class="menu-item-has-children menu-item--2573"><a href="https://www.epfl.ch/schools/fr/facultes/">Facultés</a></li> <li id="menu-item--4163" class="menu-item-has-children menu-item--4163"><a href="https://www.epfl.ch/campus/fr/campus/">Campus</a></li> <li id="menu-item--0" class="menu-item--0"><a style="color:#ff0000;" href="https://www.epfl.ch/campus/security-safety/sante/coronavirus-covid-19/">Info coronavirus</a></li></ul>