Sveltedoc Parser screenshot

Sveltedoc Parser

Author Avatar Theme by Katchaotic
Updated: 15 Dec 2021
92 Stars

Generate a JSON documentation for a Svelte (https://github.com/sveltejs/svelte) component

Categories

Overview

The sveltedoc parser is an efficient tool designed for Svelte developers aiming to generate JSON documentation from Svelte files effortlessly. With a range of powerful features, it not only simplifies the process of documenting Svelte components but also enhances the clarity of the code by enabling better type inference and parsing. This parser is particularly beneficial for teams looking to maintain clear and comprehensive documentation alongside rapid development cycles.

As the Svelte framework evolves, the sveltedoc parser has kept pace by frequently updating its features and fixing bugs to ensure a smooth experience for developers. The recent updates have introduced significant improvements in type support, comment parsing, and overall parser logic, making it an essential tool in any Svelte developer’s toolkit.

Features

  • ES6 Default Value Support: Now supports ES6 default value assignments for method parameters, enhancing flexibility in code documentation.
  • Improved Method Parsing: Capable of parsing methods assigned to identifiers, providing deeper insights into function usage.
  • Extended Typings: Supports self and trusted event modifiers in types, allowing for more comprehensive documentation of events.
  • Enhanced Type Inference: Simple type inference for arrays, objects, and functions, resulting in richer documentation outputs.
  • Import Type Parsing: Added functionality to parse imported types, making it easier to document external dependencies and classes.
  • Comment Markup Parsing: All comments in markup are parsed accurately and attached to the correct items, ensuring thorough documentation.
  • Refined Parsing Logic: The internal parser has been refactored to allow for easier updates and future TypeScript support.
  • Breaking Changes for Consistency: Improved definitions for SvelteSlotParameter and SvelteSlotItem, promoting uniformity across documentation outputs.