refactor: replace markdown parser

- replace markdown-it with remark and rehype
- add bunch of markdown features
This commit is contained in:
Kim, Jimin 2023-07-10 10:56:09 +09:00
parent c0195e02fd
commit ae5ecaaccc
31 changed files with 912 additions and 247 deletions

View file

@ -6,7 +6,7 @@ import { PostData } from "../types/types"
import { writeToFile } from "../util"
import { DataToPass } from "."
export default function parsePost(data: DataToPass): void {
export default async function parsePost(data: DataToPass): Promise<void> {
const {
urlPath,
markdownRaw,
@ -70,7 +70,7 @@ export default function parsePost(data: DataToPass): void {
`${contentDirectoryPath}${urlPath}.json`,
JSON.stringify({
content: markdownData.content,
toc: generateToc(markdownRaw),
toc: await generateToc(markdownRaw),
})
)
}