readMarkdownSource #

读取一个 Markdown 页面,并展开它的 include 和代码片段。

用法 #

TypeScript
import { 
readMarkdownSource
} from 'kawapress/generator'
const
page
=
readMarkdownSource
({
file
: '/site/a.md',
sourceRoot
: '/site',
})

参数

locationMarkdownSourceLocation

页面在哪里。

filestring

Markdown 文件的绝对路径。

sourceRootstring

源码目录的绝对路径,@/ 开头的路径从这里算起。

返回值 展开后的源码,以及它读过的文件。

完整类型签名
TypeScript
function readMarkdownSource(location: MarkdownSourceLocation): ExpandedMarkdownSource

编辑此页

评论