normalizeFrontmatterSource #

如果源码的 frontmatter 是一个 JSON 对象,就把它改写成 Markdown 流水线能读的 frontmatter 形式。其他源码原样返回。

用法 #

TypeScript
import { 
normalizeFrontmatterSource
} from 'kawapress'
const
md
=
normalizeFrontmatterSource
('{"title":"Hi"}\n\n# Hi')

参数

sourcestring

页面的 Markdown 源码。

返回值 带有 YAML 风格 --- frontmatter 的源码。

完整类型签名
TypeScript
function normalizeFrontmatterSource(source: string): string

编辑此页

评论