Skip to content

Commit f9c1250

Browse files
committed
add symbol documentation
1 parent 955c0ec commit f9c1250

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ The implementation aims to be the same and it keeps the same test set to ensure
2929

3030
## Installation
3131

32-
`cheer-reader` is available on npm:
32+
`cheer-reader` is available on jsr:
3333

3434
```bash
35-
npm install cheer-reader
35+
npx jsr add @paoramen/cheer-reader
3636
```
3737

3838
## Basic usage

src/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type Options = {
9898
baseURI?: string
9999
}
100100

101-
export type Metadata = {
101+
type Metadata = {
102102
title?: string | null
103103
byline?: string | null
104104
excerpt?: string | null
@@ -107,6 +107,12 @@ export type Metadata = {
107107
datePublished?: string | null
108108
}
109109

110+
/**
111+
* The object that `parse` returns.
112+
*
113+
* It contains some metadata, and if the `extraction` option is set to `true` (default),
114+
* it also contains the extracted content.
115+
*/
110116
export type ReadabilityResult = {
111117
title: string | null
112118
byline: string | null
@@ -138,6 +144,12 @@ type Candidate = Element & {
138144
contentScore: number
139145
}
140146

147+
/**
148+
* Readability is the main class of the library.
149+
*
150+
* It exposes a single method, `parse`, which takes an HTML string and returns
151+
* an object containing the extracted content.
152+
*/
141153
export class Readability {
142154
private $: CheerioAPI
143155
private options: Options

0 commit comments

Comments
 (0)