weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinji...@apache.org
Subject [05/50] [abbrv] incubator-weex git commit: Doc mention camelcase (#348)
Date Tue, 24 Jan 2017 08:18:20 GMT
Doc mention camelcase (#348)

* * [doc] test synax highlight

* * [doc] add kebab case suggestion


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d77c0d0d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d77c0d0d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d77c0d0d

Branch: refs/heads/master
Commit: d77c0d0d0389db9893c57601aed96404f62cb63d
Parents: 32847dc
Author: lvs(zikuan.ly) <lvscar@gmail.com>
Authored: Thu May 26 20:35:03 2016 +0800
Committer: luics <luics.xu@gmail.com>
Committed: Thu May 26 20:35:03 2016 +0800

----------------------------------------------------------------------
 doc/demo/hello-world.md        |  2 +-
 doc/references/common-attrs.md |  4 ++++
 doc/syntax/data-binding.md     | 16 ++++++++--------
 doc/syntax/main.md             |  4 ++++
 4 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d77c0d0d/doc/demo/hello-world.md
----------------------------------------------------------------------
diff --git a/doc/demo/hello-world.md b/doc/demo/hello-world.md
index e315464..dab5329 100644
--- a/doc/demo/hello-world.md
+++ b/doc/demo/hello-world.md
@@ -6,7 +6,7 @@ Weex Hello World
 
 ## weex code
 hello_world.we
-```
+```html
 <template>
   <div>
     <text>Hello World</text>

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d77c0d0d/doc/references/common-attrs.md
----------------------------------------------------------------------
diff --git a/doc/references/common-attrs.md b/doc/references/common-attrs.md
index c38f586..639cea1 100644
--- a/doc/references/common-attrs.md
+++ b/doc/references/common-attrs.md
@@ -73,3 +73,7 @@ onappear="loadMore"
 register event handlers on weex tag
 
 [more information](../syntax/events.md)
+
+### Notes!
+weex is basically following [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute)
naming rule , so please **do not use CamelCase** in your attribute , **kebab-case** with “-”
as delimiter is much better.
+

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d77c0d0d/doc/syntax/data-binding.md
----------------------------------------------------------------------
diff --git a/doc/syntax/data-binding.md b/doc/syntax/data-binding.md
index e36f872..e9cb967 100644
--- a/doc/syntax/data-binding.md
+++ b/doc/syntax/data-binding.md
@@ -4,7 +4,7 @@ In Weex, we use the *mustache* syntax `{{...}}` to bind data in `<template>`
whi
 
 ## Binding data path
 
-```
+```html
 <template>
   <container>
     <text style="font-size: {{size}}">{{title}}</text>
@@ -25,7 +25,7 @@ The code above will bind the `title` and `size` data field to `template`.
 
 We can also use `.` syntax to bind cascading data structure. Let's look at the following
code snippet:
 
-```
+```html
 <template>
   <container>
     <text style="font-size: {{title.size}}">{{title.value}}</text>
@@ -48,7 +48,7 @@ We can also use `.` syntax to bind cascading data structure. Let's look
at the f
 
 Inside data bindings, Weex supports simply javascript expressions, e.g.
 
-```
+```html
 <template>
   <container style="flex-direction: row;">
     <text>{{firstName + ' ' + lastName}}</text>
@@ -74,7 +74,7 @@ The expression will be evaluated in the data scope of current context.
 According to simple operations, in-template expressions are very convenient. But if you want
to put more logic into the template, you should use a computed property.
 
 e.g.
-```
+```html
 <template>
   <container style="flex-direction: row;">
     <text>{{fullName}}</text>
@@ -122,7 +122,7 @@ Otherwise when you call `changeName` after click, the setter will be invoked
and
 
 the style of a component can be bind using the `style` attribute:
 
-```
+```html
 <template>
   <text style="font-size: {{size}}; color: {{color}}; ...">...</text>
 </template>
@@ -130,7 +130,7 @@ the style of a component can be bind using the `style` attribute:
 
 while style can also get bound with `class` attribute, multiple classnames can be split by
spaces:
 
-```
+```html
 <template>
   <container>
     <text class="{{size}}"></text>
@@ -147,7 +147,7 @@ here if `{{size}}` and `{{status}}` have empty value, then only `class="title"`
 
 The event handler is an attribute which name has a prefix `on...`. The other part of attribute
name is event type and the value is event handler name. We don't need to add mustache around
the method name or add parentheses to call it.
 
-```
+```html
 <template>
   <text onclick="toggle">Toggle</text>
 </template>
@@ -167,7 +167,7 @@ The event handler is an attribute which name has a prefix `on...`. The
other par
 
 `if` attribute can control the display of a component by a truthy/falsy value.
 
-```
+```html
 <template>
   <container style="flex-direction: column;">
     <text onclick="toggle">Toggle</text>

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d77c0d0d/doc/syntax/main.md
----------------------------------------------------------------------
diff --git a/doc/syntax/main.md b/doc/syntax/main.md
index b5150f8..229864b 100644
--- a/doc/syntax/main.md
+++ b/doc/syntax/main.md
@@ -70,6 +70,10 @@ Both the two `text` components above have the same `font-size`, which is
`64` pi
 
 * [See common styles in Weex](../references/common-style.md)
 
+
+### Notes!
+weex is basically following [HTML attribute](https://en.wikipedia.org/wiki/HTML_attribute)
naming rule , so please **do not use CamelCase** in your attribute , **long-name** with “-”
as delimiter is much better.
+
 ## `<script>`
 
 The syntax is JavaScript (ES5) and it describes data and behavior of a Weex page. Here we
create three paragraphs:


Mime
View raw message