This repository has been archived by the owner on Jun 25, 2020. It is now read-only.
forked from readthedocs/sphinx_rtd_theme
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Bless
committed
Nov 17, 2015
1 parent
74fced3
commit 5ea1656
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ Demo Docs | |
:titlesonly: | ||
|
||
highlighting | ||
textroles | ||
typesetting | ||
demo-of-lists | ||
long | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
========= | ||
Textroles | ||
========= | ||
|
||
.. role:: php(code) | ||
.. role:: typoscript(code) | ||
.. role:: ts(typoscript) | ||
:class: typoscript | ||
.. highlight:: rst | ||
.. default-role:: code | ||
|
||
Übersicht | ||
========= | ||
|
||
|
||
================ ================================================= ============================================ | ||
role source output | ||
================ ================================================= ============================================ | ||
(default) ```result = (1 + x) * 32``` `result = (1 + x) * 32` | ||
code ``:code:`result = (1 + x) * 32``` :code:`result = (1 + x) * 32` | ||
class ``:class:`\\TYPO3\\CMS\\Extbase``` :class:`\\TYPO3\\CMS\\Extbase` | ||
file ``:file:`/etc/passwd``` :file:`/etc/passwd` | ||
ts ``:ts:`lib.hello.value = Hello World!``` :ts:`lib.hello.value = Hello World!` | ||
typoscript ``:typoscript:`lib.hello.value = Hello World!``` :typoscript:`lib.hello.value = Hello World!` | ||
php ``:php:`$result = $a + 23;``` :php:`$result = $a + 23;` | ||
================ ================================================= ============================================ | ||
|
||
|
||
Standard Sphinx and Docutils Textroles | ||
====================================== | ||
|
||
- This is how ``:code:`result = (1 + x) * 32``` looks like: :code:`result = (1 + x) * 32` | ||
|
||
- "code" also is the **default** *text-role*. So ```result = (1 + x) * 32``` looks the | ||
same `result = (1 + x) * 32` as ``:code:`result = (1 + x) * 32```. | ||
|
||
- This is how ``:class:`\\TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerInterface``` looks like: :class:`\\TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerInterface` | ||
|
||
- This is how ``:file:`/etc/passwd``` looks like: :file:`/etc/passwd` | ||
|
||
|
||
|
||
|
||
Self Defined Textroles | ||
====================== | ||
|
||
In file :file:`Includes.txt` we usually have:: | ||
|
||
.. This is 'Includes.txt'. It is included at the very top of each and | ||
every ReST source file in this documentation project (= manual). | ||
|
||
.. role:: php(code) | ||
.. role:: typoscript(code) | ||
.. role:: ts(typoscript) | ||
:class: typoscript | ||
.. highlight:: rst | ||
.. default-role:: code | ||
.. | ||
|
||
Check the following to see if we have give those an individual styling: | ||
|
||
- This is how ``:php:`$result = $a + 23;``` looks like: :php:`$result = $a + 23;` | ||
|
||
- This is how ``:typoscript:`lib.hello.value = Hello World!``` looks like: :typoscript:`lib.hello.value = Hello World!` | ||
|
||
- This is how ``:ts:`lib.hello.value = Hello World!``` looks like: :ts:`lib.hello.value = Hello World!` | ||
|