Skip to content

Commit

Permalink
Move doc home to repository readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mariosimao committed Nov 3, 2021
1 parent a64c105 commit 73dd1ae
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 28 deletions.
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
[![Codecov](https://img.shields.io/codecov/c/github/mariosimao/notion-sdk)](https://app.codecov.io/gh/mariosimao/notion-sdk)
[![Type coverage](https://shepherd.dev/github/mariosimao/notion-sdk/coverage.svg)](https://shepherd.dev/github/mariosimao/notion-sdk)
[![Notion API version](https://img.shields.io/badge/API%20Version-2021--08--16-blue)](https://developers.notion.com/reference/versioning)
[![Notion API version](https://img.shields.io/badge/API%20Version-2021--08--16-blue)](https://developers.notion.com/reference/versioning)

# notion-sdk-php

A complete Notion SDK for PHP developers.
## Installation

```
composer require mariosimao/notion-php
```

## Getting started

A Notion token will be needed to fully use this library. If you don't have one,
please refer to [Authorization section](https://developers.notion.com/docs/authorization) from the [Notion API documentation](https://developers.notion.com/).

A simple example on how to create a page with some content:

```php
<?php

use Notion\Client;
use Notion\Blocks\Paragraph;
use Notion\Pages\Page;
use Notion\Pages\PageParent;

$token = getenv("NOTION_TOKEN");
$client = Client::create($token);

$parent = PageParent::page("c986d7b0-7051-4f18-b165-cc0b9503ffc2");
$page = Page::create($parent)
->withTitle("Sample page")
->withIcon("⭐");

$content = Paragraph::fromString("This is a simple paragraph.");

$client->pages()->create($page, $content);
```

## Documentation

Further documentation can be found [here](./docs/README.md).
31 changes: 4 additions & 27 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
# Documentation

## Installation
## Blocks

```
composer require mariosimao/notion-php
```

## Getting started

A Notion token will be needed to fully use this library. If you don't have one,
please refer to [Authorization section](https://developers.notion.com/docs/authorization) from the [Notion API documentation](https://developers.notion.com/).

A simple example on how to create a page with some content:

```php
<?php

$token = getenv("NOTION_TOKEN");
$client = \Notion\Client::create($token);

$parent = PageParent::page("c986d7b0-7051-4f18-b165-cc0b9503ffc2");
$page = Page::create($parent)
->withTitle("Sample page")
->withIcon("⭐");

$content = Paragraph::fromString("This is a simple paragraph.");

$client->pages()->create($page, $content);
```
- [Bookmark](./blocks/Bookmark.md)
- [Bulleted list item](./blocks/BulletedListItem.md)
- [Paragraph](./blocks/Paragraph.md)

0 comments on commit 73dd1ae

Please sign in to comment.