Skip to content
 
 

Repository files navigation

Readability

A Swift library that wraps @mozilla/readability and generalizes the Firefox Reader, which enhances web pages for better reading. This library provides a seamless way to detect, parse, and display reader-friendly content from any web page by integrating with WKWebView. Forked from Ryu0118/swift-readability to remove UI components.

Features

Requirements

  • Swift: 6.0 or later
  • Xcode: 16.0 or later

Installation

swift-readability is available via the Swift Package Manager

.package(url: "https://github.com/git-shawn/swift-readability", exact: "0.1.1")

Usage

Parsing

You can parse an article either from a URL or directly from an HTML string.

Parsing from a URL:

import Readability

let readability = Readability()
let result = try await readability.parse(url: URL(string: "https://example.com/article")!)

Parsing from an HTML string:

import Readability

let html = """
<html>
    <!-- Your HTML content here -->
</html>
"""
let result = try await readability.parse(html: html)

About

🌐 A Swift library that wraps @mozilla/readability and generalizes the Firefox Reader, which enhances web pages for better reading.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages