Skip to content

Commit f203533

Browse files
committed
Updated documentation to correct grammar.
Renamed 'urlsmatch' option to 'urlskip'. Changed instances of Array() to [].
1 parent 281ad5e commit f203533

File tree

19 files changed

+95
-94
lines changed

19 files changed

+95
-94
lines changed

docs/api/attr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# attr()
22

3-
Retrieves the value of the requested attribute from the first item in an HTMLDoc collection.
3+
Retrieves the value of the requested attribute from the first item in an HTMLdoc collection.
44

55
```php
66
$doc = new \hexydec\html\htmldoc();

docs/api/construct.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ The options set into the object are setup for general use, but can be configured
1515

1616
| option | Description | Defaults |
1717
|---------------|---------------------------------------------------|-------------------------------|
18-
| `inline` | HTML elements that are considered inline | `Array('b', 'u', 'big', 'i', 'small', 'ttspan', 'em', 'a', 'strong', 'sub', 'sup', 'abbr', 'acronym', 'cite', 'code', 'dfn', 'em', 'kbd', 'strong', 'samp', 'var', 'span')` |
19-
| `singleton` | HTML elements that are singletons | `Array('area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr')` |
20-
| `closeoptional` | HTML elements that don't have to be closed | `Array('head', 'body', 'p', 'dt', 'dd', 'li', 'option', 'thead', 'th', 'tbody', 'tr', 'td', 'tfoot', 'colgroup')` |
21-
| `pre` | HTML elements that contain pre-formatted content | `Array('textarea', 'pre', 'code')` |
22-
| `plugins` | HTML elements that have a custom handler class | `Array('script', 'style')` |
18+
| `inline` | HTML elements that are considered inline | `['b', 'u', 'big', 'i', 'small', 'ttspan', 'em', 'a', 'strong', 'sub', 'sup', 'abbr', 'acronym', 'cite', 'code', 'dfn', 'em', 'kbd', 'strong', 'samp', 'var', 'span']` |
19+
| `singleton` | HTML elements that are singletons | `['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']` |
20+
| `closeoptional` | HTML elements that don't have to be closed | `['head', 'body', 'p', 'dt', 'dd', 'li', 'option', 'thead', 'th', 'tbody', 'tr', 'td', 'tfoot', 'colgroup']` |
21+
| `pre` | HTML elements that contain pre-formatted content | `['textarea', 'pre', 'code']` |
22+
| `plugins` | HTML elements that have a custom handler class | `['script', 'style']` |
2323

2424
#### `attributes`
2525

2626
| option | Description | Defaults |
2727
|---------------|---------------------------------------------------|-------------------------------|
28-
| `boolean` | HTML attributes that are boolean values | `Array('allowfullscreen', 'allowpaymentrequest', 'async', 'autofocus', 'autoplay', 'checked', 'contenteditable', 'controls', 'default', 'defer', 'disabled', 'formnovalidate', 'hidden', 'indeterminate', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'readonly', 'required', 'reversed', 'scoped', 'selected', 'typemustmatch')` |
29-
| `default` | Default attributes that can be removed | <code>Array(<br>&nbsp; &nbsp; 'style' => Array('type' => 'text/css'),<br>&nbsp; &nbsp; 'script' => Array('type' => 'text/javascript', 'language' => true),<br>&nbsp; &nbsp; 'form' => Array('method' => 'get'),<br>&nbsp; &nbsp; 'input' => Array('type' => 'text')<br>)</code> |
30-
| `empty` | Attributes to remove if empty | `Array('id', 'class', 'style', 'title')` |
31-
| `urls` | Attributes that contain urls | `Array('href', 'src', 'action', 'poster')` |
28+
| `boolean` | HTML attributes that are boolean values | `['allowfullscreen', 'allowpaymentrequest', 'async', 'autofocus', 'autoplay', 'checked', 'contenteditable', 'controls', 'default', 'defer', 'disabled', 'formnovalidate', 'hidden', 'indeterminate', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'readonly', 'required', 'reversed', 'scoped', 'selected', 'typemustmatch']` |
29+
| `default` | Default attributes that can be removed | <code>[<br>&nbsp; &nbsp; 'style' => ['type' => 'text/css'],<br>&nbsp; &nbsp; 'script' => ['type' => 'text/javascript', 'language' => true],<br>&nbsp; &nbsp; 'form' => ['method' => 'get'],<br>&nbsp; &nbsp; 'input' => ['type' => 'text']<br>]</code> |
30+
| `empty` | Attributes to remove if empty | `['id', 'class', 'style', 'title']` |
31+
| `urls` | Attributes that contain urls | `['href', 'src', 'action', 'poster']` |
32+
| `urlskip` | Skips compressing URLs if tag => attribute => value matches | <code>[<br>&nbsp; &nbsp; 'link' => [<br>&nbsp; &nbsp; &nbsp; &nbsp; 'rel' => ['stylesheet', 'icon', 'shortcut icon', 'apple-touch-icon-precomposed', 'apple-touch-icon', 'preload', 'prefetch', 'author', 'help']<br>&nbsp; &nbsp; ]<br>]</code> |
3233

3334
## Returns
3435

35-
A new HTMLDoc object.
36+
A new HTMLdoc object.

docs/api/eq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# eq()
22

3-
Builds a new HTMLDoc collection containing only the node at the index requested.
3+
Builds a new HTMLdoc collection containing only the node at the index requested.
44

55
```php
66
$doc = new \hexydec\html\htmldoc();
@@ -17,4 +17,4 @@ An integer indicating the zero based index of the element to return. A minus val
1717

1818
## Returns
1919

20-
An HTMLDoc collection containing the element at the index requested, or an empty HTMLDoc collection if the index is out of range.
20+
An HTMLdoc collection containing the element at the index requested, or an empty HTMLdoc collection if the index is out of range.

docs/api/find.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ $found = $doc->find('form a.button, form label.button');
4242
```
4343
## Returns
4444

45-
An HTMLDoc object containing the matched nodes, or an empty HTMLDoc collection if no matches were found.
45+
An HTMLdoc object containing the matched nodes, or an empty HTMLdoc collection if no matches were found.

docs/api/first.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# first()
22

3-
Returns a new HTMLDoc collection containing the first element in the collection.
3+
Returns a new HTMLdoc collection containing the first element in the collection.
44

55
## Returns
66

7-
An HTMLDoc collection containing the element the first element in the collection, or an empty HTMLDoc collection if the collection is empty.
7+
An HTMLdoc collection containing the element the first element in the collection, or an empty HTMLdoc collection if the collection is empty.

docs/api/last.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# last()
22

3-
Returns a new HTMLDoc collection containing the last element in the collection.
3+
Returns a new HTMLdoc collection containing the last element in the collection.
44

55
## Returns
66

7-
An HTMLDoc collection containing the element the last element in the collection, or an empty HTMLDoc collection if the collection is empty.
7+
An HTMLdoc collection containing the element the last element in the collection, or an empty HTMLdoc collection if the collection is empty.

docs/api/minify.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ An optional array contains a list of configuration parameters to configure the m
2929
<td>Boolean</td>
3030
<td></td>
3131
<td>Lowercase tag and attribute names</td>
32-
<td>true</td>
32+
<td><code>true</code></td>
3333
</tr>
3434
<tr>
3535
<td><code>whitespace</code></td>
3636
<td>Boolean</td>
3737
<td></td>
3838
<td>Strip whitespace from text nodes (Preserves whitespace between inline items defined in <code>htmldoc::$config['elements']['inline']</code>)</td>
39-
<td>true</td>
39+
<td><code>true</code></td>
4040
</tr>
4141
<tr>
4242
<td rowspan="2"><code>comments</code></td>
@@ -47,7 +47,7 @@ An optional array contains a list of configuration parameters to configure the m
4747
<tr>
4848
<td><code>ie</code></td>
4949
<td>Whether to preserve Internet Explorer specific comments</td>
50-
<td>true</td>
50+
<td><code>true</code></td>
5151
</tr>
5252
<tr>
5353
<td rowspan="5"><code>urls</code></td>
@@ -58,22 +58,22 @@ An optional array contains a list of configuration parameters to configure the m
5858
<tr>
5959
<td><code>scheme</code></td>
6060
<td>Remove the scheme from URLs that have the same scheme as the current document</td>
61-
<td>true</td>
61+
<td><code>true</code></td>
6262
</tr>
6363
<tr>
6464
<td><code>host</code></td>
6565
<td>Remove the host for own domain</td>
66-
<td>true</td>
66+
<td><code>true</code></td>
6767
</tr>
6868
<tr>
6969
<td><code>relative</code></td>
7070
<td>Process absolute URLs to make them relative to the current document</td>
71-
<td>true</td>
71+
<td><code>true</code></td>
7272
</tr>
7373
<tr>
7474
<td><code>parent</code></td>
7575
<td>Process relative URLs to use parent folders (<code>../</code>) where it is shorter</td>
76-
<td>true</td>
76+
<td><code>true</code></td>
7777
</tr>
7878
<tr>
7979
<td rowspan="8"><code>attributes</code></td>
@@ -84,65 +84,65 @@ An optional array contains a list of configuration parameters to configure the m
8484
<tr>
8585
<td><code>default</code></td>
8686
<td>Remove default attributes as defined in <code>htmldoc::$config['attributes']['default']</code></td>
87-
<td>true</td>
87+
<td><code>true</code></td>
8888
</tr>
8989
<tr>
9090
<td><code>empty</code></td>
9191
<td>Remove attributes with empty values, the attributes processed are defined in <code>htmldoc::$config['attributes']['empty']</code></td>
92-
<td>true</td>
92+
<td><code>true</code></td>
9393
</tr>
9494
<tr>
9595
<td><code>option</code></td>
9696
<td>Remove the <code>value</code> attribute from <code>option</code> tags where the text node has the same value</td>
97-
<td>true</td>
97+
<td><code>true</code></td>
9898
</tr>
9999
<tr>
100100
<td><code>style</code></td>
101101
<td>Remove whitespace and last semi-colon from the <code>style</code> attribute</td>
102-
<td>true</td>
102+
<td><code>true</code></td>
103103
</tr>
104104
<tr>
105105
<td><code>class</code></td>
106-
<td>Sort class names</td>
107-
<td>true</td>
106+
<td>Sort class names for better gzip compression</td>
107+
<td><code>true</code></td>
108108
</tr>
109109
<tr>
110110
<td><code>sort</code></td>
111-
<td>Sort attributes</td>
112-
<td>true</td>
111+
<td>Sort attributes for better gzip compression</td>
112+
<td><code>true</code></td>
113113
</tr>
114114
<tr>
115115
<td><code>boolean</code></td>
116116
<td>Minify boolean attributes to render only the attribute name and not the value. Boolean attributes are defined in <code>htmldoc::$config['attributes']['boolean']</code></td>
117-
<td>true</td>
117+
<td><code>true</code></td>
118118
</tr>
119119
<tr>
120120
<td><code>singleton</code></td>
121121
<td>Boolean</td>
122122
<td></td>
123123
<td>Removes spaces and slash in singleton attributes, e.g. <code>&lt;br /&gt;</code> becomes <code>&lt;br&gt;</code></td>
124-
<td>true</td>
124+
<td><code>true</code></td>
125125
</tr>
126126
<tr>
127127
<td><code>quotes</code></td>
128128
<td>Boolean</td>
129129
<td></td>
130130
<td>Removes quotes from attribute values where possible</td>
131-
<td>true</td>
131+
<td><code>true</code></td>
132132
</tr>
133133
<tr>
134134
<td><code>close</code></td>
135135
<td>Boolean</td>
136136
<td></td>
137-
<td>Removes closing tags for elements defined in `htmldoc::$config['elements']['closeoptional']` where possible</td>
138-
<td>true</td>
137+
<td>Removes closing tags for elements defined in <code>htmldoc::$config['elements']['closeoptional']</code> where possible</td>
138+
<td><code>true</code></td>
139139
</tr>
140140
<tr>
141141
<td><code>email</code></td>
142142
<td>Boolean</td>
143143
<td></td>
144144
<td>Sets the minification presets to email safe options</td>
145-
<td>false</td>
145+
<td><code>false</code></td>
146146
</tr>
147147
</tbody>
148148
</table>

docs/api/readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# HTMLDoc API Reference
1+
# HTMLdoc API Reference
22

3-
This document describes how to configure and use the HTMLDoc object.
3+
This document describes how to configure and use the HTMLdoc object.
44

55
| Method | Description |
66
|-----------------------------------|-------------------------------------------|
7-
| [__construct()](construct.md) | Constructs an HTMLDoc object |
7+
| [__construct()](construct.md) | Constructs an HTMLdoc object |
88
| [open()](open.md) | Open an HTML file from a URL or stream |
99
| [load()](load.md) | Load HTML from a strings |
1010
| [find()](find.md) | Find elements within the documents |
1111
| [eq()](eq.md) | Filter elements to the selected index |
1212
| [first()](first.md) | Filter elements by the first element |
1313
| [last()](last.md) | Filter elements by the last element |
1414
| [attr()](attr.md) | Retrieve the value of an attribute |
15-
| [text()](text.md) | Extract text from an HTMLDoc |
16-
| [minify()](minify.md) | Minify the HTMLDoc |
17-
| [html()](html.md) | Render the document as HTMLDoc |
15+
| [text()](text.md) | Extract text from an HTMLdoc |
16+
| [minify()](minify.md) | Minify the HTMLdoc |
17+
| [html()](html.md) | Render the document as HTMLdoc |
1818
| [save()](save.md) | Save as a file or output as a string |

docs/api/text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ if ($doc->load($html)) {
1111

1212
## Returns
1313

14-
A string containing the combined contents of the text nodes in an HTMLDoc collection.
14+
A string containing the combined contents of the text nodes in an HTMLdoc collection.

docs/how-it-works.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# HTMLDoc: How it works
1+
# HTMLdoc: How it works
22

33
Under the hood, the software processes are split into a number of stages:
44

0 commit comments

Comments
 (0)