Check Code Block Highlights

Validate hl_lines highlights in Markdown code blocks and report mismatches.

261|325|Updated Aug 27, 2020
One-click install
npx skills add https://github.com/nextflow-io/training --skill check-code-block-highlights
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Check Code Block Highlights
Source: https://github.com/nextflow-io/training/tree/main/.claude/skills/check-highlights
Command: npx skills add https://github.com/nextflow-io/training --skill check-code-block-highlights

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps authors and reviewers ensure that hl_lines attributes in Markdown code blocks correctly highlight intended lines, preventing misinterpretation of examples in documentation.

Core Features & Use Cases

  • Validate snippet-relative highlighting: hl_lines values are checked against the actual lines in the code block.
  • Detect off-by-one errors, including blank lines, and ensure headers or comments are not incorrectly highlighted.
  • Generate a concise report with suggested fixes for code blocks in Markdown documentation and tutorials.

Quick Start

Run the check-highlights skill on a sample.md file to verify all hl_lines highlight the intended snippet lines.

Frequently Asked Questions about Check Code Block Highlights

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

FAQPage Schema
How do I validate hl_lines highlights in markdown code blocks?

You can validate hl_lines highlights in markdown code blocks by running an automated check against the actual snippet lines to catch off-by-one errors. The verification ignores blank lines and reports mismatches with suggested corrections for documentation accuracy.

Why are my markdown code block highlights pointing to the wrong lines?

Markdown code block highlights often point to wrong lines due to off-by-one errors when blank lines are miscounted. Validating snippet-relative hl_lines values detects these mismatches and provides suggested fixes to correct the highlighting.

What is the best way to check code block highlighting accuracy in technical tutorials?

The best way to check code block highlighting accuracy in technical tutorials is to automate verification of hl_lines values against actual code snippet lines. This process detects incorrect highlights on headers or comments and generates a concise report with suggested fixes.

Does hl_lines validation work with documentation that includes blank lines in code blocks?

Yes, hl_lines validation works with documentation containing blank lines in code blocks. The validation process specifically ignores blank lines when checking snippet-relative highlight values, preventing false positives and ensuring only actual code lines are evaluated.

Can I automatically fix incorrect hl_lines values in my markdown documentation?

You can identify incorrect hl_lines values in markdown documentation by running a validation check that reports mismatches with suggested corrections. The generated report highlights off-by-one errors and proposes accurate snippet-relative line numbers for manual updating.