Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
17cc0967
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
17cc0967
编写于
10月 24, 2014
作者:
H
Hixie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Docs: fix markdown in various files, update the README mildly
Review URL:
https://codereview.chromium.org/678693003
上级
1f9a5e29
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
165 addition
and
155 deletion
+165
-155
README.md
README.md
+20
-9
specs/README.md
specs/README.md
+8
-8
specs/apis.md
specs/apis.md
+15
-15
specs/markup.md
specs/markup.md
+7
-8
specs/modules.md
specs/modules.md
+1
-1
specs/parsing.md
specs/parsing.md
+114
-114
未找到文件。
README.md
浏览文件 @
17cc0967
...
...
@@ -17,7 +17,7 @@ theme layer that gives each widget a concrete visual and interactive design.
Elements
--------
The Sky engine contains
a handful of primitive elements
and the tools with which
The Sky engine contains
[
a handful of primitive elements
](
specs/markup.md
)
and the tools with which
to create custom elements. The following elements are built into the engine:
-
``script``
: Executes script
...
...
@@ -27,9 +27,10 @@ to create custom elements. The following elements are built into the engine:
-
``template``
: Captures descendants for use as a template
-
``content``
: Visually projects descendents of the shadow host
-
``shadow``
: Visually projects older shadow roots of the shadow host
-
``im
age
``
: Displays an image
-
``im
g
``
: Displays an image
-
``a``
: Links to another Mojo application
-
``title``
: Briefly describes the current application state to the user
-
``t``
: Preserve whitespace (by default, whitespace nodes are dropped)
### Additional Elements ###
...
...
@@ -64,10 +65,19 @@ For example, the ``AnnualReport`` constructor uses the ``BalanceSheet`` class
exported by that module.
```
html
<import
href=
”/sky/framework”
/>
<import
href=
”/another/module.sky”
as=
”foo”
/>
SKY MODULE
<import
src=
”/sky/framework”
/>
<import
src=
”/another/module.sky”
as=
”foo”
/>
<sky-element
name=
”my-element”
>
[ ... custom element definition ... ]
class extends SkyElement {
constructor () {
this.addEventListener('click', (event) => this.updateTime());
this.createShadowTree().appendChild('Click to show the time');
}
updateTime() {
this.shadowTree.firstChild.replaceWith(new Date());
}
}
</sky-element>
<script>
class
AnnualReport
{
...
...
@@ -114,9 +124,10 @@ As an example, the following is a sketch of a module that wraps Mojo's
``network_service``
in a simpler functional interface:
```
html
<import
href=
”mojo://shell”
as=
”shell”
/>
<import
href=
"/mojo/network/network_service.mojom.sky"
as=
"net"
/>
<import
href=
"/mojo/network/url_loader.mojom.sky"
as=
"loader"
/>
SKY MODULE
<import
src=
”mojo://shell”
as=
”shell”
/>
<import
src=
"/mojo/network/network_service.mojom.sky"
as=
"net"
/>
<import
src=
"/mojo/network/url_loader.mojom.sky"
as=
"loader"
/>
<script>
module
.
exports
=
function
fetch
(
url
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
...
...
@@ -150,6 +161,6 @@ and the specification are in flux, but hopefully they'll converge over time.
Contributing
------------
Instructions for building and testing Sky are contained in [HACKING.md]. For
Instructions for building and testing Sky are contained in
[
HACKING.md
]
(
HACKING.md
)
. For
coordination, we use the
``#mojo``
IRC channel on
[
Freenode
](
https://freenode.net/
)
.
specs/README.md
浏览文件 @
17cc0967
...
...
@@ -7,20 +7,20 @@ they can refer to binary resources like images and fonts.
Sky files
---------
Conventional MIME type:
``
`text/sky`
``
, though this type is neither
Conventional MIME type:
``
text/sky
``
, though this type is neither
necessary nor sufficient to indicate that a file is a Sky file; only
the signature matters for type dispatch of Sky files.
Conventional extension:
``
`.sky`
``
Conventional extension:
``
.sky
``
Signatures:
For application files, one of the following:
``
`
23 21 6d 6f 6a 6f 20 6d 6f 6a 6f 3a 73 6b 79 0a``` ("```#!mojo mojo:sky\n`
``")
``
`23 21 6d 6f 6a 6f 20 6d 6f 6a 6f 3a 73 6b 79 0d``` ("```#!mojo mojo:sky\r`
``")
``
`
23 21 6d 6f 6a 6f 20 6d 6f 6a 6f 3a 73 6b 79 20
``` ("```
#!mojo mojo:sky
`
``")
``
23 21 6d 6f 6a 6f 20 6d 6f 6a 6f 3a 73 6b 79 0a``
("
``#!mojo mojo:sky\n
``
")
``
23 21 6d 6f 6a 6f 20 6d 6f 6a 6f 3a 73 6b 79 0d``
("
``#!mojo mojo:sky\r
``
")
``
23 21 6d 6f 6a 6f 20 6d 6f 6a 6f 3a 73 6b 79 20``
("
``#!mojo mojo:sky
``
")
For module files, one of the following:
``
`
53 4b 59 20 4d 4f 44 55 4c 45 0a
``` ("```
SKY MODULE
\n
`
``")
``
`
53 4b 59 20 4d 4f 44 55 4c 45 0d
``` ("```
SKY MODULE
\r
`
``")
``
`
53 4b 59 20 4d 4f 44 55 4c 45 20
``` ("```
SKY MODULE
`
``
")
``
53 4b 59 20 4d 4f 44 55 4c 45 0a``
("
``SKY MODULE\n
``
")
``
53 4b 59 20 4d 4f 44 55 4c 45 0d``
("
``SKY MODULE\r
``
")
``
53 4b 59 20 4d 4f 44 55 4c 45 20``
("
``SKY MODULE
``
")
specs/apis.md
浏览文件 @
17cc0967
...
...
@@ -4,7 +4,7 @@ APIS
The Sky core API
----------------
```
```
javascript
module
'
sky:core
'
{
// EVENTS
...
...
@@ -218,7 +218,7 @@ implementations of the APIs to JavaScript.
Sky IDL works more or less the same as Web IDL but the syntax is a bit
different.
```
```
javascript
module
'
sky:modulename
'
{
// this is a comment
...
...
@@ -267,18 +267,18 @@ module 'sky:modulename' {
The following types are available:
*
``
`Integer```
- WebIDL
```long long`
``
*
``
`Float```
- WebIDL
```double`
``
*
``
`String```
- WebIDL
```USVString`
``
*
``
`Boolean```
- WebIDL
```boolean`
``
# ``
`Object``` - WebIDL ```object`
``
*
``
`InterfaceName`
``
- an instance of the interface InterfaceName
*
``
`Promise<Type>```
- WebIDL
```Promise<T>`
``
*
``
`Array<Type>```
- WebIDL
```sequence<T>`
``
*
``
`Dictionary`
``
- unordered set of name-value String-String pairs with no duplicate names
*
``
`Type?`
``
- union of Type and the singleton type with value "null" (WebIDL nullable)
*
``
`(Type1 or Type2)`
``
- union of Type1 and Type2 (WebIDL union)
*
``
`any```
- union of all types (WebIDL
```any`
``
)
*
``
Integer``
- WebIDL
``long long
``
*
``
Float``
- WebIDL
``double
``
*
``
String``
- WebIDL
``USVString
``
*
``
Boolean``
- WebIDL
``boolean
``
# ``
Object`` - WebIDL ``object
``
*
``
InterfaceName
``
- an instance of the interface InterfaceName
*
``
Promise<Type>``
- WebIDL
``Promise<T>
``
*
``
Array<Type>``
- WebIDL
``sequence<T>
``
*
``
Dictionary
``
- unordered set of name-value String-String pairs with no duplicate names
*
``
Type?
``
- union of Type and the singleton type with value "null" (WebIDL nullable)
*
``
(Type1 or Type2)
``
- union of Type1 and Type2 (WebIDL union)
*
``
any``
- union of all types (WebIDL
``any
``
)
Methods that return nothing (undefined, in JS) use the keyword "void"
instead of a type.
...
...
@@ -301,7 +301,7 @@ TODO(ianh): Define in detail how this actually works
Notes
-----
```
```
javascript
global
object
=
{}
// with Math, RegExp, etc
magical
imports
:
...
...
specs/markup.md
浏览文件 @
17cc0967
...
...
@@ -204,11 +204,10 @@ Sky Markup: Global Attributes
The following attributes are available on all elements:
id="" (any value)
class="" (any value, space-separated)
style="" (declaration part of a Sky style rule)
lang="" (language code)
dir="" (ltr or rtl only)
contenteditable="" (subject to future developments)
tabindex="" (subject to future developments)
*
``id=""``
(any value)
*
``class=""``
(any value, space-separated)
*
``style=""``
(declaration part of a Sky style rule)
*
``lang=""``
(language code)
*
``dir=""``
(ltr or rtl only)
*
``contenteditable=""``
(subject to future developments)
*
``tabindex=""``
(subject to future developments)
specs/modules.md
浏览文件 @
17cc0967
...
...
@@ -30,7 +30,7 @@ Module API
Within a script in a module, the
```module```
identifier is bound to
the
```Module```
object that represents the module:
```
```
javascript
interface
Module
:
EventTarget
{
constructor
(
Application
application
,
Document
document
);
// O(1)
attribute
any
exports
;
// O(1) // defaults to the module's document
...
...
specs/parsing.md
浏览文件 @
17cc0967
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录