Note
This version of the guide covers the new PHP-based rendering of Documentation with the TYPO3 Documentation theme.
If the project you are looking at has a file Documentation/guides.xml it is using the new rendering.
Otherwise, consider to migrate the Documentation or head over to the legacy version of this guide: How to document, Sphinx based.
Code snippet generation¶
Regenerate existing code snippets¶
To regenerate the existing code snippets in a manual or extension clone the repository of that manual.
git clone git@github.com:TYPO3-Documentation/TYPO3CMS-Reference-CoreApi.git
Copied!
Use composer to install all dependencies, including dev-dependencies. In official manuals we have a make command for your convenience.
make install
Copied!
# in repositories with composer.lock in version control
composer install
# in repositories where the composer.lock is not in version control
# to prevent outdated packages due to a local composer.lock from earlier install-runs
composer update
Copied!
Then regenerate the code snippets. Official manuals should have a make command for that.
make codesnippets
Copied!
# Paths depends on where the vendor binaries are installed
# And where the configuration file codesnippets.php is located
vendor/bin/typo3 codesnippet:create Documentation/
Copied!