tweak outline

pull/2206/head
Richard Harris 7 years ago
parent e4c1c98b2a
commit 57abcb1856

@ -0,0 +1,34 @@
---
title: Component format
---
Components are the building blocks of Svelte applications. They are written into `.svelte` files, using a superset of HTML:
```html
<script>
// logic goes here
</script>
<style>
/* styles go here */
</style>
<!-- markup (zero or more items) goes here -->
```
All three sections — script, styles and markup — are optional.
### Script
A `<script>` block defines the behaviour for a component.
* TODO explain run-on-initialisation
* export
* $:
* $
### Styles
### Markup

@ -4,7 +4,17 @@ title: Outline
(This isn't the actual documentation, this is just me getting my thoughts straight so that we can create the documentation.)
I think it makes sense to split the docs into compile time (`svelte.preprocess` and `svelte.compile`), then run time (component API, `svelte`, `svelte/store`, `svelte/motion`, etc). I'm not sure where template syntax, style scoping (and `:global(...)`), `context="module"` etc goes.
I think it makes sense to split the docs into component format (script, style, markup), compile time (`svelte.preprocess` and `svelte.compile`), then run time (component API, `svelte`, `svelte/store`, `svelte/motion`, etc). I'm not sure where template syntax, style scoping (and `:global(...)`), `context="module"` etc goes.
### Component format
* .svelte
* `<script>`
* `<style>`
* markup
* `<script context="module">`
### Compile time

Loading…
Cancel
Save