Skip to content

Commit 750526b

Browse files
committed
ADD TO: publish action / auto-generate table of contents
1 parent 16c790f commit 750526b

File tree

5 files changed

+14
-41
lines changed

5 files changed

+14
-41
lines changed

.github/workflows/publish-wiki.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,16 @@ jobs:
3535
- name: Checkout code
3636
uses: actions/checkout@v4
3737

38+
- name: Install DocToc table of contents generator
39+
run: npm install -g doctoc
40+
3841
- name: Copy wiki files to temporary location
3942
shell: bash
4043
run: cp -v -a wiki _wiki
4144

45+
- name: Update tables of contents
46+
run: doctoc ./_wiki/ --github --maxlevel 4 --update-only
47+
4248
- name: Deploy to wiki
4349
uses: Andrew-Chen-Wang/github-wiki-action@v4
4450
with:

wiki/About-Standards-for-PHP_CodeSniffer.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
## Table of contents
22

3-
* [A Project ruleset or a standard ?](#a-project-ruleset-or-a-standard-)
4-
* [How does PHP_CodeSniffer determine which standard or ruleset to apply ?](#how-does-php_codesniffer-determine-which-standard-or-ruleset-to-apply-)
5-
* [About standards](#about-standards)
6-
* [Creating an external standard for PHP_CodeSniffer](#creating-an-external-standard-for-php_codesniffer)
7-
* [Creating new rules](#creating-new-rules)
8-
* [Naming conventions](#naming-conventions)
9-
* [1. Directory structure](#1-directory-structure)
10-
* [2. Sniff file name](#2-sniff-file-name)
11-
* [3. Namespace and class name](#3-namespace-and-class-name)
12-
* [Examples](#examples)
3+
<!-- START doctoc -->
4+
<!-- END doctoc -->
135

146
***
157

wiki/Configuration-Options.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
11
## Table of contents
22

3-
* [Setting the default coding standard](#setting-the-default-coding-standard)
4-
* [Setting the default report format](#setting-the-default-report-format)
5-
* [Hiding warnings by default](#hiding-warnings-by-default)
6-
* [Showing progress by default](#showing-progress-by-default)
7-
* [Using colors in output by default](#using-colors-in-output-by-default)
8-
* [Changing the default severity levels](#changing-the-default-severity-levels)
9-
* [Setting the default report width](#setting-the-default-report-width)
10-
* [Setting the default encoding](#setting-the-default-encoding)
11-
* [Setting the default tab width](#setting-the-default-tab-width)
12-
* [Setting the installed standard paths](#setting-the-installed-standard-paths)
13-
* [Setting the PHP version](#setting-the-php-version)
14-
* [Ignoring errors when generating the exit code](#ignoring-errors-when-generating-the-exit-code)
15-
* [Ignoring warnings when generating the exit code](#ignoring-warnings-when-generating-the-exit-code)
16-
* [Ignoring non-auto-fixable issues when generating the exit code (PHP_CodeSniffer >= 4.0.0)](#ignoring-non-auto-fixable-issues-when-generating-the-exit-code-php_codesniffer--400)
17-
* Setting tool paths
18-
* [CSSLint](#setting-the-path-to-csslint)
19-
* [Google Closure Linter](#setting-the-path-to-the-google-closure-linter)
20-
* [PHP](#setting-the-path-to-php)
21-
* [JSHint](#setting-the-path-to-jshint)
22-
* [JSLint](#setting-the-path-to-jslint)
23-
* [JavaScript Lint](#setting-the-path-to-javascript-lint)
24-
* [Zend Code Analyzer](#setting-the-path-to-the-zend-code-analyzer)
3+
<!-- START doctoc -->
4+
<!-- END doctoc -->
255

266
***
277

wiki/FAQ.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
## Table of contents
22

3-
* [Does PHP_CodeSniffer perform any code coverage or unit testing?](#does-php_codesniffer-perform-any-code-coverage-or-unit-testing)
4-
* [My code is fine! Why do I need PHP_CodeSniffer?](#my-code-is-fine-why-do-i-need-php_codesniffer)
5-
* [Does PHP_CodeSniffer parse my code to ensure it will execute?](#does-php_codesniffer-parse-my-code-to-ensure-it-will-execute)
6-
* [I don't agree with your coding standards! Can I make PHP_CodeSniffer enforce my own?](#i-dont-agree-with-your-coding-standards-can-i-make-php_codesniffer-enforce-my-own)
7-
* [How come PHP_CodeSniffer reported errors, I fixed them, now I get even more?](#how-come-php_codesniffer-reported-errors-i-fixed-them-now-i-get-even-more)
8-
* [What does PHP_CodeSniffer use to tokenize my code?](#what-does-php_codesniffer-use-to-tokenize-my-code)
3+
<!-- START doctoc -->
4+
<!-- END doctoc -->
95

106
***
117

wiki/Fixing-Errors-Automatically.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
## Table of contents
22

3-
* [About Automatic Fixing](#about-automatic-fixing)
4-
* [Using the PHP Code Beautifier and Fixer](#using-the-php-code-beautifier-and-fixer)
5-
* [Viewing Debug Information](#viewing-debug-information)
3+
<!-- START doctoc -->
4+
<!-- END doctoc -->
65

76
***
87

0 commit comments

Comments
 (0)