Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"require": {
"phpdocumentor/reflection-docblock": "^5.3",
"php": "^8.0"
}
"require": {
"phpdocumentor/reflection-docblock": "^5.3",
"php": "^8.0"
},
"scripts": {
"test": "php convert.php tests/test.php tests/test.rst"
}
}
13 changes: 12 additions & 1 deletion convert.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,18 @@
$fullDocBlock = $phpdoc->getSummary();
$longDescription = $phpdoc->getDescription()->render();
if ($longDescription !== '') {
$fullDocBlock .= "\n\n" . $longDescription;
if (str_ends_with($fullDocBlock, '::') && !str_starts_with($longDescription, '-')) {
$fullDocBlock .= "\n\n " . $longDescription;
} else {
$fullDocBlock .= "\n\n" . $longDescription;
}
}

$deprecated = $phpdoc->getTagsByName('deprecated');
if ($deprecated) {
foreach ($deprecated as $deprecation) {
$fullDocBlock .= "\n\n.. deprecated:: " . str_replace("\n", ' ', $deprecation);
}
}

$fullDocBlock = formatBlocks($fullDocBlock, 'WARNING', 'warning');
Expand Down
28 changes: 28 additions & 0 deletions tests/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,32 @@
* - /opt/bin
*/
'binary_search_paths' => [],

/**
* Code block
* directly after the summary::
*
* occ status
*/
'files_external_allow_create_new_local' => true,

/**
* Just a list::
*
* - Item 1
* - Item 2
* - Item 3
*/
'files_external_allow_create_new_local2' => true,

/**
* The salt used to hash all passwords, auto-generated by the Nextcloud
* installer. (There are also per-user salts.) If you lose this salt, you lose
* all your passwords. This example is for documentation only, and you should
* never use it.
*
* @deprecated 9.0.0 This salt is deprecated and only used for legacy-compatibility,
* developers should *NOT* use this value for anything nowadays.
*/
'passwordsalt' => '',
];
42 changes: 42 additions & 0 deletions tests/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,47 @@ Defaults to:
- /bin
- /opt/bin

files_external_allow_create_new_local
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


::

'files_external_allow_create_new_local' => true,

Code block
directly after the summary::

occ status

files_external_allow_create_new_local2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


::

'files_external_allow_create_new_local2' => true,

Just a list::

- Item 1
- Item 2
- Item 3

passwordsalt
^^^^^^^^^^^^


::

'passwordsalt' => '',

The salt used to hash all passwords, auto-generated by the Nextcloud
installer. (There are also per-user salts.) If you lose this salt, you lose
all your passwords. This example is for documentation only, and you should
never use it.

.. deprecated:: 9.0.0 This salt is deprecated and only used for legacy-compatibility, developers should *NOT* use this value for anything nowadays.

.. ALL_OTHER_SECTIONS_END
.. Generated content above. Don't change this.