Skip to content

Commit

Permalink
Minor API doc improvements.
Browse files Browse the repository at this point in the history
- Move API doc config to a file.
- FIX API doc metadata (favicon, meta description)
- Improve landing page slightly.
  • Loading branch information
Arthur Evans committed Apr 27, 2020
1 parent 503e660 commit 557de8c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
9 changes: 8 additions & 1 deletion docs/_api/api-readme.md
Expand Up @@ -10,7 +10,9 @@ npm install lit-element

### [lit-element](/api/modules/_lit_element_.html)

Extends [UpdatingElement](#lib-updating-element) to include lit-html templating. Users define a `render` method to provide an element template, which is called when required by `update`.
The main LitElement module, which defines the `LitElement` base class and related APIs.

Users define a `render` method to provide an element template, which is called whenever an observed property changes.

Import `LitElement` and `html` from this module to create a component:

Expand All @@ -26,10 +28,15 @@ class MyElement extends LitElement {
customElements.define('my-element', MyElement);
```

`LitElement` extends [`UpdatingElement`](#lib-updating-element) and adds lit-html templating.

### [lib/updating-element](/api/modules/_lib_updating_element_.html)

```js
import { UpdatingElement } from 'lit-element/lib/updating-element.js';
```

Custom Element base class that supports declaring observable properties, reflecting attributes to properties, and the core update lifecycle methods.

If you want to build a custom element base class that includes these features but **not** lit-html
templating, extend `UpdatingElement`.
4 changes: 2 additions & 2 deletions docs/_api/theme/layouts/default.hbs
Expand Up @@ -4,9 +4,9 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{#ifCond model.name '==' project.name}}{{project.name}}{{else}}{{model.name}} | {{project.name}}{{/ifCond}}</title>
<meta name="description" content="">
<meta name="description" content="LitElement API documentation">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="shortcut icon" href="/images/favicon.png">
<link rel="stylesheet" href="{{relativeURL "assets/css/main.css"}}">
<link rel="stylesheet" href="{{relativeURL "../css/main.css"}}">
<link rel="stylesheet" href="{{relativeURL "../css/pygments.css"}}">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -24,7 +24,7 @@
"scripts": {
"build": "tsc && downlevel-dts . ts3.4 && cp tsconfig.json ./ts3.4/",
"build:babel-test": "babel src/test/lib/decorators_test.ts --out-file test/lib/decorators-babel_test.js",
"gen-docs": "typedoc --readme docs/_api/api-readme.md --tsconfig tsconfig_apidoc.json --mode library --theme docs/_api/theme --excludeNotExported --excludePrivate --ignoreCompilerErrors --exclude '{**/*test*,**/node_modules/!(lit-html)/**,**/test/**}' --out ./docs/api --gaID UA-39334307-23 src/lit-element.ts src/lib/updating-element.ts",
"gen-docs": "typedoc src/lit-element.ts src/lib/updating-element.ts",
"test": "npm run build && npm run build:babel-test && wct",
"checksize": "rollup -c ; rm lit-element.bundled.js",
"format": "find src test | grep '\\.js$\\|\\.ts$' | xargs clang-format --style=file -i",
Expand Down
12 changes: 12 additions & 0 deletions typedoc.json
@@ -0,0 +1,12 @@
{
"readme": "docs/_api/api-readme.md",
"tsconfig": "tsconfig_apidoc.json",
"mode": "library",
"theme": "docs/_api/theme",
"excludeNotExported": true,
"excludePrivate": true,
"ignoreCompilerErrors": true,
"exclude": ["**/*test*", "**/node_modules/!(lit-html)/**", "**/test/**"],
"out": "./docs/api",
"gaID": "UA-39334307-23"
}

0 comments on commit 557de8c

Please sign in to comment.