Sweet Markdown is a command-line utility designed for converting Markdown files into various formats including PDF, HTML, or images, all while applying the familiar GitHub CSS styling. This tool is ideal for developers, content creators, and anyone interested in distributing their Markdown content in multiple formats without losing the GitHub look and feel.
Ensure the following prerequisites are met before installation:
- Rust and Cargo (required for the installation script)
Sweet Markdown can be installed via:
- Cloning the repository and executing the installation script.
- Downloading the latest release from GitHub.
# Clone the repository
git clone https://github.com/Flokkq/SweetMarkdown/release --depth 1
# Navigate to the directory
cd smd
# Execute the installation script
./scripts/install
After downloading the latest release, execute the following commands based on your operating system:
- Linux & MacOS:
sudo mv path/to/smd /usr/local/bin/smd
- Windows:
copy path\to\smd.exe C:\Windows\System32\smd.exe
The smd
command will now be accessible from your terminal.
- PDF: Portable Document Format
- HTML: HyperText Markup Language
- Image: JPG, PNG, WEBP formats
# Convert a Markdown file to the specified format
smd --input <path/to/file.md> --output <format> --specific <specific-format>
# Example:
smd --input README.md --output pdf
# Or:
smd --input README.md --output img --specific jpg
Sweet Markdown allows for easy customization of markdown rendering through the use of flavors, including the option to create custom ones.
Change the global flavor setting to apply to all markdown renderings:
smd --flavor --set
Select a flavor:
1 > light
2 > dark
3 > auto
flavor:
Alternatively, specify a flavor for a single rendering:
smd --input README.md --output pdf --flavor light
Generate your own custom flavors with --flavor --new [flavor-name]
, starting from a template:
# Flavor name
color-scheme: dark
syntax:
comment: "#8b949e"
constant: "#79c0ff"
entity: "#d2a8ff"
[...]
After customization, add your flavor to the available options with smd --flavor --add /path/to/file
. The .yaml
file will be integrated into Sweet Markdown's configuration directory.
To modify a custom flavor:
smd --flavour --edit
Select a flavor:
1 > light
2 > dark
3 > auto
flavor:
This command opens the .yaml
configuration file for editing.
Note that name changes are prohibited.
After editing, apply the changes with:
smd --flavor --update
Note: Sweet Markdown will incorporate the updated .yaml
file into its configuration directory.
Sweet Markdown is available under the MIT License