返回 Skill 列表
extension
分类: 开发与工程无需 API Key

libdoc

libdoc - 文档构建和服务工具。build函数使用Mustache模板从Markdown生成静态站点。serve函数提供本地开发服务器。parseFrontMatter从markdown文件中提取YAML元数据。用于生成文档网站和本地服务文档。

person作者: jakexiaohubgithub

libdoc Skill

When to Use

  • Building static documentation sites from markdown
  • Serving documentation locally during development
  • Parsing YAML front matter from markdown files
  • Generating HTML from markdown with templates

Key Concepts

build: Processes markdown files with front matter, applies Mustache templates, and outputs static HTML.

serve: Local development server with live reload for documentation preview.

parseFrontMatter: Extracts YAML metadata from markdown file headers.

Usage Patterns

Pattern 1: Build documentation

import { build } from "@copilot-ld/libdoc";

await build({
  srcDir: "docs",
  outDir: "public",
  template: "template.html.mustache",
});

Pattern 2: Parse front matter

import { parseFrontMatter } from "@copilot-ld/libdoc";

const { data, content } = parseFrontMatter(markdownContent);
console.log(data.title); // From YAML header

Integration

Used by make docs to build the documentation site. Output served via static file hosting.