[TYPO3-doc] Create custom inline markup reStructuredText

Martin Bless m.bless at gmx.de
Wed Oct 26 00:30:51 CEST 2011


Hello Fabien,

>I am currently migrating the Extbase / Fluid Book
[...]
>Currently, I am facing the need to extend custom inline markers.
[...]
>I would like to add my owns. For example "fluid", "typoscript" markers.
[...]
>:methodname:`getTitle()`

I just found out that you and we have that possibility already. At
least if we just want to have that roles and some standard behaviour
is sufficient.

And we don't have to program anything for this. There is a ``role``
directive [1] which does the trick. It lets us create those
interpreted roles "on the fly" - that is dynamically. "Custom
interpreted text roles" is the keyword.

Just insert something like this in your ReST document. The roles are
available following to that definition:

.. role:: fluid
.. role:: methodname
.. role:: typoscript
.. role:: ts

Then you can write:
"While :methodname:`getTitle()` is a method, :ts:`page=PAGE` is a
common example of Typoscript."

The standard behaviour produces this output in HTML:

<p>
While <span class="methodname">getTitle()</span>
 is a method,
<span class="ts">page=PAGE</span>
is a common example of Typoscript.”
</p>

See [1] for more possibilities.

Cool? Cool!!!


[1]
http://docutils.sourceforge.net/docs/ref/rst/directives.html#custom-interpreted-text-roles

... dream a little dream ...

Martin

-- 
http://mbless.de


More information about the TYPO3-project-documentation mailing list