sectionize()

Bọc các nhóm tiêu đề trong phần tử `<section>`.

import { sectionize } from "@unifast/node";

Chữ ký

function sectionize(): UnifastPlugin

Tham số

Không có.

Cách dùng

import { compile, sectionize } from "@unifast/node";

const md = `# Introduction

Some introductory text.

## Getting Started

Instructions for getting started.

## Configuration

Configuration details here.`;

const result = compile(md, {
  plugins: [sectionize()],
});
// Each heading and its following content are wrapped in a <section> element

Ví dụ

Section tiêu đề