A simple Rust-based static website generator that converts Markdown files into HTML. This tool allows you to customize the appearance of your HTML output with customizable background and text colors. It also supports the use of custom HTML templates.
- Converts Markdown (
.md) files to HTML - Customizable background and text colors
- Supports custom HTML templates for the output
- Built with Rust using
clap,pulldown_cmark, andterafor templating
-
Clone this repository to your local machine:
git clone https://github.com/stigsec/Rust-Static-Website-Generator.git cd Rust-Static-Website-Generator -
Build the project using Cargo:
cargo build --release
This will compile the project and place the binary in the
target/releasedirectory. -
You can now run the tool using the following command:
./target/release/rswg -i input.md -o output.html -bg-c=black -txt-c=white -t templates/basic.html
Replace
input.mdwith the path to your Markdown file,output.htmlwith the desired output HTML file name, and specify the template you want to use (e.g.,templates/basic.html).
Usage: rswg [OPTIONS] --input <input> --output <output> --template <template>
Options:
-i, --input <input> Input markdown file
-o, --output <output> Output HTML file
--bg-c <background-color> Background color [default: white]
--txt-c <text-colorR> Text color [default: black]
-t, --template <template> Path to the custom HTML template, eg. /home/user/rswg-tempaltes/basic.html
-h, --help Print help
-V, --version Print versionTo convert a Markdown file README.md to index.html with a black background and white text, using the basic.html template, you would run:
rswg -i README.md -o index.html -bg-c=black -txt-c=white -t templates/basic.html- basic.html: A simple, minimal template.
- nav-footer.html: A template with a navigation bar and footer.
Feel free to add your own templates in the templates/ directory.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.
Developed by stigsec.