Skip to content

Commit

Permalink
Update docs with API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoviv committed Jan 31, 2024
1 parent 6e5c5a1 commit 8cf8fb5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -60,7 +60,7 @@ let p = new Preprocessor();
let output = p.process('<template>Hi</template>');
```

### `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.
Expand All @@ -71,6 +71,19 @@ let p = new Preprocessor();
let output = p.parse('<template>Hi</template>');
```

#### `PreprocessorOptions`

````ts
interface PreprocessorOptions {

/** Default is `false` */
inline_source_map?: boolean;

filename?: string;

}
````

#### `Parsed`

NOTE: All ranges are in bytes, not characters.
Expand Down

0 comments on commit 8cf8fb5

Please sign in to comment.