iCalendar syntax highlighting#
The extension also registers an ics (and icalendar) language alias for Pygments so you can highlight raw iCalendar snippets in ordinary code blocks without triggering the calendar rendering:
.. code-block:: ics
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART;TZID="America/New_York":20260401T090000
DTEND;TZID="America/New_York":20260401T100000
SUMMARY:Quarterly review
END:VEVENT
END:VCALENDAR
The result is a static, highlighted code block:
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART;TZID="America/New_York":20260401T090000
DTEND;TZID="America/New_York":20260401T100000
SUMMARY:Quarterly review
END:VEVENT
END:VCALENDAR
Options#
iCalendar supports the linenos and emphasize-lines options, just like any
other .. code-block:: language:
.. code-block:: ics
:linenos:
:emphasize-lines: 3, 5
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART;TZID="America/New_York":20260401T090000
DTEND;TZID="America/New_York":20260401T100000
SUMMARY:Quarterly review
END:VEVENT
END:VCALENDAR
1 BEGIN:VCALENDAR
2 BEGIN:VEVENT
3 DTSTART;TZID="America/New_York":20260401T090000
4 DTEND;TZID="America/New_York":20260401T100000
5 SUMMARY:Quarterly review
6 END:VEVENT
7 END:VCALENDAR