You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+12-29Lines changed: 12 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,9 @@ Contributions welcome!
4
4
5
5
**Before spending lots of time on something, ask for feedback on your idea first!**
6
6
7
-
Please search issues and pull requests before adding something new to avoid duplicating
8
-
efforts and conversations.
7
+
Please search issues and pull requests before adding something new to avoid duplicating efforts and conversations.
9
8
10
-
This project welcomes non-code contributions, too! The following types of contributions
11
-
are welcome:
9
+
This project welcomes non-code contributions, too! The following types of contributions are welcome:
12
10
13
11
-**Ideas**: participate in an issue thread or start your own to have your voice heard.
14
12
-**Writing**: contribute your expertise in an area by helping expand the included docs.
@@ -25,51 +23,36 @@ to!
25
23
26
24
## Project Governance
27
25
28
-
Individuals making significant and valuable contributions are given commit-access to the
29
-
project to contribute as they see fit. This project is more like an open wiki than a
30
-
standard guarded open source project.
26
+
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
31
27
32
28
### Rules
33
29
34
30
There are a few basic ground-rules for contributors:
35
31
36
32
1.**No `--force` pushes** or modifying the Git history in any way.
37
33
2.**Non-master branches** should be used for ongoing work.
38
-
3.**Significant modifications** like API changes should be subject to a **pull request**
39
-
to solicit feedback from other contributors.
40
-
4.**Pull requests** are *encouraged* for all contributions to solicit feedback, but left to
41
-
the discretion of the contributor.
34
+
3.**Significant modifications** like API changes should be subject to a **pull request** to solicit feedback from other contributors.
35
+
4.**Pull requests** are *encouraged* for all contributions to solicit feedback, but left to the discretion of the contributor.
42
36
43
37
### Releases
44
38
45
39
Declaring formal releases remains the prerogative of the project maintainer.
46
40
47
41
### Changes to this arrangement
48
42
49
-
This is an experiment and feedback is welcome! This document may also be subject to pull-
50
-
requests or changes by contributors where you believe you have something valuable to add
51
-
or change.
43
+
This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change.
52
44
53
45
## Developer's Certificate of Origin 1.1
54
46
55
47
By making a contribution to this project, I certify that:
56
48
57
-
- (a) The contribution was created in whole or in part by me and I have the right to
58
-
submit it under the open source license indicated in the file; or
49
+
- (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
59
50
60
-
- (b) The contribution is based upon previous work that, to the best of my knowledge, is
61
-
covered under an appropriate open source license and I have the right under that license
62
-
to submit that work with modifications, whether created in whole or in part by me, under
63
-
the same open source license (unless I am permitted to submit under a different
64
-
license), as indicated in the file; or
51
+
- (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
65
52
66
-
- (c) The contribution was provided directly to me by some other person who certified
67
-
(a), (b) or (c) and I have not modified it.
53
+
- (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
68
54
69
-
- (d) I understand and agree that this project and the contribution are public and that a
70
-
record of the contribution (including all personal information I submit with it,
71
-
including my sign-off) is maintained indefinitely and may be redistributed consistent
72
-
with this project or the open source license(s) involved.
55
+
- (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
This plugin provides a syntax for including local variables and expressions in your templates, and also extends custom tags to act as helpers for conditionals and looping.
33
28
34
29
You have full control over the delimiters used for injecting locals, as well as the tag names for the conditional and loop helpers, if you need them. All options that can be passed to the `exp` plugin are shown below:
@@ -47,22 +42,22 @@ You can inject locals into any piece of content in your html templates, other th
@@ -92,8 +87,7 @@ You would see the following output:
92
87
In your browser, you would see the angle brackets, and it would appear as intended. However, if you wanted it instead to be parsed as html, you would need to use the `unescapeDelimiters`, which by default are three curly brackets, like this:
93
88
94
89
```html
95
-
<p>The fox said, {{{ statement }}}</p>
96
-
90
+
<p>The fox said, {{{ strongStatement }}}</p>
97
91
```
98
92
99
93
In this case, your code would render as html:
@@ -112,7 +106,6 @@ You are not limited to just directly rendering local variables either, you can i
112
106
113
107
With this in mind, it is strongly recommended to limit the number and complexity of expressions that are run directly in your template. You can always move the logic back to your config file and provide a function to the locals object for a smoother and easier result. For example:
114
108
115
-
116
109
```js
117
110
exp({
118
111
locals: {
@@ -159,7 +152,7 @@ Your result would be only this:
159
152
160
153
Anything in the `condition` attribute is evaluated directly as an expression.
161
154
162
-
It should be noted that this is slightly cleaner-looking if you are using the [SugarML](https://github.com/posthtml/sugarml). But then again so is every other part of html.
155
+
It should be noted that this is slightly cleaner-looking if you are using the [SugarML parser](https://github.com/posthtml/sugarml). But then again so is every other part of html.
163
156
164
157
```sml
165
158
if(condition="foo === 'bar'")
@@ -177,8 +170,8 @@ You can use the `each` tag to build loops. It works with both arrays and objects
177
170
```js
178
171
exp({
179
172
locals: {
180
-
array: ['foo', 'bar'],
181
-
object: { foo:'bar' }
173
+
anArray: ['foo', 'bar'],
174
+
anObject: { foo:'bar' }
182
175
}
183
176
})
184
177
```
@@ -199,7 +192,7 @@ Output:
199
192
And an example using an object:
200
193
201
194
```html
202
-
<eachloop="key, value in anObject">
195
+
<eachloop="value, key in anObject">
203
196
<p>{{ key }}: {{ value }}</p>
204
197
</each>
205
198
```
@@ -222,57 +215,10 @@ So this would also be fine:
222
215
223
216
So you don't need to declare all the available variables (in this case, the index is skipped), and the expression after `in` doesn't need to be a local variable, it can be any expression.
0 commit comments