Skip to main content

tom_doc_specs 0.1.0 copy "tom_doc_specs: ^0.1.0" to clipboard
tom_doc_specs: ^0.1.0 copied to clipboard

Document schema validation for structured markdown, extending DocScanner with typed sections.

Tom Doc Specs #

Document schema validation for structured markdown. Extends tom_doc_scanner's document trees with typed sections, schema resolution, and validation — so a markdown document that declares a schema (<!-- docspec: schema-id/version -->) can be checked for required sections, section types, and structural rules, and accessed programmatically through typed section models.

Features #

  • Schema declarations in markdown — a document names its schema in an HTML comment; schemas are resolved from .docspec-schemas/ folders up the directory tree.
  • Typed section access — SpecDoc / SpecSection wrap the raw tom_doc_scanner tree with the schema's section types.
  • Validation — missing required sections, unknown sections, and type violations are reported with locations.
  • docspecs CLI — validate documents from the command line or scripts.

Usage #

import 'package:tom_doc_specs/tom_doc_specs.dart';

final doc = await DocSpecs.scanDocument(path: 'quest_overview.docspec.md');
if (!doc.isValid) {
  print('Errors: ${doc.validationErrors}');
}

CLI #

dart pub global activate tom_doc_specs
docspecs validate path/to/document.md

License #

BSD 3-Clause — see LICENSE.

0
likes
0
points
102
downloads

Publisher

unverified uploader

Weekly Downloads

Document schema validation for structured markdown, extending DocScanner with typed sections.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

path, tom_doc_scanner, yaml

More

Packages that depend on tom_doc_specs