Skip to content

Commit 1e346d8

Browse files
committed
Improve filter docs
1 parent 05292b1 commit 1e346d8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

content/terms/how-to/apply-filters.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ This guide explains how to apply filters to existing declarations to remove mean
1414

1515
## Step 1: Check for built-in filters
1616

17-
[Built-in filters]({{< relref "/terms/reference/built-in-filters" >}}) are pre-defined functions that handle common noise patterns. They're the easiest way to clean up content without writing custom code.
17+
Built-in filters are pre-defined functions that handle common noise patterns. They're the easiest way to clean up content without writing custom code.
1818

19-
Review the available built-in filters in the [filters reference]({{< relref "/terms/reference/built-in-filters" >}}) to find one that matches your needs.
19+
Review the available [built-in filters]({{< relref "/terms/reference/built-in-filters" >}}) to find if one matches your needs.
2020

2121
If you find a suitable built-in filter, proceed to [Step 2](#step-2-declare-the-filter), otherwise you will need to create a custom filter.
2222

@@ -33,7 +33,7 @@ Create a JavaScript file with the same name as your service declaration but with
3333
Define your filter function following this signature:
3434

3535
```js
36-
export function myCustomFilter(document, parameters, documentDeclaration) {
36+
export function myCustomFilter(document, [parameters]) {
3737
// Your filter logic here
3838
}
3939
```
@@ -42,7 +42,6 @@ export function myCustomFilter(document, parameters, documentDeclaration) {
4242

4343
- `document`: JSDOM document instance representing the web page
4444
- `parameters`: Values passed from the declaration (optional)
45-
- `documentDeclaration`: The complete declaration object (optional)
4645

4746
**Example: Remove session IDs from text content**
4847

content/terms/reference/filters.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export [async] function filterName(document, [parameters])
1818
Each filter is exposed as a named function export that takes a `document` parameter and behaves like the `document` object in a browser DOM.
1919
> The `document` parameter is actually a [JSDOM](https://github.com/jsdom/jsdom) document instance.
2020

21-
Filters can have parameters that are passed as second parameter.
22-
2321
These functions can be `async`, but they will still run sequentially.
2422

2523
## Usage

0 commit comments

Comments
 (0)