Skip to content

Commit 4401314

Browse files
zaq1tomojomei
authored andcommitted
docs: bruch up readme.md
1 parent f5fa1b2 commit 4401314

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,42 @@
11
# notionapi
2+
23
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/jomei/notionapi?label=go%20module)](https://github.com/jomei/notionapi/tags)
34
[![Go Reference](https://pkg.go.dev/badge/github.com/jomei/notionapi.svg)](https://pkg.go.dev/github.com/jomei/notionapi)
45
[![Test](https://github.com/jomei/notionapi/actions/workflows/test.yml/badge.svg)](https://github.com/jomei/notionapi/actions/workflows/test.yml)
56

6-
An API client for the [Notion API](https://developers.notion.com/) implemented in Golang
7+
This is a Golang implementation of an API client for the [Notion API](https://developers.notion.com/).
78

8-
# Supported APIs
9-
It supports all APIs for Notion API version `2022-06-28`
9+
## Supported APIs
1010

11-
# Installation
11+
It supports all APIs of the Notion API version `2022-06-28`.
1212

13+
## Installation
14+
15+
```bash
16+
go get github.com/jomei/notionapi
1317
```
14-
$ go get github.com/jomei/notionapi
15-
```
1618

17-
# Getting started
18-
Follow Notion’s [getting started guide](https://developers.notion.com/docs/getting-started) to obtain an Integration Token.
19+
## Usage
20+
21+
First, please follow the [Getting Started Guide](https://developers.notion.com/docs/getting-started) to obtain an integration token.
1922

20-
## Example
23+
### Initialization
2124

22-
Make a new `Client`
25+
Import this library and initialize the API client using the obtained integration token.
2326

2427
```go
2528
import "github.com/jomei/notionapi"
2629

27-
28-
client := notionapi.NewClient("your-integration-token")
30+
client := notionapi.NewClient("your_integration_token")
2931
```
30-
Then, use client's methods to retrieve or update your content
32+
33+
### Calling the API
34+
35+
You can use the methods of the initialized client to call the Notion API. Here is an example of how to retrieve a page:
3136

3237
```go
33-
page, err := client.Page.Get(context.Background(), "your-page-id")
38+
page, err := client.Page.Get(context.Background(), "your_page_id")
3439
if err != nil {
35-
// do something
40+
// Handle the error
3641
}
3742
```

0 commit comments

Comments
 (0)