A CLI tool to extract code blocks from markdown files and create actual files from them.
npx mdapply <markdown-file-or-url>The tool looks for code blocks with file path parameters:
```js path="src/index.js"
console.log("Hello, world!");
```You can also use name or title
- Supports both local markdown files and URLs
- Creates directory structure automatically
- Uses the
markedlibrary for robust markdown parsing - Supports multiple parameter names (
path,name,title) - Handles quoted and unquoted parameter values
- Make a post on X with code examples
- Use xymake URL and a prompt to generate files
- Use
npx mdapply {url}to extract and create the files locally - Test and iterate on the generated code
Given a markdown file with:
```js path="package.json"
{
"name": "my-project",
"version": "1.0.0"
}
```
```js path="src/index.js"
console.log("Starting application...");
```Running npx mdapply example.md will create:
package.jsonsrc/index.js