highmark-yapp 1.0.10 → 1.0.11
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 +11 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,23 +73,24 @@ renderYappStyles();
|
|
|
73
73
|
...
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
Next, to create a node from some Markdown content, use the `
|
|
76
|
+
Next, to create a node from some Markdown content, use the `tokensFromContent()` and `nodeFromTokens()` utility functions:
|
|
77
77
|
|
|
78
78
|
```
|
|
79
79
|
import { markdownUtilities } from "highmark-yapp";
|
|
80
80
|
|
|
81
|
-
const {
|
|
81
|
+
const { tokensFromContent, nodeFromTokens } = markdownUtilities;
|
|
82
82
|
|
|
83
83
|
const content = `
|
|
84
84
|
|
|
85
85
|
...
|
|
86
86
|
|
|
87
87
|
`,
|
|
88
|
-
|
|
88
|
+
tokens = tokensFromContent(node),
|
|
89
|
+
node = nodeFromTokens(tokens);
|
|
89
90
|
|
|
90
91
|
```
|
|
91
92
|
|
|
92
|
-
Then it is just a question of mounting the node
|
|
93
|
+
Then it is just a question of mounting the node:
|
|
93
94
|
|
|
94
95
|
```
|
|
95
96
|
import { Element } from "easy";
|
|
@@ -100,9 +101,13 @@ const { nodeFromContent } = markdownUtilities;
|
|
|
100
101
|
class Article extends Element {
|
|
101
102
|
didMount() {
|
|
102
103
|
const { content } = this.constructor,
|
|
103
|
-
|
|
104
|
+
tokens = tokensFromContent(node),
|
|
105
|
+
node = nodeFromTokens(tokens);
|
|
106
|
+
domElement = this.getDOMElement(),
|
|
107
|
+
parentDOMElement = domElement, ///
|
|
108
|
+
siblingDOMElement = null;
|
|
104
109
|
|
|
105
|
-
|
|
110
|
+
node.mount(parentDOMElement, siblingDOMElement, context);
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
willUnmount() {
|
package/package.json
CHANGED