Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readability.js API #11

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Add readability.js API #11

wants to merge 9 commits into from

Conversation

devinhalladay
Copy link
Owner

@devinhalladay devinhalladay commented Jun 2, 2022

Description

Adds support for rendering full article content for a given web article, fetched from Readwise highlight sources.

  • Adds a reader API route which returns a readability object via @mozilla/readability. This object includes stringified markup, as well as plain text.
  • Adds interweave, which renders the stringified markup, while parsing it to match a given array of highlights. Any highlight matched within the article will be wrapped in <span className='highlight' />

Type(s) of changes

  • Bug fix
  • New feature
  • Update to an existing feature

Motivation for PR

Enable reading full articles in Geologies, as well as one of the final steps before completing a functional version of the pinch interaction.

How Has This Been Tested?

Locally with various articles.

This feature does not work yet with any highlights sourced from PDFs.

Applicable screenshots

Follow-up PR

@vercel
Copy link

vercel bot commented Jun 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
geologies ✅ Ready (Inspect) Visit Preview Jun 3, 2022 at 5:46AM (UTC)

Comment on lines +31 to +34
const matcher: MatcherInterface<any> = {
inverseName: 'noMark',
propName: 'mark',
match(string): MatchResponse<any> {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Test this out

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.

1 participant