NA
nathanclevenger/mdxe
Zero-config executable MDX runner. Run your MDX files directly from the command line!
mdxe
Zero-config executable MDX runner. Run your MDX files directly from the command line!
Installation
# Global installation
npm install -g mdxe
# Or use with npx
npx mdxeUsage
# Run a specific MDX file
mdxe path/to/file.mdx
# Run with npx
npx mdxe path/to/file.mdx
# Run in current directory
mdxeExamples
Web Page
---
title:
description:
---
# Hello World!
This web page was rendered with [mdxe](https://mdxe.js.org)
Making MDX Files Executable
You can make your MDX files directly executable in two ways:
-
Using the CLI command:
mdxe make-executable file.mdx
This will:
- Add the shebang line (
#!/usr/bin/env mdxe) if it's not present - Make the file executable (
chmod +x)
- Add the shebang line (
-
Manually:
- Add the shebang line at the top of your MDX file:
#!/usr/bin/env mdxe # My MDX File Content goes here... - Make the file executable:
chmod +x file.mdx
- Add the shebang line at the top of your MDX file:
After making a file executable, you can run it directly:
./file.mdxWhen running without a file argument, mdxe will:
- Execute the single MDX file if only one exists in the current directory
- Present a selection menu if multiple MDX files are found
- Show a message if no MDX files are found
Features
- Zero configuration required
- Supports both global installation and npx usage
- Interactive file selection when multiple MDX files are present
- Automatic MDX compilation and execution
- Beautiful CLI output with helpful error messages
- Support for executable MDX files with shebang
- CLI command to make files executable
License
MIT