Skip to content

Commit

Permalink
doc: Update API document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 25, 2022
1 parent 226cd10 commit 6e50f05
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 11 additions & 0 deletions packages/html-to-markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,22 @@ htmlToMarkdown({ html: '<h1>Markdown String</h1>' });
## API

```ts
import { PluggableList } from 'unified';
import { Options as RehypeParseOptions } from 'rehype-parse';
declare type Options = {
html?: string;
url?: string;
rehypeParseOption?: RehypeParseOptions;
/**
* List of [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) to use.
* See the next section for examples on how to pass options
*/
remarkPlugins?: PluggableList;
/**
* List of [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) to use.
* See the next section for examples on how to pass options
*/
rehypePlugins?: PluggableList;
};
export default function htmlToMarkdown(options?: Options): Promise<string>;
```
Expand Down
10 changes: 8 additions & 2 deletions packages/html-to-markdown/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ type Options = {
html?: string
url?: string
rehypeParseOption?: RehypeParseOptions;
/** List of [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) to use. See the next section for examples on how to pass options */
/**
* List of [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) to use.
* See the next section for examples on how to pass options
*/
remarkPlugins?: PluggableList;
/** List of [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) to use. See the next section for examples on how to pass options */
/**
* List of [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) to use.
* See the next section for examples on how to pass options
*/
rehypePlugins?: PluggableList;
}

Expand Down

0 comments on commit 6e50f05

Please sign in to comment.