Skip to content

Commit 42dc48f

Browse files
committed
docs: add docs for markdownEnv
1 parent d6bf4b7 commit 42dc48f

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

docs/reference/node-api.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,22 @@ interface MarkdownLink {
536536

537537
- Details:
538538

539-
Links of the page.
539+
Links included in the page content.
540+
541+
### markdownEnv
542+
543+
- Type: `Record<string, unknown>`
544+
545+
- Details:
546+
547+
The `env` object when parsing markdown content with markdown-it.
548+
549+
Some markdown-it plugins may store extra information inside this object, and you can make use of them for advanced customization.
550+
551+
Notice that some other page properties are also extracted from the original `env` object. Those properties have already been removed from `page.markdownEnv`.
552+
553+
- Also see:
554+
- [markdown-it > API Documentation > MarkdownIt > parse](https://markdown-it.github.io/markdown-it/#MarkdownIt.parse)
540555

541556
### pathInferred
542557

docs/zh/reference/node-api.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,23 @@ interface MarkdownLink {
531531

532532
- 详情:
533533

534-
该 Page 中的链接。
534+
该 Page 内容中包含的链接。
535+
536+
537+
### markdownEnv
538+
539+
- 类型: `Record<string, unknown>`
540+
541+
- 详情:
542+
543+
在使用 markdown-it 解析 Markdown 内容时的 `env` 对象。
544+
545+
一些 markdown-it 插件可能会在这个对象中存储一些额外的信息,你可以使用它们来进行高级定制化。
546+
547+
需要注意的是,其他的一些 Page 属性其实也是从 `env` 对象中获取到的,但是我们已经把这些属性从 `page.markdownEnv` 中移除掉了。
548+
549+
- 参考:
550+
- [markdown-it > API Documentation > MarkdownIt > parse](https://markdown-it.github.io/markdown-it/#MarkdownIt.parse)
535551

536552
### pathInferred
537553

0 commit comments

Comments
 (0)