Skip to content

Commit c0b53c4

Browse files
devvaannshabose
authored andcommitted
docs: add htmlsimpledom.js and missing JSDoc content
1 parent 34ab8de commit c0b53c4

File tree

6 files changed

+419
-32
lines changed

6 files changed

+419
-32
lines changed

docs/API-Reference/language/CSSUtils.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,30 @@ const CSSUtils = brackets.getModule("language/CSSUtils")
99
Set of utilities for simple parsing of CSS text.
1010

1111
**Kind**: global variable
12+
<a name="SELECTOR"></a>
13+
14+
## SELECTOR : <code>string</code>
15+
CSS selector, used to target specific elements
16+
17+
**Kind**: global constant
18+
<a name="PROP_NAME"></a>
19+
20+
## PROP\_NAME : <code>string</code>
21+
name of the property
22+
23+
**Kind**: global constant
24+
<a name="PROP_VALUE"></a>
25+
26+
## PROP\_VALUE : <code>string</code>
27+
value of the specified property
28+
29+
**Kind**: global constant
30+
<a name="IMPORT_URL"></a>
31+
32+
## IMPORT\_URL : <code>string</code>
33+
url for import
34+
35+
**Kind**: global constant
1236
<a name="isCSSPreprocessorFile"></a>
1337

1438
## isCSSPreprocessorFile(filePath) ⇒ <code>boolean</code>
@@ -189,6 +213,17 @@ selector(s) for the first rule.
189213
| --- | --- | --- |
190214
| range | <code>TextRange</code> | The range to extract the selector(s) from. |
191215

216+
<a name="getAllCssSelectorsInProject"></a>
217+
218+
## getAllCssSelectorsInProject(options)
219+
Responsible to get all the CSS selectors in project
220+
221+
**Kind**: global function
222+
223+
| Param | Type |
224+
| --- | --- |
225+
| options | <code>Object</code> |
226+
192227
<a name="SelectorInfo"></a>
193228

194229
## SelectorInfo : <code>Object</code>
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
### Import :
2+
```js
3+
const HTMLSimpleDOM = brackets.getModule("language/HTMLSimpleDOM")
4+
```
5+
6+
<a name="SimpleNode"></a>
7+
8+
## SimpleNode
9+
**Kind**: global class
10+
11+
* [SimpleNode](#SimpleNode)
12+
* [new SimpleNode(properties)](#new_SimpleNode_new)
13+
* [.update()](#SimpleNode+update)
14+
* [.updateAttributeSignature()](#SimpleNode+updateAttributeSignature)
15+
* [.isElement()](#SimpleNode+isElement) ⇒ <code>bool</code>
16+
* [.isText()](#SimpleNode+isText) ⇒ <code>bool</code>
17+
18+
<a name="new_SimpleNode_new"></a>
19+
20+
### new SimpleNode(properties)
21+
A SimpleNode represents one node in a SimpleDOM tree. Each node can have
22+
any set of properties on it, though there are a couple of assumptions made.
23+
Elements will have `children` and `attributes` properties. Text nodes will have a `content`
24+
property. All Elements will have a `tagID` and text nodes *can* have one.
25+
26+
27+
| Param | Type | Description |
28+
| --- | --- | --- |
29+
| properties | <code>Object</code> | the properties provided will be set on the new object. |
30+
31+
<a name="SimpleNode+update"></a>
32+
33+
### simpleNode.update()
34+
Updates signatures used to optimize the number of comparisons done during
35+
diffing. This is important to call if you change:
36+
37+
* children
38+
* child node attributes
39+
* text content of a text node
40+
* child node text
41+
42+
**Kind**: instance method of [<code>SimpleNode</code>](#SimpleNode)
43+
<a name="SimpleNode+updateAttributeSignature"></a>
44+
45+
### simpleNode.updateAttributeSignature()
46+
Updates the signature of this node's attributes. Call this after making attribute changes.
47+
48+
**Kind**: instance method of [<code>SimpleNode</code>](#SimpleNode)
49+
<a name="SimpleNode+isElement"></a>
50+
51+
### simpleNode.isElement() ⇒ <code>bool</code>
52+
Is this node an element node?
53+
54+
**Kind**: instance method of [<code>SimpleNode</code>](#SimpleNode)
55+
**Returns**: <code>bool</code> - true if it is an element
56+
<a name="SimpleNode+isText"></a>
57+
58+
### simpleNode.isText() ⇒ <code>bool</code>
59+
Is this node a text node?
60+
61+
**Kind**: instance method of [<code>SimpleNode</code>](#SimpleNode)
62+
**Returns**: <code>bool</code> - true if it is text
63+
<a name="Builder"></a>
64+
65+
## Builder
66+
**Kind**: global class
67+
68+
* [Builder](#Builder)
69+
* [new Builder(text, startOffset, startOffsetPos)](#new_Builder_new)
70+
* [.getID](#Builder+getID) ⇒ <code>int</code>
71+
* [.build(strict, markCache)](#Builder+build)[<code>SimpleNode</code>](#SimpleNode)
72+
* [.getNewID()](#Builder+getNewID) ⇒ <code>int</code>
73+
74+
<a name="new_Builder_new"></a>
75+
76+
### new Builder(text, startOffset, startOffsetPos)
77+
A Builder creates a SimpleDOM tree of SimpleNode objects representing the
78+
"important" contents of an HTML document. It does not include things like comments.
79+
The nodes include information about their position in the text provided.
80+
81+
82+
| Param | Type | Description |
83+
| --- | --- | --- |
84+
| text | <code>string</code> | The text to parse |
85+
| startOffset | <code>int</code> | starting offset in the text |
86+
| startOffsetPos | <code>Object</code> | line/ch position in the text |
87+
88+
<a name="Builder+getID"></a>
89+
90+
### builder.getID ⇒ <code>int</code>
91+
Returns the best tag ID for the new tag object given.
92+
The default implementation just calls `getNewID`
93+
and returns a unique ID.
94+
95+
**Kind**: instance property of [<code>Builder</code>](#Builder)
96+
**Returns**: <code>int</code> - unique tag ID
97+
98+
| Param | Type | Description |
99+
| --- | --- | --- |
100+
| newTag | <code>Object</code> | tag object to potentially inspect to choose an ID |
101+
102+
<a name="Builder+build"></a>
103+
104+
### builder.build(strict, markCache) ⇒ [<code>SimpleNode</code>](#SimpleNode)
105+
Builds the SimpleDOM.
106+
107+
**Kind**: instance method of [<code>Builder</code>](#Builder)
108+
**Returns**: [<code>SimpleNode</code>](#SimpleNode) - root of tree or null if parsing failed
109+
110+
| Param | Type | Description |
111+
| --- | --- | --- |
112+
| strict | <code>bool</code> | if errors are detected, halt and return null |
113+
| markCache | <code>Object</code> | a cache that can be used in ID generation (is passed to `getID`) |
114+
115+
<a name="Builder+getNewID"></a>
116+
117+
### builder.getNewID() ⇒ <code>int</code>
118+
Returns a new tag ID.
119+
120+
**Kind**: instance method of [<code>Builder</code>](#Builder)
121+
**Returns**: <code>int</code> - unique tag ID
122+
<a name="build"></a>
123+
124+
## build(text, strict) ⇒ [<code>SimpleNode</code>](#SimpleNode)
125+
Builds a SimpleDOM from the text provided. If `strict` mode is true, parsing
126+
will halt as soon as any error is seen and null will be returned.
127+
128+
**Kind**: global function
129+
**Returns**: [<code>SimpleNode</code>](#SimpleNode) - root of tree or null if strict failed
130+
131+
| Param | Type | Description |
132+
| --- | --- | --- |
133+
| text | <code>string</code> | Text of document to parse |
134+
| strict | <code>bool</code> | True for strict parsing |
135+

0 commit comments

Comments
 (0)