This script creates a RST file from the comments inside of config.sample.php.
The live environment that updates https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html is running on the translation sync server based on this docker image: https://github.com/nextcloud/docker-ci/blob/master/translations/Dockerfile-Documentation-Sync So after performing changes in this repository here, a new docker image has to be created in the docker-ci repository.
Install the dependencies with composer
:
composer install
Just call following in your Nextcloud server repo:
php -f convert.php path/to/config.sample.php path/to/config_sample_php_parameters.rst
This will create a file sample_config.rst
which was generated from config/config.sample.php
Currently this relies on following
- all comments need to start with
/**
and end with*/
- each on their own line - add a
@see CONFIG_INDEX
to copy a previously described config option also to this line - everything between the
*/
and the next/**
will be treated as the config option
You can set following options:
The tag which invokes to copy a config description to the current position
$COPY_TAG = 'see';
The file which should be parsed
$CONFIG_SAMPLE_FILE = 'config/config.sample.php';
The file to put output in
$OUTPUT_FILE = 'sample_config.rst';