Filters
Overview
You can use the API to configure which HTML elements should be included or excluded from audio generation.
For example, if you want to exclude <h2>
subheadings from audio generation, you can add a filter to do so.
Example
To make HTML filters as flexible as possible, you can define them based on the following:
element_type
:<H2>
,<blockquote>
,<ul>
,<table>
etc.element_class
:.header
,.footer
,.aside
etc.element_id
:#advert
,#related
,#navigation
etc.element_data
:data-include
,data-exclude
etc.element_xpath
://\*[@role='dialog']
etc.value
: “Sponsored” etc
You can also combine attributes to create more targeted filters. For example, to exclude only <h3>
subheadings with the class “header” that contain the word “title”:
Example
Note: Other than with element_xpath
, when specifying elements, classes, or other HTML attributes, provide only the name or identifier. Do not include prefix characters such as <, ., #, or any other syntax.