Skip to content

wip: custom-elements-manifest support #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.22.1
v16.13.0
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <api-viewer>

API documentation and live playground for Web Components. Based on [web-component-analyzer](https://github.com/runem/web-component-analyzer) JSON format.
API documentation and live playground for Web Components. Based on [custom elements manifest](https://github.com/webcomponents/custom-elements-manifest) JSON format.

```html
<api-viewer src="./custom-elements.json"></api-viewer>
Expand Down Expand Up @@ -42,18 +42,20 @@ Or grab from [unpkg.com CDN](https://unpkg.com/api-viewer-element?module):

## Usage

1. Install [web-component-analyzer](https://github.com/runem/web-component-analyzer):
1. Install [custom elements manifest analyzer](https://github.com/open-wc/custom-elements-manifest):

```sh
$ npm install -g web-component-analyzer
$ npm install @custom-elements-manifest/analyzer
```

2. Analyze your components using `--format json`:
2. Analyze your components:

```sh
$ wca analyze my-element.js --outFile custom-elements.json --format json
$ cem analyze my-element.js
```

Read the [docs](https://custom-elements-manifest.open-wc.org) for more information on how to use the analyzer.

3. Create an HTML file and import the component:

```html
Expand Down Expand Up @@ -374,7 +376,7 @@ $ yarn serve:dist

## Acknowledgements

- Big thanks to [@runem](http://github.com/runem) for creating Web Component Analyzer.
- Big thanks to [@runem](http://github.com/runem) for creating Web Component Analyzer, which previous versions of this package were based on.
- Thanks to [@bahrus](https://github.com/bahrus) for [wc-info](https://github.com/bahrus/wc-info) component which inspired me.
- The visual appearance is largely inspired by [Vuetify](https://vuetifyjs.com/en/getting-started/quick-start) API docs.
- The tabs component is based on the [howto-tabs](https://developers.google.com/web/fundamentals/web-components/examples/howto-tabs) example.
Expand Down
Loading