Skip to content

Conversation

Ndpnt
Copy link
Member

@Ndpnt Ndpnt commented Sep 4, 2025

No description provided.

Copy link

netlify bot commented Sep 4, 2025

Deploy Preview for open-terms-archive-docs ready!

Name Link
🔨 Latest commit f5afdf7
🔍 Latest deploy log https://app.netlify.com/projects/open-terms-archive-docs/deploys/68c182901299d3000859ab80
😎 Deploy Preview https://deploy-preview-198--open-terms-archive-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines 28 to 31
- **Be specific**: Target only the noise you want to remove. Avoid broad selectors that might accidentally remove important content.
- **Be safe**: Ensure your filter doesn't accidentally remove important content. Always check that the generated version still contains the whole terms content.
- **Be idempotent**: Your filter should produce the same result even if run multiple times on its own output. This ensures consistency and prevents unexpected behavior.
- **Be efficient**: Use efficient DOM queries and avoid unnecessary operations. Process only the elements you need to modify.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not blocking, but examples would help to make it more concrete.

- **Be idempotent**: Your filter should produce the same result even if run multiple times on its own output. This ensures consistency and prevents unexpected behavior.
- **Be efficient**: Use efficient DOM queries and avoid unnecessary operations. Process only the elements you need to modify.

## When to use filters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why and When sections seems to be a little bit similar. I wonder if it could be grouped together.

- An existing terms declaration file
- Identified the noise you want to remove and ensure it cannot be removed with CSS selectors with the [`remove`]({{< relref "terms/reference/declaration/#ref-remove" >}}) property.

## Step 1: Check for built-in filters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll use a structure based on the principle that we most often use a built-in filter and optionally a custom filter, so I would put everything related to creating a custom filter on a dedicated how-to page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we currently do not have enough builtin filters to justify splitting into two pages

## Prerequisites

- An existing terms declaration file
- Identified the noise you want to remove and ensure it cannot be removed with CSS selectors with the [`remove`]({{< relref "terms/reference/declaration/#ref-remove" >}}) property.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will give an example of noise that will be filtered by removeQueryParams, the only built-in filter available at the moment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a tutorial, it's an how to guide, so the idea is not to learn but to apply concrete solution to a real word problem, so I'm not sure it is appropriate

Comment on lines 9 to 10
- **in-place**: they modify the document structure and content directly;
- **idempotent**: they return the same document structure and content even if run repeatedly on their own result.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like explanations.


```js
export [async] function filterName(document, documentDeclaration)
export [async] function filterName(document, [parameters])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not filterName(document, parameters, documentDeclaration) as it is written in the How to apply filters ?

@Ndpnt Ndpnt merged commit 15ee83c into main Sep 10, 2025
5 checks passed
@Ndpnt Ndpnt deleted the filters branch September 10, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants