リッチテキストオブジェクト
リッチ テキスト オブジェクト
{
"type": "text",
"text": {
"content": "Some words ",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Some words ",
"href": null
}
分野 | タイプ | 説明 | 例の値 |
---|---|---|---|
type | string (列挙型) | このリッチ テキスト オブジェクトのタイプ。可能なタイプの値は次のとおりです。"text" "mention" "equation" | "text" |
text | |||
annotations | object | リッチ テキスト オブジェクトのスタイル設定に使用される情報。詳細については、以下の注釈オブジェクトのセクションを参照してください。 | 例については、以下の注釈オブジェクトのセクションを参照してください。 |
plain_text | string | 注釈なしのプレーン テキスト。 | "Some words " |
href | string (オプション) | このテキスト内のリンクまたは Notion に関する言及がある場合は、その URL。 | "https://www.notion.so/Avocado-d093f1d200464ce78b36e58a3f0d8043" |
注釈オブジェクト
annotations
オブジェクトが含まれています。annotations
には次のフィールドが含まれます。財産 | タイプ | 説明 | 例の値 |
---|---|---|---|
bold | boolean | テキストを太字にするかどうか。 | true |
italic | boolean | テキストを斜体にするかどうか。 | true |
strikethrough | boolean | テキストに取り消し線を引くかどうか。 | false |
underline | boolean | テキストに下線を付けるかどうか。 | false |
code | boolean | テキストがcode style かどうか。 | true |
color | string (列挙型) | テキストの色。 可能な値は次の とおりです。 -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "pink" "pink_background" "purple" "purple_background" "red" "red_background” "yellow" "yellow_background" | "green" |
リッチテキスト型オブジェクト
方程式
"equation"
タイプ値が のリッチ テキスト オブジェクトとしてインライン LaTeX 方程式をサポートします。対応の方程式タイプ オブジェクトには、次のものが含まれます。分野 | タイプ | 説明 | 例の値 |
---|---|---|---|
expression | string | インライン式を表す LaTeX 文字列。 | "\frac{{ - b \pm \sqrt {b^2 - 4ac} }}{{2a}}" |
リッチ テキストequation
オブジェクトの例
{
"type": "equation",
"equation": {
"expression": "E = mc^2"
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "E = mc^2",
"href": null
}
メンション(言及)
@
を入力すると、Notion UI にメンションが作成されます 。type
値が "mention"
の場合、対応のmention
オブジェクトには次のものが含まれます。分野 | タイプ | 説明 | 例の値 |
---|---|---|---|
type | string (列挙型) | インライン メンションのタイプ。可能な値は次のとおりです。 -"database" "date" "link_preview" "page" "template_mention" "user" | "user" |
database | date | link_preview | page |
データベース メンション タイプ オブジェクト
database
フィールド内のデータベース参照が含まれます 。 データベース参照は、id
キーとデータベース ID に対応するキーと文字列値 (UUIDv4)を持つオブジェクトです 。plain_text
値は "Untitled"
として表示され、注釈オブジェクトの値はデフォルトです。database
メンションのリッチ テキストmention
オブジェクトの例{
"type": "mention",
"mention": {
"type": "database",
"database": {
"id": "a1d8501e-1ac1-43e9-a6bd-ea9fe6c8822b"
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Database with test things",
"href": "https://www.notion.so/a1d8501e1ac143e9a6bdea9fe6c8822b"
}
日付言及型オブジェクト
date
フィールド内の 日付プロパティ値オブジェクトが含まれます 。mention
オブジェクトのdate
メンション例{
"type": "mention",
"mention": {
"type": "date",
"date": {
"start": "2022-12-16",
"end": null
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "2022-12-16",
"href": null
}
リンク プレビュー メンション タイプ オブジェクト
type
値がlink_preview
のリッチ テキスト オブジェクトとして処理します。リンク プレビューのリッチ テキスト メンションには、リンク プレビュー メンションの作成に使用される url
を含む対応するlink_preview
オブジェクトが含まれます。mention
オブジェクトのlink_preview
メンション例{
"type": "mention",
"mention": {
"type": "link_preview",
"link_preview": {
"url": "https://workspace.slack.com/archives/C04PF0F9QSD/z1671139297838409?thread_ts=1671139274.065079&cid=C03PF0F9QSD"
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "https://workspace.slack.com/archives/C04PF0F9QSD/z1671139297838409?thread_ts=1671139274.065079&cid=C03PF0F9QSD",
"href": "https://workspace.slack.com/archives/C04PF0F9QSD/z1671139297838409?thread_ts=1671139274.065079&cid=C03PF0F9QSD"
}
ページ メンション タイプ オブジェクト
page
フィールド内のページ参照が含まれます 。 ページ参照は、ページ ID に対応するid
プロパティと文字列値 (UUIDv4)を持つオブジェクトです 。plain_text
値は "Untitled"
として表示され、注釈オブジェクトの値はデフォルトです。mention
オブジェクトのpage
メンション例{
"type": "mention",
"mention": {
"type": "page",
"page": {
"id": "3c612f56-fdd0-4a30-a4d6-bda7d7426309"
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "This is a test page",
"href": "https://www.notion.so/3c612f56fdd04a30a4d6bda7d7426309"
}
テンプレート メンション タイプ オブジェクト
"template_mention_date"
または "template_mention_user"
のいずれ か のネストされた type
キーを 持つオtemplate_mention
ブジェクトが含まれます。type
キーが "template_mention_date"
の 場合 、リッチ テキスト オブジェクトには次のtemplate_mention_date
フィールドが含まれます。分野 | タイプ | 説明 | 例の値 |
---|---|---|---|
template_mention_date | string (列挙型) | 日付言及のタイプ。可能な値は 次のとおり です。"today" "now" | "today" |
mention
オブジェクトのtemplate_mention_date
メンション例{
"type": "mention",
"mention": {
"type": "template_mention",
"template_mention": {
"type": "template_mention_date",
"template_mention_date": "today"
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "@Today",
"href": null
}
"template_mention_user"
の場合 、リッチ テキスト オブジェクトには次のtemplate_mention_user
フィールドが含まれます。分野 | タイプ | 説明 | 例の値 |
---|---|---|---|
template_mention_user | string (列挙型) | ユーザー メンションのタイプ。可能な値は だけです 。"me" | "me" |
mention
オブジェクトのtemplate_mention_user
メンション例{
"type": "mention",
"mention": {
"type": "template_mention",
"template_mention": {
"type": "template_mention_user",
"template_mention_user": "me"
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "@Me",
"href": null
}
ユーザー メンション タイプ オブジェクト
type
値が "user"
の場合、対応するユーザー フィールドには ユーザー オブジェクトが含まれます。📘
インテグレーションがまだ前述のユーザーにアクセスできない場合、ユーザーの名前を含む plain_text
は"@Anonymous"
として読み取られます。ユーザーにアクセスできるように統合を更新するには、統合設定ページで統合機能を更新します。
mention
オブジェクトのuser
メンション例{
"type": "mention",
"mention": {
"type": "user",
"user": {
"object": "user",
"id": "b2e19928-b427-4aad-9a9d-fde65479b1d9"
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "@Anonymous",
"href": null
}
テキスト
type
値が"text"
の場合、対応するtext
フィールドには次のようなオブジェクトが含まれます。分野 | タイプ | 説明 | 例の値 |
---|---|---|---|
content | string | テキストの実際のテキスト コンテンツ。 | "Some words " |
link | object (オプション) | 含まれている場合、このテキスト内のインライン リンクに関する情報を含むオブジェクト。 テキストにインライン リンクが含まれている場合、オブジェクト キーは url で、値は URL の文字列 Web アドレスです。テキストにインライン リンクがない場合、値は null です。 | { "url": "https://developers.notion.com/" } |
リンクのないリッチ テキストtext
オブジェクトの例
{
"type": "text",
"text": {
"content": "This is an ",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "This is an ",
"href": null
}
リンク付きのリッチテキストtext
オブジェクトの例
{
"type": "text",
"text": {
"content": "inline link",
"link": {
"url": "https://developers.notion.com/"
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "inline link",
"href": "https://developers.notion.com/"
}
📘リッチ テキスト オブジェクトの制限
リッチ テキスト オブジェクトのサイズ制限については、リクエスト制限のドキュメント ページを参照してください。
更新日時 2023-04-28 07:47:42