Static site generator (SSG) is undoubtedly one of the trending web development technologies in the last few years. There are already hundreds of them out there.
However, I'd like to contribute a minimal SSG for text files to the open source community. I believe this is a wonderful opportunity to learn about SSG.
Without further ado...
Silkie
Static site generator with the smoothness of silk
Silkie is a simple and smooth static site generator. It can parse text files (".txt" files) and generate HTML files from them.
Check out the demo generated from this text file (with help from new.css).
$ python3 silkie.py -h
Usage: silkie.py [OPTIONS]
  Static site generator with the smoothness of silk
Options:
  -v, --version          Show the version and exit.
  -h, --help             Show this message and exit.
  -i, --input PATH       Path to the input file/folder  [required]
  -s, --stylesheet TEXT  URL path to a stylesheet
Features
- Generate HTML file(s) from a specified text file/directory
- Detect the title of a file if it's the first line followed by two blank lines
- Add custom styling to static site
Getting Started
Prerequisites
- Python >= 3.9.0
- Pip >= 21.2.4
Installation
- Clone the repository
- 
Create a virtual environment 
 cd silkie && python3 -m venv .
- 
Activate your virtual environment - 
Windows: bin\Scripts\activate.bat
- 
Unix or MacOS: source bin/activate
 
- 
Windows: 
- 
Install the dependency packages 
 pip3 install -r requirements.txt
Usage
- Activate your virtual environment (only if you have not done that)
- 
Run the program 
 python3 silkie.py -h
Contributing
Feel free to make any pull requests here. For major changes, please open an issue to discuss what you would like to change.
Happy coding!
 


 
    
Top comments (0)