mdapply
v0.3.0
Published
[](https://www.lmpify.com/consider-this-result-fwdb1a0)
Readme
mdapply
A CLI tool to extract code blocks from markdown files and create actual files from them.
Usage
npx mdapply <markdown-file-or-url>Supported Code Block Formats
The tool looks for code blocks with file path parameters:
Using path parameter:
```js path="src/index.js"
console.log("Hello, world!");
```You can also use name or title
Features
- 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
Flow
- 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
Example
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
