Skip to content

Commit

Permalink
Add filter_roots to changelog, readme and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelo Gladding committed Dec 8, 2023
1 parent 34841b1 commit 0b1c219
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Below are the changes we have made in this release.
- Add option for exposing DOM for embedded properties (#208)
- Add srcset support (#209)
- Add language support (#210)
- Add option for filtering root class names (#211)
- Add option for metaformats support (#213)

### Changes
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ Use `expose_dom=True` to expose the DOM of embedded properties.
Use `metaformats=True` to include any [metaformats](https://microformats.org/wiki/metaformats)
found.

### `filter_roots`

Use `filter_roots=True` to filter known conflicting user names (e.g. Tailwind).
Otherwise provide a custom list to filter instead.

## Advanced Usage

`parse` is a convenience function for `Parser`. More sophisticated behaviors are
Expand Down
4 changes: 4 additions & 0 deletions mf2py/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def parse(
expose_dom (boolean): optional, expose the DOM of embedded properties.
metaformats (boolean): whether to include metaformats extracted from OGP
and Twitter card data: https://microformats.org/wiki/metaformats
filter_roots (boolean or list): optional, filter root class names. Use
True to filter known conflicting classes, otherwise filter given list.
Return: a json dict represented the structured data in this document.
"""
Expand Down Expand Up @@ -72,6 +74,8 @@ class Parser(object):
expose_dom (boolean): optional, expose the DOM of embedded properties.
metaformats (boolean): whether to include metaformats extracted from OGP
and Twitter card data: https://microformats.org/wiki/metaformats
filter_roots (boolean or list): optional, filter root class names. Use
True to filter known conflicting classes, otherwise filter given list.
Attributes:
useragent (string): the User-Agent string for the Parser
Expand Down

0 comments on commit 0b1c219

Please sign in to comment.