Inline code with or without overlays
Hint
Too much inline code can make the information on a page unreadable. If this is the case, consider using Code blocks with syntax highlighting.
Any text inside single or double backticks is printed as inline code. Double backticks allow unescaped backticks to be used in the code:
By convention single backticks are used unless double are needed.
Code roles with language information and overlay
You can also use text roles with one of the predefined languages to display more information to the user. For the most common languages, automatic detection provides more context for the user.
$variable = 'Some general PHP'
\TYPO3\
TYPO3 class with fully qualified nameCMS\ Core\ Core\ Environment Environment
TYPO3 class with short name\Symfony\
External classComponent\ Dotenv\ Dotenv $GLOBALS
configuration values['TYPO3_ CONF_ VARS'] ['MAIL'] ['transport'] page = PAGE
TCAdefaults.
pages. hidden <f:
debug> {my Variable}</ f: debug> <code>
code#mycode
{font- family: courier} alert
('test') ./
vendor/ bin/ typo3 help
* :php:`$variable = 'Some general PHP'`
* :php:`\TYPO3\CMS\Core\Core\Environment` TYPO3 class with fully qualified name
* :php-short:`\TYPO3\CMS\Core\Core\Environment` TYPO3 class with short name
* :php:`\Symfony\Component\Dotenv\Dotenv` External class
* :php:`$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport']` configuration values
* :typoscript:`page = PAGE`
* :tsconfig:`TCAdefaults.pages.hidden`
* :fluid:`<f:debug>{myVariable}</f:debug>`
* :html:`<code>`
* :css:`code#mycode {font-family: courier}`
* :js:`alert('test')`
* :bash:`./vendor/bin/typo3 help`
PHP classes from the TYPO3 Core are automatically linked to https://api.typo3.org and display the PHP doc comment (if any) in the overlay.
All named inline code roles show an overlay where the code can be conveniently copied and information on the language of the code.