You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-7Lines changed: 34 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,37 +11,54 @@ A TypeScript library for generating **OPDS feeds** (v1.2) with a fluent API. Des
11
11
- Relative URL resolution to absolute URLs.
12
12
- Support for extra metadata / vendor-specific attributes.
13
13
- Output as pretty or compact XML.
14
-
- Helpers for common OPDS links (`self`, `start`).
14
+
- Parse from XML.
15
+
- Helpers for common OPDS links like navigation or acquisition.
15
16
16
17
## Installation
17
18
18
19
```bash
19
20
npm install opds-ts
20
21
```
21
22
23
+
## Importing
24
+
25
+
When importing make sure to use the right version. E.g.:
26
+
27
+
```ts
28
+
import { Feed, Entry } from'opds-ts/v1.2';
29
+
```
30
+
31
+
or
32
+
33
+
```ts
34
+
import*asopdsv2from'opds-ts/v2';
35
+
```
36
+
22
37
## Basic usage
23
38
24
-
This is an example on how to create a simple feed:
39
+
This is an example on how to create a simple v1.2 feed:
25
40
26
41
```ts
27
-
import { Feed } from'opds-ts';
28
-
import { Entry } from'opds-ts';
42
+
import { Feed, Entry } from'opds-ts/v1.2';
29
43
30
44
const baseUrl ='https://example.com';
31
45
32
46
const feed =newFeed('books', 'All Books')
33
47
.setLang('en')
34
48
.setAuthor('The Library of Babel')
35
49
.setKind('navigation')
36
-
.addSelfLink('/opds', 'navigation')
37
-
.addStartLink('/opds');
50
+
.addNavigationLink('start', '/opds');
38
51
39
52
const entry =newEntry('book:1', 'The Lord of the Rings')
40
53
.setAuthor('J. R. R. Tolkien')
41
54
.setSummary(
42
55
'A ring with mysterious powers lands in the hands of a young hobbit, Frodo. Under the guidance of Gandalf, a wizard, he and his three friends set out on a journey and land in the Elvish kingdom.'
Copy file name to clipboardExpand all lines: typedoc-readme.md
+34-7Lines changed: 34 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,37 +9,54 @@ A TypeScript library for generating **OPDS feeds** (v1.2) with a fluent API. Des
9
9
- Relative URL resolution to absolute URLs.
10
10
- Support for extra metadata / vendor-specific attributes.
11
11
- Output as pretty or compact XML.
12
-
- Helpers for common OPDS links (`self`, `start`).
12
+
- Parse from XML.
13
+
- Helpers for common OPDS links like navigation or acquisition.
13
14
14
15
## Installation
15
16
16
17
```bash
17
18
npm install opds-ts
18
19
```
19
20
21
+
## Importing
22
+
23
+
When importing make sure to use the right version. E.g.:
24
+
25
+
```ts
26
+
import { Feed, Entry } from'opds-ts/v1.2';
27
+
```
28
+
29
+
or
30
+
31
+
```ts
32
+
import*asopdsv2from'opds-ts/v2';
33
+
```
34
+
20
35
## Basic usage
21
36
22
-
This is an example on how to create a simple feed:
37
+
This is an example on how to create a simple v1.2 feed:
23
38
24
39
```ts
25
-
import { Feed } from'opds-ts';
26
-
import { Entry } from'opds-ts';
40
+
import { Feed, Entry } from'opds-ts/v1.2';
27
41
28
42
const baseUrl ='https://example.com';
29
43
30
44
const feed =newFeed('books', 'All Books')
31
45
.setLang('en')
32
46
.setAuthor('The Library of Babel')
33
47
.setKind('navigation')
34
-
.addSelfLink('/opds', 'navigation')
35
-
.addStartLink('/opds');
48
+
.addNavigationLink('start', '/opds');
36
49
37
50
const entry =newEntry('book:1', 'The Lord of the Rings')
38
51
.setAuthor('J. R. R. Tolkien')
39
52
.setSummary(
40
53
'A ring with mysterious powers lands in the hands of a young hobbit, Frodo. Under the guidance of Gandalf, a wizard, he and his three friends set out on a journey and land in the Elvish kingdom.'
0 commit comments