Skip to content

Yoda-Canada/Magic-SSG

Repository files navigation

Magic Static Site Generator

       Magic-SSG is a simple Static Site Generator tool, and it can help you to generate .html from . txt files. Current version is 0.1 .

Features

       So far, this tool has the following functions:

  • Allows the user to specify an input file or folder to open a .txt file and generate a .html file.
  • Automatically identify titles and content.
  • Specify a different output directory using --output or -o.
  • Allow the input to be a deep tree of files and folders.
  • Allow user to check the tool's version.
  • Allow the language input and SSG can generate the lang attribute on the root element
  • Allow user to supply a JSON formatted configuration file

Installation

       Make sure you have installed Python version 3.8.5 or above.

How to use

  1. Generate a .html file from a file or folder:

    python magic_ssg/ssg_main.py -i/--input <file name or folder name>

  2. Specify a different output directory using --output or -o.

    python magic_ssg/ssg_main.py --input <input file name or folder name> --output <out put folder>

  3. Check the tool's version

    python magic_ssg/ssg_main.py –v/--version

  4. Display how to use the tool

    python magic_ssg/ssg_main.py –h

  5. Input the language

    python magic_ssg/ssg_main.py -i file_name -l language

  6. Input a JSON config file

    python magic_ssg/ssg_main.py -c file_name

Example 1

Full list of features:

Alt Text

input file:

Alt Text

output file:

Alt Text

Example 2

Convert a file named test.txt and select language- Fr

python magic_ssg/ssg_main.py -i test.txt -l Fr

Example 3

python magic_ssg/ssg_main.py -c ssg-config.json

input file

// ssg-config.json
{
    "input": "./test.txt",
    "lang": "en-CA"
}

Alt Text

output file

Alt Text

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published