Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
[TASK] Add textroles to demodocs
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Bless committed Nov 17, 2015
1 parent 74fced3 commit 5ea1656
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo_docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Demo Docs
:titlesonly:

highlighting
textroles
typesetting
demo-of-lists
long
Expand Down
68 changes: 68 additions & 0 deletions demo_docs/source/textroles.rst
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!`

0 comments on commit 5ea1656

Please sign in to comment.