Skip to content

Commit 26d8fda

Browse files
authored
Merge pull request #306 from keanulee/master
Docs redesign
2 parents 5533b67 + 8a00ee1 commit 26d8fda

File tree

305 files changed

+9159
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+9159
-1
lines changed

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@ lit-element.d.ts
1414
/demo/**/*.js
1515
/demo/**/*.js.map
1616

17-
!custom_typings/
17+
!custom_typings/
18+
19+
#Docs
20+
/docs/node_modules/
21+
/docs/_site/
22+
*.pyc
23+
24+
.DS_Store

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/

docs/_config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: LitElement
2+
description: A simple base class for creating fast, lightweight web components
3+
exclude: [package.json, polymer.json, src, node_modules, package-lock.json]
4+
markdown: kramdown
5+
kramdown:
6+
parse_block_html: true
7+
projects: includes/projects
8+
collections:
9+
includes:
10+
output: true

docs/_data/site.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
title: LitElement Documentation
2+
toc:
3+
try:
4+
title: Try LitElement
5+
desc: A quick tutorial with interactive code samples.
6+
url: /try/
7+
toc:
8+
create:
9+
title: Create your first custom element
10+
url: /try/create
11+
use:
12+
title: Use your element in a web page
13+
url: /try/use
14+
properties:
15+
title: Declare and use properties
16+
url: /try/properties
17+
expressions:
18+
title: Add a loop and an “if” statement
19+
url: /try/expressions
20+
events:
21+
title: Add an event handler
22+
url: /try/events
23+
style:
24+
title: Style your element template
25+
url: /try/style
26+
docs:
27+
title: Documentation
28+
desc: LitElement is a simple base class for creating fast, lightweight web components that work in any web page with any framework.
29+
url: /docs/
30+
toc:
31+
create:
32+
title: Create a component
33+
desc: Create a new web component with LitElement. Import and use LitElement components in HTML and JavaScript.
34+
url: /docs/create
35+
toc:
36+
install:
37+
title: Install LitElement
38+
url: /docs/create#install
39+
class:
40+
title: Create a new component
41+
desc: Create a new class for your web component by extending the LitElement base class.
42+
url: /docs/create#class
43+
typescript:
44+
title: Use TypeScript to create a component
45+
desc: Use LitElement TypeScript decorators to create a new class for a LitElement-based component.
46+
url: /docs/create#typescript
47+
import:
48+
title: Import an element
49+
desc: Import your own or third-party LitElement components in HTML or JavaScript.
50+
url: /docs/create#import
51+
templates:
52+
title: Templates
53+
desc: Create and render LitElement templates. Use JavaScript expressions to add properties and logic.
54+
url: /docs/templates/
55+
toc:
56+
create:
57+
title: Create a template
58+
desc: Define a template and specify where it should render.
59+
type: task
60+
url: /docs/templates/create
61+
expressions:
62+
title: Use properties and logic
63+
desc: Use JavaScript expressions to add properties, loops, and conditionals to your templates.
64+
type: task
65+
url: /docs/templates/expressions
66+
databinding:
67+
title: Bind data to a child element
68+
desc: Bind to the text content, properties, attributes, and event handlers of a child element.
69+
type: task
70+
url: /docs/templates/databinding
71+
compose:
72+
title: Compose and nest templates
73+
desc: Compose LitElement templates from other templates.
74+
type: task
75+
url: /docs/templates/compose
76+
slots:
77+
title: Render light DOM children
78+
desc: Use slots to include light DOM children in shadow DOM templates.
79+
type: task
80+
url: /docs/templates/slots
81+
design:
82+
title: Template design concepts
83+
desc: Concepts for designing templates that render and update efficiently.
84+
type: concept
85+
url: /docs/templates/design
86+
syntax:
87+
title: Template syntax
88+
desc: A quick reference to LitElement template syntax.
89+
type: reference
90+
url: /docs/templates/syntax
91+
properties:
92+
title: Properties and attributes
93+
desc: Declare and configure a component's properties and attributes.
94+
url: /docs/properties
95+
toc:
96+
declare:
97+
title: Declare properties
98+
url: /docs/properties#declare
99+
init:
100+
title: Initialize property values
101+
url: /docs/properties#init
102+
type:
103+
title: Configure a property type
104+
url: /docs/properties#type
105+
attribute:
106+
title: Configure observed attributes
107+
url: /docs/properties#attribute
108+
reflect:
109+
title: Configure reflection to attributes
110+
url: /docs/properties#reflect
111+
haschanged:
112+
title: Evaluate property changes
113+
url: /docs/properties#haschanged
114+
lifecycle:
115+
title: Element update lifecycle
116+
desc: Specify when an element should update. Respond to updates, or wait for an update to complete.
117+
url: /docs/lifecycle/
118+
toc:
119+
about:
120+
title: About the element update lifecycle
121+
desc: Concepts for working with LitElement's asynchronous update lifecycle.
122+
type: concept
123+
url: /docs/lifecycle/about
124+
customize:
125+
title: Customize lifecycle behavior
126+
desc: Customize how and when an element should update, and perform additional tasks during any stage of the update lifecycle.
127+
type: task
128+
url: /docs/lifecycle/customize
129+
methods:
130+
title: Methods and Promises reference
131+
desc: A reference to the methods and Promises in the LitElement update lifecycle.
132+
type: reference
133+
url: /docs/lifecycle/methods
134+
tools:
135+
title: Tools
136+
desc: Tools for developing and deploying LitElement projects.
137+
url: /tools/
138+
toc:
139+
setup:
140+
title: Set up LitElement locally
141+
desc: Set up LitElement for the first time.
142+
url: /tools/setup
143+
develop:
144+
title: Developer tools
145+
desc: Tools for developing and working locally with LitElement projects.
146+
url: /tools/develop
147+
build:
148+
title: Build for production
149+
desc: Get your project ready for deployment to the web.
150+
url: /tools/build
151+
sample:
152+
title: Sample project
153+
desc: Clone, serve, and build a sample LitElement project.
154+
url: /tools/sample

docs/_includes/analytics.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script async src="https://www.googletagmanager.com/gtag/js?id={{site.google_analytics}}"></script>
2+
<script>
3+
window.dataLayer = window.dataLayer || [];
4+
function gtag(){dataLayer.push(arguments);}
5+
gtag('js', new Date());
6+
gtag('config', '{{site.google_analytics}}');
7+
</script>

docs/_includes/article.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
<div><a href="{{site.baseurl}}{{section.url}}">{{section.title}}</a></div>
3+
4+
<h1><a href="{{site.baseurl}}{{topic.url}}">{{topic.title}}</a></h1>
5+
6+
<div class="disclaimer">This documentation is a work in progress. It describes prerelease software, and is subject to change.</div>
7+
8+
{% if page.addsectiontoc %}
9+
{% include sectiontoc.html %}
10+
{% endif %}
11+
12+
{%- if topic.toc -%}
13+
<ul>
14+
{%- for item in topic.toc -%}
15+
{%- if item[1].url == self.url -%}
16+
<li class="current"><a href="{{site.baseurl}}{{item[1].url}}">{{item[1].title}}</a></li>
17+
{%- else -%}
18+
<li><a href="{{site.baseurl}}{{item[1].url}}">{{item[1].title}}</a></li>
19+
{%- endif -%}
20+
{%- endfor -%}
21+
</ul>
22+
23+
<h2><a href="{{site.baseurl}}{{subtopic.url}}">{{subtopic.title}}</a></h2>
24+
25+
{%- endif -%}
26+
27+
{{ content }}

docs/_includes/prevnext.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{%- comment -%} Note: No HTML indentation to prevent markdown processing. {%- endcomment -%}
2+
<div class="prevnext">
3+
<div class="next">
4+
{% if include.nexturl %}
5+
<a href="{{include.nexturl}}">Next: {{include.nexttitle}} &gt;&gt;</a>
6+
{% endif %}
7+
</div>
8+
<div class="prev">
9+
{% if include.prevurl %}
10+
<a href="{{include.prevurl}}">&lt;&lt; Previous: {{include.prevtitle}}</a>
11+
{% endif %}
12+
</div>
13+
</div>

docs/_includes/project.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<stack-blitz
2+
folder="{{ site.baseurl }}/{{ site.projects }}/{{ include.folder | default: template }}"
3+
openFile="{{ include.openFile | default: custom-element.js }}">
4+
</stack-blitz>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
8+
<script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
9+
10+
<script type="module" src="./my-element.js"></script>
11+
<title>lit-element code sample</title>
12+
</head>
13+
<body>
14+
<my-element></my-element>
15+
</body>
16+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './my-element.js';

0 commit comments

Comments
 (0)