Skip to content

feat: add reader mode to extract article content from web pages#2235

Open
zeshanziya wants to merge 2 commits into
microsoft:mainfrom
zeshanziya:feat/issue-2234
Open

feat: add reader mode to extract article content from web pages#2235
zeshanziya wants to merge 2 commits into
microsoft:mainfrom
zeshanziya:feat/issue-2234

Conversation

@zeshanziya

Copy link
Copy Markdown

Adds an optional reader mode that uses readability-lxml to extract the main article content from web pages, stripping navigation, sidebars, footers, and other boilerplate before converting to markdown.

Closes #2234

Changes

  • Added reader_mode kwarg to HtmlConverter.convert() (default False)
  • Added readability-lxml as an optional dependency under [readability] extra
  • Added -r / --reader-mode CLI flag
  • Added 4 tests covering reader mode on/off, missing dependency, and default behavior

Signed-off-by: zeshanziya <zeshan.aws@gmail.com>
@zeshanziya

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Signed-off-by: zeshanziya <zeshan.aws@gmail.com>
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.

Add reader mode for automatic article content extraction from web pages

1 participant