stylemd
v1.0.1
Published
Generate static HTML pages from Markdown with themes.
Maintainers
Readme
stylemd
A command-line tool to generate static HTML pages from Markdown files, applying various style themes.
Features
- Convert Markdown files to HTML.
- Apply a variety of pre-built themes.
- Simple command-line interface.
- Uses
markedfor Markdown parsing andhandlebarsfor templating.
Installation
There are two ways to install stylemd:
1. Global Installation (Recommended for general use)
If you want to use stylemd as a command-line tool anywhere on your system, install it globally via npm:
npm install -g @ddukbg/stylemdMake sure you have Node.js and npm installed.
2. Local Development Setup
If you want to contribute to the project or modify the code:
- Clone the repository:
git clone https://github.com/ddukbg/stylemd.git # Replace with your actual repo URL if different cd stylemd - Install dependencies:
npm install - Link the package: This allows you to run the
stylemdcommand locally using the cloned code.
Now you can runnpm linkstylemdfrom any directory, and it will use the code in your clonedstylemdfolder.
Usage
stylemd <markdownFile> [options]Arguments:
<markdownFile>: Path to the input Markdown file (e.g.,notes.md,examples/input/example-default.md).
Options:
-t, --template <name>: Template name to use (default:default). See available themes below.-o, --output <file>: Output HTML file path (default:index.html).-h, --help: Display help for command.-V, --version: Output the version number.
Examples:
# Use the 'windows98' theme for 'mydoc.md' and output to 'mypage.html'
stylemd mydoc.md -t windows98 -o mypage.html
# Use the 'terminal' theme for an example file, output to the root
stylemd examples/input/example-terminal.md --template terminal --output example-output-terminal.html
# Use the default theme and output to 'index.html'
stylemd README.mdAvailable Themes
Here are the currently included themes:
default: Clean, modern baseline style suitable for general documents. Live Previewwindows98: Mimics the classic Windows 98 UI elements. Live Previewterminal: Simulates an old-school terminal output with prompt and cursor. Live Previewgeocities: A nostalgic, chaotic, and fun GeoCities-inspired theme. Live Previewblueprint: Technical blueprint style with grid background and annotations. Live Previewmacos-classic: Inspired by the look and feel of macOS Classic (System 7/8/9). Live Previewamiga-workbench: Emulates the Amiga Workbench 1.x interface. Live Previewmsdos: Text-mode interface resembling MS-DOS prompt andedit.com. Live Previewc64: Commodore 64 BASIC screen style with pixel font. Live Previewvim: Minimalist theme inspired by the Vim editor (Solarized Dark). Live Previewretro-console: Monochrome retro game console/HUD interface (like Fallout's Pip-Boy). Live Previewpixel-art: Retro RPG style with pixel font and UI window elements. Live Previewy2k: Early 2000s web design aesthetic with Aqua elements. Live Previewfrutiger-aero: Mid-2000s style with glossy, glassy, and nature-inspired elements. Live Preview
(You can find the corresponding template files in the /templates directory and example markdown files in /examples/input.)
Project Structure
stylemd/
├── bin/ # CLI script
├── templates/ # Theme templates (.hbs)
├── examples/
│ ├── input/ # Example Markdown files
│ └── output/ # Example generated HTML (Git ignored)
├── node_modules/ # Dependencies (Git ignored)
├── .gitignore # Files/folders ignored by Git
├── package.json
├── package-lock.json
└── README.mdCustom Templates
Currently, stylemd only loads templates from its internal /templates directory. Using templates from custom external directories is not yet supported.
Contributing
Contributions are welcome! If you'd like to add new themes, improve existing ones, fix bugs, or add features (like custom template directory support), please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix (
git checkout -b feature/my-new-theme). - Make your changes. Ensure new themes are added as
.hbsfiles in thetemplatesdirectory and consider adding a corresponding example.mdfile inexamples/input. - Test your changes locally.
- Commit your changes (
git commit -am 'Add some feature'). - Push to the branch (
git push origin feature/my-new-theme). - Create a new Pull Request.
Future Plans (Roadmap)
Here are some features planned for future releases:
- Custom Template Directory: Support for loading themes from a user-specified directory (
--template-diroption). This will allow users to easily create and use their own themes without modifying the core package. - Watch Mode: A
--watchflag to automatically re-generate the HTML file when the source Markdown file is modified, providing a live preview experience during editing. - Directory Conversion: Ability to process an entire directory of Markdown files at once, converting each
.mdfile into a corresponding HTML file, potentially mirroring the input directory structure.
Contributions towards these features are welcome!
License
This project is licensed under the MIT License. See the LICENSE file for details (assuming you will add one).
