markdown-engineer

Extend Markdown parsing with custom TOC generation and sanitized rendering.

Updated Jul 13, 2023
One-click install
npx skills add https://github.com/changgenglu/changgenglu-blog --skill markdown-engineer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: markdown-engineer
Source: https://github.com/changgenglu/changgenglu-blog/tree/main/.gemini/skills/markdown-engineer
Command: npx skills add https://github.com/changgenglu/changgenglu-blog --skill markdown-engineer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Markdown processing often suffers from brittle parsers, inconsistent TOC generation, and rendering gaps when extending Markdown workflows.

Core Features & Use Cases

  • Custom Markdown parser (markdownParser.js) with safe regex handling and fault tolerance for markers like <!-- TOC -->.
  • TOC generation based on H1-H6 hierarchy, with links converted to kebab-case and aligned with front-end anchors.
  • Rendering optimizations including code highlighting via highlight.js or prismjs and sanitization to prevent XSS.
  • Project conventions including TOC markers <!-- TOC --> and <!-- /TOC --> for navigation and using header-based lists as primary content indexing.

Quick Start

Extend your Markdown pipeline with a custom parser and TOC rules to improve parsing reliability.

Frequently Asked Questions about markdown-engineer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a table of contents from Markdown headers automatically?▼

Markdown TOC generation maps H1-H6 header hierarchies to kebab-case anchor links, placing navigation between <!-- TOC --> and <!-- /TOC --> markers. This ensures header-based lists align with front-end anchors for reliable content indexing.

What's the best way to prevent XSS when rendering Markdown to HTML?▼

Preventing XSS during Markdown rendering requires applying sanitization steps to the parsed output. This approach processes content through a custom parser with safe regex handling before rendering, ensuring safe output for CMS integrations.

How do I integrate code highlighting into a Markdown parsing workflow?▼

Markdown rendering workflows integrate code highlighting by routing code blocks through libraries like highlight.js or prismjs. A dedicated custom parser manages this integration, optimizing the rendering output for documentation tooling.

Why does my Markdown table of contents break when using custom parser extensions?▼

Markdown TOC generation often breaks due to brittle parsers lacking fault tolerance for custom markers. Using a dedicated parser file with safe regex handling ensures markers like <!-- TOC --> are processed reliably without parsing failures.

Can I use a custom Markdown parser for a CMS content authoring pipeline?▼

Custom Markdown parsers are designed for content authoring pipelines and CMS integrations. They extend Markdown workflows by specifying a frontmatter-driven approach with dedicated TOC rules, header-to-anchor mapping, and code highlighting integration.

Do I need frontmatter to manage Markdown TOC rules and header levels?▼

Frontmatter is used to drive Markdown processing conventions, specifying TOC rules and header levels for content indexing. This approach ensures header-to-anchor mapping and TOC marker behavior are consistently applied across documentation tooling.