RST icon indicating copy to clipboard operation
RST copied to clipboard

Add role directive

Open kaystrobach opened this issue 10 years ago • 4 comments

.. ==================================================
.. DEFINE SOME TEXT ROLES
.. --------------------------------------------------

.. role::   typoscript(code)

.. role::   ts(typoscript)
   :class:  typoscript

.. role::   php(code)
    :language: php

.. highlight:: php

kaystrobach avatar Oct 14 '14 11:10 kaystrobach

Can you be more clear please?

Gregwar avatar Oct 14 '14 11:10 Gregwar

i just tried to compile a set of documents, from the TYPO3 Extension sphinx http://docs.typo3.org/typo3cms/extensions/sphinx/_sources/AdministratorManual/Index.txt (there is a show source link on every page) Or you use git directly https://git.typo3.org/TYPO3CMS/Extensions/sphinx.git

During the compilation i get the following output:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Unknown directive: only' in /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/ErrorManager.php:17
Stack trace:
#0 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Parser.php(485): Gregwar\RST\ErrorManager->error('Unknown directi...')
#1 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Parser.php(688): Gregwar\RST\Parser->getCurrentDirective()
#2 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Parser.php(733): Gregwar\RST\Parser->parseLine('')
#3 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Parser.php(751): Gregwar\RST\Parser->parseLines('\xEF\xBB\xBF.. =========...')
#4 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Builder.php(201): Gregwar\RST\Parser->parse('\xEF\xBB\xBF.. =========...')
#5 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Builder.php(115): Gregwar\RST\Builder->parseAll()
#6 /Users/kay/Development/rest/index.php(16): Gregwar\RST\Builder->build('input', 'output', true)
#7 { in /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/ErrorManager.php on line 17
Kays-MacBook-Pro:rest kay$ php index.php
* Loading metas
* Pre-scanning files
 -> Scanning index...
* Parsing files
 -> Parsing index...
PHP Fatal error:  Uncaught exception 'Exception' with message 'Unknown directive: only' in /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/ErrorManager.php:17
Stack trace:
#0 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Parser.php(485): Gregwar\RST\ErrorManager->error('Unknown directi...')
#1 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Parser.php(688): Gregwar\RST\Parser->getCurrentDirective()
#2 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Parser.php(733): Gregwar\RST\Parser->parseLine('')
#3 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Parser.php(751): Gregwar\RST\Parser->parseLines('\xEF\xBB\xBF.. =========...')
#4 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Builder.php(201): Gregwar\RST\Parser->parse('\xEF\xBB\xBF.. =========...')
#5 /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/Builder.php(115): Gregwar\RST\Builder->parseAll()
#6 /Users/kay/Development/rest/index.php(16): Gregwar\RST\Builder->build('input', 'output', true)
#7 { in /Users/kay/Development/rest/vendor/gregwar/rst/Gregwar/RST/ErrorManager.php on line 17

So i tried to figure out, what the problem is, perhaps it's enough to have an option to ignore these kind of errors and just go on compiling?

kaystrobach avatar Oct 14 '14 11:10 kaystrobach

From my point of view (I'm the author of the aforementioned manual), roles are of secondary interest. The file that defines those roles is a standard in the TYPO3 world however goal (in that example) is to allow inline highlighting of short code, something I did not actually use. Some special markers are however very useful: http://docs.typo3.org/typo3cms/drafts/github/xperseguers/RstPrimer/AdvancedMarkup.html#other-semantic-markup

xperseguers avatar Oct 14 '14 19:10 xperseguers

Actually, if you want to make a pure-PHP builder for the Typo3 doc, we'll have to define what is Typo3 documentation specific and what is not I can help on the core, but the specific work may need some people of your team

Gregwar avatar Oct 14 '14 20:10 Gregwar