From 77fba3fad750aa2e69adf68c47892c5cb64ebcee Mon Sep 17 00:00:00 2001 From: Alexey Mulyukin Date: Mon, 5 Aug 2019 15:11:56 +0300 Subject: [PATCH] Update documentation --- CHANGELOG.md | 4 +++- README.md | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ebf47..5524799 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ All notable changes to the "svelte-intellisense" extension will be documented in Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. -## [2.0.0] UNRELEASED +## [2.0.0] 05.08.2019 + +- [Added] Support for V3 syntax ## [1.2.0] 01.02.2019 diff --git a/README.md b/README.md index 45168e0..8cae1b3 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ npm install --save sveltedoc-parser | **features** | The component features to parse and extracting. | By default used all supported features (see below). | | **ignoredVisibilities** | The list of ignored visibilities. | `['private', 'protected']` | | **includeSourceLocations** | Flag, which indicates that source locations should be provided for component symbols. | `false` | +| **version** | Optional. Use 2 or 3 to specify which svelte syntax should be used. | `undefined` | +| **defaultVersion** | Optional. Specify default version of svelte syntax, if auto-detector can't indetify correct version. | `undefined` | ### Supported feature names @@ -94,6 +96,20 @@ sveltedoc.parse(options) }); ``` +## API + +### parse(options) + +Method to parse svelte component and provide doc object structure with details information. + +### detectVersion(options) + +Method to detect svelte syntax version + +- Returns `3` when Svelte 3 special syntax feature are used +- Returns `2` when Svelte 2 special syntax feature are used +- Returns `defaultVersion` or `undefined` when specific version can't be identified + ## Issues All list of known issues presented at [this page](https://github.com/alexprey/sveltedoc-parser/issues).