OLD | NEW |
1 Sky Markup: Syntax | 1 Sky Markup: Syntax |
2 ================== | 2 ================== |
3 | 3 |
4 A Sky file must consist of the following components: | 4 A Sky file must consist of the following components: |
5 | 5 |
6 1. If the file is intended to be a top-level Sky application, the | 6 1. If the file is intended to be a top-level Sky application, the |
7 string "``#!mojo mojo:sky``" followed by a U+0020, U+000A or | 7 string "``#!mojo mojo:sky``" followed by a U+0020, U+000A or |
8 U+000D character. | 8 U+000D character. |
9 | 9 |
10 If the file is intended to be a module, then the string "SKY", a | 10 If the file is intended to be a module, then the string "SKY", a |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 ``<import src="foo.sky">`` | 155 ``<import src="foo.sky">`` |
156 - Downloads and imports foo.sky in the background. | 156 - Downloads and imports foo.sky in the background. |
157 | 157 |
158 ``<import src="foo.sky" as="foo">`` | 158 ``<import src="foo.sky" as="foo">`` |
159 - Downloads and imports foo.sky in the background, using "foo" as its | 159 - Downloads and imports foo.sky in the background, using "foo" as its |
160 local name (see ``<script>``). | 160 local name (see ``<script>``). |
161 | 161 |
162 ``<template>`` | 162 ``<template>`` |
163 - The contents of the element aren't placed in the Element itself. | 163 - The contents of the element aren't placed in the Element itself. |
164 They are instead placed into a DocumentFragment that you can obtain | 164 They are instead placed into a Fragment that you can obtain from |
165 from the element's "content" attribute. | 165 the element's "content" attribute. |
166 | 166 |
167 ``<script>`` | 167 ``<script>`` |
168 - Blocks until all previous imports have been loaded, then loads the | 168 - Blocks until all previous imports have been loaded, then loads the |
169 library given in the script block, as described in | 169 library given in the script block, as described in |
170 [scripts.md](scripts.md). | 170 [scripts.md](scripts.md). |
171 | 171 |
172 ``<style>`` | 172 ``<style>`` |
173 - Adds the contents to the document's styles. | 173 - Adds the contents to the module's styles. |
174 | 174 |
175 ``<content>`` | 175 ``<content>`` |
176 ``<content select="...">`` | 176 ``<content select="...">`` |
177 - In a shadow tree, acts as an insertion point for distributed nodes. | 177 - In a shadow tree, acts as an insertion point for distributed nodes. |
178 The select="" attribute gives the selector to use to pick the nodes | 178 The select="" attribute gives the selector to use to pick the nodes |
179 to place in this insertion point; it defaults to everything. | 179 to place in this insertion point; it defaults to everything. |
180 | 180 |
181 ``<img src="foo.bin">`` | 181 ``<img src="foo.bin">`` |
182 - Sky fetches the bits for foo.bin, looks for a decoder for those | 182 - Sky fetches the bits for foo.bin, looks for a decoder for those |
183 bits, and renders the bits that the decoder returns. | 183 bits, and renders the bits that the decoder returns. |
(...skipping 11 matching lines...) Expand all Loading... |
195 ``<t>`` | 195 ``<t>`` |
196 - Within a ``<t>`` section, whitespace is not trimmed from the start and | 196 - Within a ``<t>`` section, whitespace is not trimmed from the start and |
197 end of text nodes by the parser. | 197 end of text nodes by the parser. |
198 TOOD(ianh): figure out if the authoring aesthetics of this are ok | 198 TOOD(ianh): figure out if the authoring aesthetics of this are ok |
199 | 199 |
200 ``<a href="foo.bin">`` | 200 ``<a href="foo.bin">`` |
201 - A widget that, when invoked, causes mojo to open a new application | 201 - A widget that, when invoked, causes mojo to open a new application |
202 for "foo.bin". | 202 for "foo.bin". |
203 | 203 |
204 ``<title>`` | 204 ``<title>`` |
205 - Sets the contents as the document's title (as provided by Sky to | 205 - Sets the contents as the application's title (as provided by Sky to |
206 the view manager). (Actually just ensures that any time the element | 206 the view manager). (Actually just ensures that any time the element |
207 is mutated, theTitleElement.ownerScope.ownerDocument.title is set | 207 is mutated, module.application.title is set to the element's |
208 to the element's contents.) | 208 contents.) |
209 | 209 |
210 | 210 |
211 Sky Markup: Global Attributes | 211 Sky Markup: Global Attributes |
212 ============================= | 212 ============================= |
213 | 213 |
214 The following attributes are available on all elements: | 214 The following attributes are available on all elements: |
215 | 215 |
216 * ``id=""`` (any value) | 216 * ``id=""`` (any value) |
217 * ``class=""`` (any value, space-separated) | 217 * ``class=""`` (any value, space-separated) |
218 * ``style=""`` (declaration part of a Sky style rule) | 218 * ``style=""`` (declaration part of a Sky style rule) |
219 * ``lang=""`` (language code) | 219 * ``lang=""`` (language code) |
220 * ``dir=""`` (ltr or rtl only) | 220 * ``dir=""`` (ltr or rtl only) |
221 * ``contenteditable=""`` (subject to future developments) | 221 * ``contenteditable=""`` (subject to future developments) |
222 * ``tabindex=""`` (subject to future developments) | 222 * ``tabindex=""`` (subject to future developments) |
OLD | NEW |