Menu
Libraries |
Category

sveltedoc-parser

  • Purpose: Generates JSON documentation for Svelte files by parsing components and extracting structured information.
  • Target Audience: Developers working with Svelte (versions 2 and 3) who need automated documentation generation.
  • Key Features:
    • Common Features:
      • JSDoc support for descriptions, visibility scopes (@public, @protected, @private).
      • Extracts imported components, data properties, computed properties, references, events (with modifiers), slots, and methods.
      • Supports source location tracking for symbols.
    • Svelte 2 Specific:
      • Extracts fired events, helpers, actions, and transitions.
    • Svelte 3 Specific:
      • Extracts global component descriptions (requires @component in top-level comment).
      • Parses dispatched events from script and markup.
  • Output Format: JSON structure described in typings.d.ts with examples available in the examples folder.
  • Options: Customizable parsing with features like filename/fileContent, encoding, features to extract, ignoredVisibilities, and Svelte version detection.
  • API:
    • parse(options): Parses the component and returns documentation.
    • detectVersion(options): Detects Svelte syntax version (2 or 3).
  • Support: Actively maintained with recent updates (see Changelog) and issue tracking on GitHub.

sveltesveltejsdocsjsdocsvelte-documentationparser

Comments