|
| 1 | +# Contributing to the PHP_CodeSniffer documentation |
| 2 | + |
| 3 | +## PHP_CodeSniffer Wiki |
| 4 | + |
| 5 | +For now, the documentation for the PHP_CodeSniffer project is available via the [project Wiki](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki). |
| 6 | + |
| 7 | +### Contributing to the Wiki |
| 8 | + |
| 9 | +If you would like to improve the documentation: |
| 10 | +1. Fork this repo. |
| 11 | +2. Create a new branch off the `main` branch. |
| 12 | +3. Make your changes. The Wiki source files are in the `/wiki` subdirectory. |
| 13 | +4. Commit your changes with a meaningful commit message. |
| 14 | +5. Push your changes to your fork. |
| 15 | +6. Submit a pull request from your fork to this repository. |
| 16 | + |
| 17 | +When in doubt, open an issue first to discuss your change proposal. |
| 18 | + |
| 19 | +### How does the wiki get updated ? |
| 20 | + |
| 21 | +* The source of the Wiki was imported into this repository to maintain the commit history. |
| 22 | +* A [GitHub Actions workflow](https://github.com/PHPCSStandards/PHP_CodeSniffer-documentation/blob/main/.github/workflows/publish-wiki.yml) was added to automatically push changes made in the Wiki files to the upstream Wiki repo. |
| 23 | +* Prior to pushing the changes, the workflow will make various changes to the files: |
| 24 | + * Replace `<!-- START doctoc --> <!-- END doctoc -->` placeholders with a Table of Contents for the page in Markdown. |
| 25 | + * Replace `{{ .... }}` CLI output placeholders with actual CLI output. |
| 26 | + The code samples used for this can be found in the `build/wiki/code-samples` directory. |
| 27 | + |
| 28 | +### Guidelines |
| 29 | + |
| 30 | +* Always use fully qualified links. This ensures that the links will work when pages are viewed/edited in this repo, as well as when the pages are viewed from the PHPCS wiki. |
| 31 | + |
| 32 | + |
| 33 | +### Frequently Asked Questions |
| 34 | + |
| 35 | +#### Why not make the Wiki publicly editable ? |
| 36 | + |
| 37 | +Publicly editable Wiki pages for big projects get vandalized pretty often and we don't want to risk this type of vandalism leading to users getting incorrect information. |
| 38 | + |
| 39 | +As a secondary reason, there are parts of the wiki (especially the output examples) which were pretty out of date. |
| 40 | +By having the wiki source in this repo, it allows for automating certain updates which would otherwise have to be done manually. |
0 commit comments