Skip to content

Commit 6b4781d

Browse files
docs(INDEX): add source code docs
1 parent 28265a5 commit 6b4781d

File tree

1 file changed

+211
-0
lines changed

1 file changed

+211
-0
lines changed

INDEX.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
## Modules
2+
3+
<dl>
4+
<dt><a href="#module_backup">backup</a> : <code>Object</code></dt>
5+
<dd></dd>
6+
<dt><a href="#module_escape">escape</a> : <code>function</code></dt>
7+
<dd></dd>
8+
<dt><a href="#module_posthtml-expressions">posthtml-expressions</a> ⇒ <code>Object</code></dt>
9+
<dd><p>Expressions Plugin for PostHTML</p>
10+
</dd>
11+
<dt><a href="#module_loops">loops</a> : <code>function</code></dt>
12+
<dd></dd>
13+
<dt><a href="#module_placeholders">placeholders</a> : <code>function</code></dt>
14+
<dd></dd>
15+
<dt><a href="#module_tags">tags</a> : <code>function</code></dt>
16+
<dd></dd>
17+
</dl>
18+
19+
## Functions
20+
21+
<dl>
22+
<dt><a href="#makeLocalsBackup">makeLocalsBackup(keys, locals)</a> ⇒ <code>Object</code></dt>
23+
<dd><p>Creates a backup of keys values</p>
24+
</dd>
25+
<dt><a href="#revertBackupedLocals">revertBackupedLocals(keys, locals, backup)</a> ⇒ <code>Object</code></dt>
26+
<dd><p>Returns the original keys values</p>
27+
</dd>
28+
<dt><a href="#escapeRegexpString">escapeRegexpString(input)</a> ⇒ <code>function</code></dt>
29+
<dd><p>Replace String based on RegExp</p>
30+
</dd>
31+
<dt><a href="#executeLoop">executeLoop(params, p1, p2, locals, tree)</a> ⇒ <code>function</code></dt>
32+
<dd><p>Creates a set of local variables within the loop, and evaluates all nodes within the loop, returning their contents</p>
33+
</dd>
34+
<dt><a href="#executeScope">executeScope(scope, locals, node)</a> ⇒ <code>function</code></dt>
35+
<dd><p>Runs walk function with arbitrary set of local variables</p>
36+
</dd>
37+
<dt><a href="#parseLoopStatement">parseLoopStatement(input)</a> ⇒ <code>Object</code></dt>
38+
<dd><p>Given a &quot;loop&quot; parameter from an &quot;each&quot; tag, parses out the param names and expression to be looped.</p>
39+
</dd>
40+
<dt><a href="#escapeHTML">escapeHTML(unescaped)</a> ⇒ <code>String</code></dt>
41+
<dd><p>Escape HTML characters with their respective entities</p>
42+
</dd>
43+
<dt><a href="#placeholders">placeholders(input, ctx, settings)</a> ⇒ <code>String</code></dt>
44+
<dd><p>Replace Expressions</p>
45+
</dd>
46+
<dt><a href="#getNextTag">getNextTag(nodes, i)</a> ⇒ <code>Array</code></dt>
47+
<dd><p>Get the nect tag from a node list</p>
48+
</dd>
49+
</dl>
50+
51+
<a name="module_backup"></a>
52+
53+
## backup : <code>Object</code>
54+
**Requires**: <code>module:fclone</code>
55+
**Properties**
56+
57+
| Name | Type | Description |
58+
| --- | --- | --- |
59+
| make | <code>function</code> | Make Locals backup |
60+
| revert | <code>function</code> | Revert backuped Locals |
61+
62+
<a name="module_escape"></a>
63+
64+
## escape : <code>function</code>
65+
<a name="module_posthtml-expressions"></a>
66+
67+
## posthtml-expressions ⇒ <code>Object</code>
68+
Expressions Plugin for PostHTML
69+
70+
**Returns**: <code>Object</code> - tree PostHTML Tree
71+
**Requires**: <code>module:vm</code>, <code>module:./tags</code>, <code>module:./loops</code>, <code>module:./escape</code>, <code>module:./backup</code>, <code>module:./placeholders</code>
72+
**Version**: 1.0.0
73+
**Author:** Jeff Escalante Denis (@jescalan),
74+
Malinochkin (mrmlnc),
75+
Michael Ciniawsky (@michael-ciniawsky)
76+
**License**: MIT
77+
78+
| Param | Type | Description |
79+
| --- | --- | --- |
80+
| options | <code>Object</code> | Options |
81+
82+
<a name="module_loops"></a>
83+
84+
## loops : <code>function</code>
85+
<a name="module_placeholders"></a>
86+
87+
## placeholders : <code>function</code>
88+
**Requires**: <code>module:vm</code>
89+
<a name="module_tags"></a>
90+
91+
## tags : <code>function</code>
92+
<a name="makeLocalsBackup"></a>
93+
94+
## makeLocalsBackup(keys, locals) ⇒ <code>Object</code>
95+
Creates a backup of keys values
96+
97+
**Kind**: global function
98+
**Returns**: <code>Object</code> - backup Backup Locals
99+
100+
| Param | Type | Description |
101+
| --- | --- | --- |
102+
| keys | <code>Object</code> | Keys |
103+
| locals | <code>Object</code> | Locals |
104+
105+
<a name="revertBackupedLocals"></a>
106+
107+
## revertBackupedLocals(keys, locals, backup) ⇒ <code>Object</code>
108+
Returns the original keys values
109+
110+
**Kind**: global function
111+
**Returns**: <code>Object</code> - locals Reverted Locals
112+
113+
| Param | Type | Description |
114+
| --- | --- | --- |
115+
| keys | <code>Object</code> | Keys |
116+
| locals | <code>Object</code> | Locals |
117+
| backup | <code>Object</code> | Backup |
118+
119+
<a name="escapeRegexpString"></a>
120+
121+
## escapeRegexpString(input) ⇒ <code>function</code>
122+
Replace String based on RegExp
123+
124+
**Kind**: global function
125+
**Returns**: <code>function</code> - input Replaced Input
126+
127+
| Param | Type | Description |
128+
| --- | --- | --- |
129+
| input | <code>String</code> | Input |
130+
131+
<a name="executeLoop"></a>
132+
133+
## executeLoop(params, p1, p2, locals, tree) ⇒ <code>function</code>
134+
Creates a set of local variables within the loop, and evaluates all nodes within the loop, returning their contents
135+
136+
**Kind**: global function
137+
**Returns**: <code>function</code> - walk Walks the tree and parses all locals within the loop
138+
139+
| Param | Type | Description |
140+
| --- | --- | --- |
141+
| params | <code>Array</code> | Parameters |
142+
| p1 | <code>String</code> | Parameter 1 |
143+
| p2 | <code>String</code> | Parameter 2 |
144+
| locals | <code>Object</code> | Locals |
145+
| tree | <code>String</code> | Tree |
146+
147+
<a name="executeScope"></a>
148+
149+
## executeScope(scope, locals, node) ⇒ <code>function</code>
150+
Runs walk function with arbitrary set of local variables
151+
152+
**Kind**: global function
153+
**Returns**: <code>function</code> - walk Walks the tree and parses all locals in scope
154+
155+
| Param | Type | Description |
156+
| --- | --- | --- |
157+
| scope | <code>Object</code> | Scoped Locals |
158+
| locals | <code>Object</code> | Locals |
159+
| node | <code>Object</code> | Node |
160+
161+
<a name="parseLoopStatement"></a>
162+
163+
## parseLoopStatement(input) ⇒ <code>Object</code>
164+
Given a "loop" parameter from an "each" tag, parses out the param names and expression to be looped.
165+
166+
**Kind**: global function
167+
**Returns**: <code>Object</code> - {} Keys && Expression
168+
169+
| Param | Type | Description |
170+
| --- | --- | --- |
171+
| input | <code>String</code> | Input |
172+
173+
<a name="escapeHTML"></a>
174+
175+
## escapeHTML(unescaped) ⇒ <code>String</code>
176+
Escape HTML characters with their respective entities
177+
178+
**Kind**: global function
179+
**Returns**: <code>String</code> - escaped Save HTML
180+
181+
| Param | Type | Description |
182+
| --- | --- | --- |
183+
| unescaped | <code>String</code> | Unsafe HTML |
184+
185+
<a name="placeholders"></a>
186+
187+
## placeholders(input, ctx, settings) ⇒ <code>String</code>
188+
Replace Expressions
189+
190+
**Kind**: global function
191+
**Returns**: <code>String</code> - input Replaced Input
192+
193+
| Param | Type | Description |
194+
| --- | --- | --- |
195+
| input | <code>String</code> | Input |
196+
| ctx | <code>Object</code> | Context |
197+
| settings | <code>Array</code> | Settings |
198+
199+
<a name="getNextTag"></a>
200+
201+
## getNextTag(nodes, i) ⇒ <code>Array</code>
202+
Get the nect tag from a node list
203+
204+
**Kind**: global function
205+
**Returns**: <code>Array</code> - [] Array containing the next tag in nodes
206+
207+
| Param | Type | Description |
208+
| --- | --- | --- |
209+
| nodes | <code>Array</code> | Nodes |
210+
| i | <code>Number</code> | Accumulator |
211+

0 commit comments

Comments
 (0)