@44north/blog-utilities 中文文档教程
@44north/blog-utilities
一个包含许多小型实用程序的模块,可在使用博客时使用。
Install
npm install @44north/blog-utilities
或者
yarn add @44north/blog-utilities
generateHtmlFromJson
import { generateHtmlFromJson } from "@44north/blog-utilities";
const testJson = {
type: "doc",
content: [
{
type: "paragraph",
content: [
{
type: "text",
text: "Example "
},
{
type: "text",
marks: [
{
type: "bold"
}
],
text: "Text"
}
]
}
]
};
console.log(generateHtmlFromJson(testJson)); // -> <p>Example <strong>Text</strong></p>
@44north/blog-utilities
A Module containing a number of small utilities to use when working with blogs.
Install
npm install @44north/blog-utilities
or
yarn add @44north/blog-utilities
generateHtmlFromJson
import { generateHtmlFromJson } from "@44north/blog-utilities";
const testJson = {
type: "doc",
content: [
{
type: "paragraph",
content: [
{
type: "text",
text: "Example "
},
{
type: "text",
marks: [
{
type: "bold"
}
],
text: "Text"
}
]
}
]
};
console.log(generateHtmlFromJson(testJson)); // -> <p>Example <strong>Text</strong></p>