Skip to content

Commit 925708d

Browse files
Set API documentation titles from h3 to h4 in README.md
They simply take up too much space. Updated API documentation via ``` ./build/generate-docs ```
1 parent 7a2c550 commit 925708d

3 files changed

Lines changed: 38 additions & 38 deletions

File tree

README.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -83,127 +83,127 @@ See the [demo.php](demo.php) file for a working example.
8383
The following is an incomplete list, containing only the most common methods.
8484
For a complete documentation of all classes, read the generated [PHPDoc](doc).
8585

86-
### public __construct($language = 'en', string|Hyphen $hyphen = null)
86+
#### public __construct($language = 'en', string|Hyphen $hyphen = null)
8787

8888
Create a new Syllable class, with defaults.
8989

90-
### public static setCacheDir(string $dir)
90+
#### public static setCacheDir(string $dir)
9191

9292
Set the directory where compiled language files may be stored.
9393
Default to the `cache` subdirectory of the current directory.
9494

95-
### public static setEncoding(string|null $encoding = null)
95+
#### public static setEncoding(string|null $encoding = null)
9696

9797
Set the character encoding to use.
9898
Specify `null` encoding to not apply any encoding at all.
9999

100-
### public static setLanguageDir(string $dir)
100+
#### public static setLanguageDir(string $dir)
101101

102102
Set the directory where language source files can be found.
103103
Default to the `languages` subdirectory of the current directory.
104104

105-
### public setLanguage(string $language)
105+
#### public setLanguage(string $language)
106106

107107
Set the language whose rules will be used for hyphenation.
108108

109-
### public setHyphen(mixed $hyphen)
109+
#### public setHyphen(mixed $hyphen)
110110

111111
Set the hyphen text or object to use as a hyphen marker.
112112

113-
### public getHyphen(): Hyphen
113+
#### public getHyphen(): Hyphen
114114

115115
Get the current hyphen object.
116116

117-
### public setCache(Cache $cache = null)
117+
#### public setCache(Cache $cache = null)
118118

119-
### public getCache(): Cache
119+
#### public getCache(): Cache
120120

121-
### public setSource($source)
121+
#### public setSource($source)
122122

123-
### public getSource(): Source
123+
#### public getSource(): Source
124124

125-
### public setMinWordLength(int $length = 0)
125+
#### public setMinWordLength(int $length = 0)
126126

127127
Words need to contain at least this many character to be hyphenated.
128128

129-
### public getMinWordLength(): int
129+
#### public getMinWordLength(): int
130130

131-
### public setLibxmlOptions(int $libxmlOptions)
131+
#### public setLibxmlOptions(int $libxmlOptions)
132132

133133
Options to use for HTML parsing by libxml.
134134
See https://www.php.net/manual/de/libxml.constants.php.
135135

136-
### public excludeAll()
136+
#### public excludeAll()
137137

138138
Exclude all elements.
139139

140-
### public excludeElement(string|string[] $elements)
140+
#### public excludeElement(string|string[] $elements)
141141

142142
Add one or more elements to exclude from HTML.
143143

144-
### public excludeAttribute(string|string[] $attributes, $value = null)
144+
#### public excludeAttribute(string|string[] $attributes, $value = null)
145145

146146
Add one or more elements with attributes to exclude from HTML.
147147

148-
### public excludeXpath(string|string[] $queries)
148+
#### public excludeXpath(string|string[] $queries)
149149

150150
Add one or more xpath queries to exclude from HTML.
151151

152-
### public includeElement(string|string[] $elements)
152+
#### public includeElement(string|string[] $elements)
153153

154154
Add one or more elements to include from HTML.
155155

156-
### public includeAttribute(string|string[] $attributes, $value = null)
156+
#### public includeAttribute(string|string[] $attributes, $value = null)
157157

158158
Add one or more elements with attributes to include from HTML.
159159

160-
### public includeXpath(string|string[] $queries)
160+
#### public includeXpath(string|string[] $queries)
161161

162162
Add one or more xpath queries to include from HTML.
163163

164-
### public splitWord(string $word): array
164+
#### public splitWord(string $word): array
165165

166166
Split a single word on where the hyphenation would go.
167167
Punctuation is not supported, only simple words. For parsing whole sentences
168168
please use Syllable::splitWords() or Syllable::splitText().
169169

170-
### public splitWords(string $text): array
170+
#### public splitWords(string $text): array
171171

172172
Split a text into an array of punctuation marks and words,
173173
splitting each word on where the hyphenation would go.
174174

175-
### public splitText(string $text): array
175+
#### public splitText(string $text): array
176176

177177
Split a text on where the hyphenation would go.
178178

179-
### public hyphenateWord(string $word): string
179+
#### public hyphenateWord(string $word): string
180180

181181
Hyphenate a single word.
182182

183-
### public hyphenateText(string $text): string
183+
#### public hyphenateText(string $text): string
184184

185185
Hyphenate all words in the plain text.
186186

187-
### public hyphenateHtml(string $html): string
187+
#### public hyphenateHtml(string $html): string
188188

189189
Hyphenate all readable text in the HTML, excluding HTML tags and
190190
attributes.
191191

192-
### public histogramText(string $text): array
192+
#### public histogramText(string $text): array
193193

194194
Count the number of syllables in the text and return a map with
195195
syllable count as key and number of words for that syllable count as
196196
the value.
197197

198-
### public countWordsText(string $text): int
198+
#### public countWordsText(string $text): int
199199

200200
Count the number of words in the text.
201201

202-
### public countSyllablesText(string $text): int
202+
#### public countSyllablesText(string $text): int
203203

204204
Count the number of syllables in the text.
205205

206-
### public countPolysyllablesText(string $text): int
206+
#### public countPolysyllablesText(string $text): int
207207

208208
Count the number of polysyllables in the text.
209209

build/classes/DocumentationManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ protected function updateReadme()
143143

144144
$apiDocumentation = '';
145145
foreach ($apiMethods as $method) {
146-
$apiDocumentation .= '### '.$method['signature']."\n\n";
146+
$apiDocumentation .= '#### '.$method['signature']."\n\n";
147147
$apiDocumentation .= $method['comment'] !== '' ? $method['comment']."\n\n" : '';
148148
}
149149

150150
$readme = file_get_contents($this->readmeFile);
151-
$apiDocumentationStart = strpos($readme, '###', strpos($readme, "`Syllable` class reference\n--------------------------"));
151+
$apiDocumentationStart = strpos($readme, '####', strpos($readme, "`Syllable` class reference\n--------------------------"));
152152
$apiDocumentationEnd = strpos($readme, "Development\n-----------", $apiDocumentationStart);
153153
$apiDocumentationLength = $apiDocumentationEnd - $apiDocumentationStart;
154154
$apiDocumentationOld = '';

tests/build/DocumentationManagerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function delegateSucceeds()
4747
The following is an incomplete list, containing only the most common methods.
4848
For a complete documentation of all classes, read the generated [PHPDoc](doc).
4949
50-
### public setMethods(array $methods = [])
50+
#### public setMethods(array $methods = [])
5151
5252
..
5353
@@ -62,16 +62,16 @@ public function delegateSucceeds()
6262
The following is an incomplete list, containing only the most common methods.
6363
For a complete documentation of all classes, read the generated [PHPDoc](doc).
6464
65-
### public setMethods(array $methods = [])
65+
#### public setMethods(array $methods = [])
6666
6767
The public setter method.
6868
See https://github.com/vanderlee/phpSyllable/blob/master/tests/build/ReflectionFixture.php.
6969
70-
### public getMethods(): array
70+
#### public getMethods(): array
7171
7272
The public getter method.
7373
74-
### public static getParameters(): array
74+
#### public static getParameters(): array
7575
7676
The public static method.
7777
@@ -104,7 +104,7 @@ public function delegateFailsIfReadmeFormatChanges()
104104
The following is an incomplete list, containing only the most common methods.
105105
For a complete documentation of all classes, read the generated [PHPDoc](doc).
106106
107-
### public setMethods(array $methods = [])
107+
#### public setMethods(array $methods = [])
108108
109109
..
110110

0 commit comments

Comments
 (0)