Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove highlight directive #457

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions Documentation/Reference/ReStructuredText/Code/Codeblocks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,25 +319,6 @@ Use syntactically correct code
...
);

.. index:: reST directives; highlight
.. _writing-rest-codeblocks-highlight-directive:
.. _codeblocks-highlight-directive:

Highlight directive
===================

You can set the default language with the `highlight` directive. All following
code blocks will use the language as specified in the `highlight` directive for
syntax highlighting.

This language works as fall back for the outdated code blocks that do not
specify the desired language.

For TYPO3 we have adopted the convention that each reStructuredText source file
imports the :file:`Documentation/Includes.rst.txt` file at the top. And in the
included file - in general - we set PHP as default language for highlighting.
Exception: In the TypoScript manuals we are using `typoscript` as default.

.. index:: reST; Languages
.. _writing-rest-codeblocks-available-languages:
.. _writing-rest-codeblocks-available-lexers:
Expand Down Expand Up @@ -469,9 +450,7 @@ We recommend that you always write the language name after the code block direct
This makes it easier for first time contributors to adjust or copy-paste code
blocks. For historic reasons there are code blocks without an explicit language.

If you do not explicitly set the language, the default language (as set with
the :ref:`codeblocks-highlight-directive`) is used. If no highlight directive
was used, the default set in :file:`Documentation/Includes.rst.txt` is used.
If you do not explicitly set the language, the default language (PHP) is used.

In the past a simplified shorthand directive was widely used: A sentence ending
with two double colon :rst:`::`, followed by a new line and an indented
Expand Down