2023-02-19 15:30:44 +08:00
|
|
|
# Generating Source Code Documentation
|
|
|
|
|
|
|
|
## Generating PHP documentation
|
2015-08-16 21:55:31 +08:00
|
|
|
|
|
|
|
In order to generate the documentation, you will need to install the following
|
|
|
|
packages and its dependencies:
|
|
|
|
* phpdoc
|
|
|
|
* graphviz
|
|
|
|
|
2016-08-22 16:58:01 +08:00
|
|
|
Details about
|
|
|
|
[installing phpDocumentor](https://phpdoc.org/docs/latest/getting-started/installing.html)
|
|
|
|
can be found in that projects documentation.
|
2015-08-16 21:55:31 +08:00
|
|
|
|
|
|
|
Example for Debian and Ubuntu:
|
2016-07-03 23:45:37 +08:00
|
|
|
```console
|
2017-01-14 22:29:12 +08:00
|
|
|
$ sudo apt install php-pear graphviz
|
2016-07-03 23:45:37 +08:00
|
|
|
$ sudo pear channel-discover pear.phpdoc.org
|
|
|
|
$ sudo pear install phpdoc/phpDocumentor
|
|
|
|
```
|
2015-08-16 21:55:31 +08:00
|
|
|
|
|
|
|
To generate the documentation, change into the main directory and run phpdoc:
|
2016-07-03 23:45:37 +08:00
|
|
|
```console
|
2016-07-11 17:58:15 +08:00
|
|
|
$ cd PrivateBin
|
2023-12-03 20:54:35 +08:00
|
|
|
$ phpdoc --visibility=public,protected,private --target=doc/phpdoc --directory=lib/
|
2016-07-03 23:45:37 +08:00
|
|
|
```
|
2016-08-22 16:58:01 +08:00
|
|
|
|
|
|
|
**Note:** When used with PHP 7, the prerelease of phpDocumentator 2.9 needs to be
|
|
|
|
manually installed by downloading it from
|
|
|
|
[GitHub](https://github.com/phpDocumentor/phpDocumentor2/releases/download/v2.9.0/phpDocumentor.phar)
|
|
|
|
and then manually moving it to e.g. `/usr/local/bin` and making it executable.
|
2017-01-14 22:29:12 +08:00
|
|
|
|
2023-02-19 15:30:44 +08:00
|
|
|
## Generating JS documentation
|
2017-01-14 22:29:12 +08:00
|
|
|
|
|
|
|
In order to generate the documentation, you will need to install the following
|
|
|
|
packages and its dependencies:
|
|
|
|
* npm
|
|
|
|
|
|
|
|
Then you can use the node package manager to install the latest stable release
|
|
|
|
of jsdoc globally:
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ npm install -g jsdoc
|
|
|
|
```
|
|
|
|
|
|
|
|
Example for Debian and Ubuntu, including steps to allow current user to install
|
|
|
|
node modules globally:
|
|
|
|
```console
|
|
|
|
$ sudo apt install npm
|
|
|
|
$ sudo mkdir /usr/local/lib/node_modules
|
|
|
|
$ sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
|
|
|
|
$ npm install -g jsdoc
|
|
|
|
$ ln -s /usr/bin/nodejs /usr/local/bin/node
|
|
|
|
```
|
|
|
|
|
|
|
|
To generate the documentation, change into the main directory and run phpdoc:
|
|
|
|
```console
|
|
|
|
$ cd PrivateBin
|
2019-09-23 03:18:19 +08:00
|
|
|
$ jsdoc -p -d doc/jsdoc js/privatebin.js js/legacy.js
|
2017-01-14 22:29:12 +08:00
|
|
|
```
|