highmark-yapp 2.0.178 → 2.0.181
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 +9 -11
- package/example.js +2631 -2676
- package/lib/blockListing.js +22 -2
- package/lib/node/html/listing/block.js +32 -34
- package/package.json +2 -2
- package/src/blockListing.js +24 -0
- package/src/node/html/listing/block.js +30 -38
- package/lib/constants.js +0 -13
- package/src/constants.js +0 -3
package/README.md
CHANGED
|
@@ -73,20 +73,21 @@ 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 `tokensFromMarkdown()`, `markdownNodeFromTokens()` and `topmostHTMLNodeFromMarkdownNode()` utility functions:
|
|
77
77
|
|
|
78
78
|
```
|
|
79
79
|
import { markdownUtilities } from "highmark-yapp";
|
|
80
80
|
|
|
81
|
-
const {
|
|
81
|
+
const { tokensFromMarkdown, markdownNodeFromTokens } = markdownUtilities;
|
|
82
82
|
|
|
83
|
-
const
|
|
83
|
+
const markdown = `
|
|
84
84
|
|
|
85
85
|
...
|
|
86
86
|
|
|
87
87
|
`,
|
|
88
|
-
tokens =
|
|
89
|
-
|
|
88
|
+
tokens = tokensFromMarkdown(markdown),
|
|
89
|
+
markdownNode = markdownNodeFromTokens(tokens),
|
|
90
|
+
topmostHTMLNode = topmostHTMLNodeFromMarkdownNode(markdownNode);
|
|
90
91
|
|
|
91
92
|
```
|
|
92
93
|
|
|
@@ -101,15 +102,12 @@ const body = document.querySelector("body"),
|
|
|
101
102
|
tokens
|
|
102
103
|
};
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
topmostHTMLNode.mount(parentDOMElement, siblingDOMElement, context);
|
|
105
106
|
```
|
|
106
107
|
|
|
107
|
-
Note the use of the tokens in a `context` plain old JavaScript object that must be
|
|
108
|
+
Note the use of the tokens in a `context` plain old JavaScript object that must be passed to the topmost HTML node's `mount()` method along with the parent and sibling DOM elements.
|
|
108
109
|
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
|
|
110
|
-
|
|
111
|
-
Note also that the usual delimiters for block listings consisting of three backticks have been replaced with three single quotes `'''`.
|
|
112
|
-
This generally makes things easier when working inside string template literals that use backticks for delimiters.
|
|
110
|
+
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 after it.
|
|
113
111
|
|
|
114
112
|
## Building
|
|
115
113
|
|