Check whether citations and[^N]definitions in Markdown[^N]:match, identifying orphan citations and unused definitions.
Parse YAML front matter (including---delimiters), check required fields for completeness and valid values according to the selected template.
Comma-separated field names
Use the Mermaid v11 parsing engine to perform syntax validation on diagram code, accurately detecting structural errors in nodes, connections, subgraphs, etc.
Perform full-dimensional statistics on Markdown text: total word count, line count, number of code blocks, number of Mermaid diagrams, and heading level distribution.
Why Choose Our Markdown Content Quality Check Toolbox?
In 2026, Markdown remains the absolute mainstream format for technical writing and open-source documentation collaboration. However, as document scale expands—especially forHLD (High-Level Design) HandbooksandDSA (Data Structures & Algorithms) Handbooks—hundreds of pages of technical books—manually maintaining citation integrity, YAML front matter consistency, and the syntactic correctness of embedded diagrams becomes extremely challenging. This toolbox is anall-in-one offline check suitedesigned to solve these pain points, faithfully replicating validation tasks that previously required multiple CLI scripts (such ascheck-citations.mjs,check-frontmatter.mjs,check-mermaid.mjs,content-stats.mjs) into a graphical tool that runs directly in the browser.
Core Application Scenarios
- Technical Books / Open-Source Documentation Collaboration: Quickly check footnote citations
[^N]and definitions[^N]:for pairing before merging PRs, eliminating orphan citations or unused definitions to enhance document rigor. - Batch YAML Front Matter Validation: Suitable for static site generators like Hexo, Hugo, VuePress, and Docusaurus, ensuring fields such as
title,description,date_updatedare complete in every article, and can validate professional fields likepart,module,difficulty,languagesaccording to HLD/DSA handbook templates. - Real-time Mermaid Diagram Syntax Detection: Before embedding diagrams into documents, use the Mermaid v11 parsing engine to catch syntax errors early, preventing rendering failures and improving collaboration efficiency.
- Content Health Statistics: Quickly obtain total word count, number of code blocks, number of Mermaid diagrams, and heading level distribution for a document, providing data support for writing progress tracking and content restructuring.
Underlying Algorithm Principles
Citation CheckUses regex scanning: match line by line/^\[\^(\d+)\]:/to extract the definition set, then match non-definition lines/\[\^(\d+)\]/gto extract the citation set, and finally use set difference operations to obtain "orphan citations" and "unused definitions." The entire algorithm has a time complexity of O(N) and supports documents of any size.
Frontmatter ValidationRelies on thejs-yamllibrary to parse YAML text into JavaScript objects, then checks each required field for existence and non-emptiness according to the selected template's field list, while also performing enumeration or format validation on fields likedifficulty,part,module.
Mermaid ValidationDirectly calls themermaid.parse()method of the official Mermaid parser, which includes built-in lexical analysis, syntax analysis, and semantic checks, accurately reporting line numbers and error types.
Content StatisticsCombines regex and traversal to separately count total word count (split by whitespace), total line count, number of code fences (```), number of Mermaid fences, and the count of H1 to H6 headings.
Frequently Asked Questions (FAQ)
- Q: My Markdown has multiple
[^1]citations but only one definition. Can the tool detect this?Yes. The tool separately counts the citation set and the definition set, and any number with "a citation but no definition" or "a definition but no citation" will be accurately listed. - Q: What is the difference between the "HLD Handbook" and "DSA Handbook" YAML validation templates?The HLD template focuses on fields like
part,module,difficulty,prerequisitessuitable for high-level design books; the DSA template additionally requiresslug,chapter,languages, andcanonical_test, better fitting the structure of algorithm tutorials. - Q: Does Mermaid validation support all diagram types?Yes. The tool uses the official Mermaid v11 parser, supporting all built-in types such as flowchart, sequence diagram, class diagram, state diagram, gantt, pie, and ER diagram.
- Q: Does the "code block" count in the statistics include Mermaid code blocks?The statistics count "Mermaid diagrams" and "regular code blocks" separately, making it easy to understand the proportion of code examples versus diagrams.
3 Major Advantages Over Similar Software
- 1. Vertically Integrated Functionality, All-in-One Page: Unlike scattered CLI tools or online checkers covering only a single dimension, this toolbox integrates four high-frequency needs—citation validation, YAML validation, Mermaid detection, and content statistics—into a single-file page, eliminating the need to switch tools or remember multiple commands.
- 2. 100% Faithful Reproduction of Original Project Core Logic: All validation algorithms are directly ported from
check-citations.mjs,check-frontmatter.mjs,check-mermaid.mjs, andcontent-stats.mjs, retaining the original professional field validation rules for HLD/DSA handbooks while providing a general template for broader documentation scenarios. - 3. Zero Deployment, Zero Dependency Installation, Ready to Use: The entire tool is a complete single-file HTML, loading Tailwind, js-yaml, and the Mermaid engine via CDN, requiring no Node.js, npm, or any backend service. Whether locally or on an intranet, double-click or drag it into a browser to start working, with zero intrusion into the writing and review workflow.
This toolbox is rebuilt based on the script toolchain of the open-source projectHLD / DSA Handbook, licensed under the MIT License. Version: 2026.03