Open hagenburger opened 5 years ago
Allow inline JavaScript to create or manipulate content.
Tbd.
The following Markdown:
# Overview of plugins <?js const fs = require("fs") const dir = "./plugins" const links = [] fs.readdirSync(dir).forEach(file => { const path = dir + "/" + file if (fs.statSync(path).isDirectory()) { links.push(`<li><a href="${path}/README.md">${file}</a></li>`) } }) const html = `<ul>\n ${links.join("\n ")}\n</ul>` return html ?>
Should generate (assuming it was called from this repository):
<h1>Overview of plugins</h1> <ul> <li><a href="./plugins/classes/README.md">classes</a></li> <li><a href="./plugins/gulp-pimd/README.md">gulp-pimd</a></li> <li><a href="./plugins/highlight/README.md">highlight</a></li> <li><a href="./plugins/html-injector/README.md">html-injector</a></li> <li><a href="./plugins/id/README.md">id</a></li> <li><a href="./plugins/preview/README.md">preview</a></li> <li><a href="./plugins/prism/README.md">prism</a></li> <li><a href="./plugins/showmore/README.md">showmore</a></li> </ul>
New feature
Allow inline JavaScript to create or manipulate content.
Specifications
Tbd.
Example use cases
Create a list out of files
The following Markdown:
Should generate (assuming it was called from this repository):