highmark-yapp 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -40
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,49 +93,22 @@ const content = `
|
|
|
93
93
|
Then it is just a question of mounting the node:
|
|
94
94
|
|
|
95
95
|
```
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
node = nodeFromTokens(tokens);
|
|
106
|
-
domElement = this.getDOMElement(),
|
|
107
|
-
parentDOMElement = domElement, ///
|
|
108
|
-
siblingDOMElement = null;
|
|
109
|
-
|
|
110
|
-
node.mount(parentDOMElement, siblingDOMElement, context);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
willUnmount() {
|
|
114
|
-
///
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
static tagName = "article";
|
|
118
|
-
}
|
|
96
|
+
const body = document.querySelector("body"),
|
|
97
|
+
domElement = body, ///
|
|
98
|
+
parentDOMElement = domElement, ///
|
|
99
|
+
siblingDOMElement = null,
|
|
100
|
+
context = {
|
|
101
|
+
tokens
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
node.mount(parentDOMElement, siblingDOMElement, context);
|
|
119
105
|
```
|
|
120
106
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
```
|
|
125
|
-
import Article from "../article";
|
|
126
|
-
|
|
127
|
-
export default class ArchitectureArticle extends Article {
|
|
128
|
-
static title = "Architecture";
|
|
129
|
-
|
|
130
|
-
static content = `
|
|
131
|
-
|
|
132
|
-
...
|
|
133
|
-
|
|
134
|
-
`;
|
|
135
|
-
}
|
|
136
|
-
```
|
|
107
|
+
Note the use of the tokens in a `context` plain old JavaScript object that must be padded to the node's `mount()` method along with the parent and sibling DOM elements.
|
|
108
|
+
This is why there are two utility functions to create the node in two stages.
|
|
109
|
+
By the way, the sibling DOM element, if not null, must be a child of the parent DOM element, in which case the node will be mounted immediately *before* it.
|
|
137
110
|
|
|
138
|
-
Note that the usual delimiters for block listings consisting of three backticks have been replaced with three single quotes `'''`.
|
|
111
|
+
Note also that the usual delimiters for block listings consisting of three backticks have been replaced with three single quotes `'''`.
|
|
139
112
|
This generally makes things easier when working inside string template literals that use backticks for delimiters of course.
|
|
140
113
|
|
|
141
114
|
## Building
|
package/package.json
CHANGED