Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFrankly committed Sep 13, 2024
2 parents 7ba3750 + 76d1658 commit 72e7959
Show file tree
Hide file tree
Showing 7 changed files with 598 additions and 345 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,15 +522,15 @@ The `block` object lets you create most supported block types while writing less

_Some block types will return a `null` if they are provided with invalid input. You should filter `null` entries out of your `children` array before adding it to an API call._

Each block type has a createBlock() method you can call, which takes an object containing properties specific to that block type. Most take an `rtArray`, which is an array of Rich Text objects you can easily create with `builtRichTextObj()`.
Each block type has a createBlock() method you can call, which takes an object containing properties specific to that block type. Most take `content`, which is an array of Rich Text objects you can easily create with `builtRichTextObj()`. You can also pass a single string or an array of strings in `content`, or just pass a string or array of strings as the sole argument. Notion-Helper will coerce strings to rich text objects where needed.

Examples:

```js
const headerText = "How to Play Guitar with Your Teeth";

const heading1 = NotionHelper.block.heading_1.createBlock({
rtArray: buildRichTextObj(headerText),
content: buildRichTextObj(headerText),
});
```

Expand Down
525 changes: 264 additions & 261 deletions docs/index.html

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,61 @@ import { setIcon } from "./emoji-and-files.mjs";
import { page_meta, page_props, parentDb, parentPage, pageId, blockId, propertyId, cover, icon, title, richText, checkbox, date, email, files, multiSelect, number, people, phoneNumber, relation, select, status, url } from "./page-meta.mjs";
import { quickPages, createNotion } from "./pages.mjs";

export {
buildRichTextObj,
makeParagraphBlocks,
block,
setIcon,
page_meta,
page_props,
quickPages,
createNotion,
parentDb,
parentPage,
pageId,
blockId,
propertyId,
cover,
icon,
title,
richText,
checkbox,
date,
email,
files,
multiSelect,
number,
people,
phoneNumber,
relation,
select,
status,
url,
bookmark,
bulletedListItem,
bullet,
callout,
code,
divider,
embed,
file,
heading1,
heading2,
heading3,
image,
numberedListItem,
num,
paragraph,
pdf,
quote,
table,
tableRow,
tableOfContents,
toDo,
toggle,
video
}

const NotionHelper = {
buildRichTextObj,
makeParagraphBlocks,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "notion-helper",
"description": "A library of functions for working more easily with the Notion API",
"version": "1.1.22",
"version": "1.1.28",
"type": "module",
"main": "index.mjs",
"devDependencies": {},
Expand Down
Loading

0 comments on commit 72e7959

Please sign in to comment.