From 8cf8fb540e6a324d810703e5e7d524c2c63faec4 Mon Sep 17 00:00:00 2001 From: stefanoviv Date: Wed, 31 Jan 2024 12:20:59 +0100 Subject: [PATCH] Update docs with API changes --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d259e3..8215851 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ console.log(output); All `content-tag` public API lives on the `Preprocessor` object. -### `Preprocessor.process(src: string, filename?: string): string;` +### `Preprocessor.process(src: string, options?: PreprocessorOptions): string;` Parses a given source code string using the `content-tag` spec into standard JavaScript. @@ -60,7 +60,7 @@ let p = new Preprocessor(); let output = p.process(''); ``` -### `Preprocessor.parse(src: string, filename?: string): Parsed[];` +### `Preprocessor.parse(src: string, options?: PreprocessorOptions): Parsed[];` Parses a given source code string using the `content-tag` spec into an array of `Parsed` content tag objects. @@ -71,6 +71,19 @@ let p = new Preprocessor(); let output = p.parse(''); ``` +#### `PreprocessorOptions` + +````ts +interface PreprocessorOptions { + + /** Default is `false` */ + inline_source_map?: boolean; + + filename?: string; + +} +```` + #### `Parsed` NOTE: All ranges are in bytes, not characters.