Skip to content

Commit 85772c9

Browse files
committed
Add note regarding algorithm
1 parent 6e5bc57 commit 85772c9

File tree

1 file changed

+20
-0
lines changed
  • tools/remark/plugins/remark-run-javascript-examples

1 file changed

+20
-0
lines changed

tools/remark/plugins/remark-run-javascript-examples/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@ function done( error ) {
3434

3535
<section class="notes">
3636

37+
## Notes
38+
39+
- When processing a Markdown abstract syntax tree (AST), the plugin scans the tree for `section` elements with the class `examples`. For example,
40+
41+
<!-- lint disable code-block-style -->
42+
43+
<section class="examples">
44+
45+
## Examples
46+
47+
```javascript
48+
console.log( 'HELLO WORLD' );
49+
```
50+
51+
</section>
52+
53+
<!-- /.examples -->
54+
55+
Upon finding an examples section, the plugin scans for JavaScript fenced code blocks. For each JavaScript code block, the plugin extracts example code and runs that code in a separate child process.
56+
3757
</section>
3858

3959
<!-- /.notes -->

0 commit comments

Comments
 (0)