Skip to content

Commit 27c266f

Browse files
committed
feat: add docs
1 parent e7abfa8 commit 27c266f

File tree

2 files changed

+137
-1
lines changed

2 files changed

+137
-1
lines changed

DOCUMENTATION.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
## Documentation
2+
3+
This is the project's documentation, here you will find how to use the project.
4+
5+
### Common properties
6+
7+
Here is the list of the properties that are common between the three feed types (RSS, Atom, JSON).
8+
9+
- `title`: Ditto
10+
- `description`: Ditto
11+
- `link`: Ditto
12+
13+
#### Authors
14+
15+
The `authors` property is an array of authors, each author should have a `name` property, and optionally an `email` property and `link` property (the link can be any URL).
16+
17+
The required properties of an author are:
18+
19+
```typescript
20+
authors: [
21+
{
22+
name: "John Doe",
23+
}
24+
],
25+
```
26+
27+
### Atom
28+
29+
The additional properties for the Atom feed are:
30+
31+
#### Feed Options
32+
33+
- `id`: The unique identifier for the feed, usually a URL.
34+
35+
##### Extra Options
36+
37+
- `updated`: The last time the feed was updated. By default, it's the current time, but you can set it to any date.
38+
39+
- `generator`: The generator of the feed, by default it's `@feed/feed on JSR.io`, but you can set it to any string.
40+
41+
- `icon`: The icon of the feed, it should be a URL.
42+
43+
#### Item Options
44+
45+
##### Required
46+
47+
- `title`: Ditto, title of the item.
48+
- `link`: Ditto, link to the item.
49+
- `id`: Unique identifier for the item.
50+
- `summary`: Ditto, summary of the item.
51+
52+
##### Additional
53+
54+
###### Content
55+
56+
Ditto, the content of the item, it should be an object with a `body` property, and a `type` property.
57+
58+
```typescript
59+
content: {
60+
type: "html", // Optional, as if not provided, the type will be "text".
61+
body: "Content for Atom item 1", // Optional, as if not provided, the content will be the same as the summary.
62+
}
63+
```
64+
65+
###### Others
66+
67+
- `updated`: The last time the item was updated. If not provided, it will be the current time.
68+
69+
- `image`: The image of the item, it should be a URL.
70+
71+
### RSS
72+
73+
The additional properties for the RSS feed are:
74+
75+
#### Feed Options
76+
77+
**Note: All the properties are optional for the feed options.**
78+
79+
- `generator`: The generator of the feed, by default it's `@feed/feed on JSR.io`, but you can set it to any string.
80+
81+
- `icon`: The icon of the feed, it should be a URL.
82+
83+
- `feed`: The URL of the feed, it should be a URL.
84+
85+
- `language`: The language of the feed, by default it's `en-US`, but you can set it to any language code.
86+
87+
#### Item Options
88+
89+
##### Required
90+
91+
- `title`: Ditto, title of the item.
92+
- `link`: Ditto, link to the item.
93+
- `id`: Unique identifier for the item.
94+
- `description`: Ditto, summary of the item.
95+
96+
##### Additional
97+
98+
###### Content
99+
100+
Ditto, the content of the item, it should be an object with a `body` property, and a `type` property.
101+
102+
```typescript
103+
content: {
104+
type: "html", // Optional, as if not provided, the type will be "text".
105+
body: "Content for Atom item 1", // Optional, as if not provided, the content will be the same as the summary.
106+
}
107+
```
108+
109+
###### Others
110+
111+
- `image`: The image of the item, it should be a URL.
112+
113+
### JSON
114+
115+
The additional properties for the JSON feed are:
116+
117+
#### Feed Options
118+
119+
- `icon`: The icon of the feed, it should be a URL.
120+
121+
Optional properties:
122+
123+
- `feed`: The URL of the feed, it should be a URL.
124+
125+
- `updated`: The last time the feed was updated. By default, it's the current time, but you can set it to any date.
126+
127+
#### Item Options
128+
129+
- `id`: Unique identifier for the item.
130+
- `title`: Ditto, title of the item.
131+
- `url`: Ditto, link to the item.
132+
- `content_html`: The content of the item, it should be an HTML string.
133+
134+
Optional properties:
135+
136+
- `date_published`: The date the item was published. By default, it's the current time, but you can set it to any date.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Deno.writeTextFileSync("example.json", jsonFeed.build());
137137

138138
## Documentation
139139

140-
Docs is being written, and will be available soon.
140+
You can find the full documentation [here](/DOCUMENTATION.md).
141141

142142
## Know your rights
143143

0 commit comments

Comments
 (0)