notion api support basic functions such as create page, db, text block
go get github.com/johnhaha/[email protected]
client := nose.NewPageClient("YOUR-TOKEN","PARENT-PAGE-ID")
client.NewEmptyPage("PAGE-NAME")
save Struct data to json, with nose tag
type Sample struct {
Title string `json:"title" nose:"title"`
Desc string `json:"desc" nose:"orange,bold"`
Count int `json:"count"`
Updated time.Time `json:"updated"`
CreatedAt time.Time `json:"createdAt"`
}
client.NewDB("DATABASE-NAME",Sample{})
only support text
client.AppendTextBlock("TEXT-CONTENT")
client.AppendTodoBlock("BLOCK-CONTENT")
client := nose.NewDBClient("YOUR-TOKEN","DATABASE-ID")
save struct data to database
client.SaveData(sample)
client := nose.NewPageClient("YOUR-TOKEN","PARENT-PAGE-ID")
dbClient := client.ToDB("DBID")
client := nose.NewDBClient("YOUR-TOKEN","DB-ID")
dbClient := client.ToPage("PAGE-ID")