Modern SSG is a Static Site Generator which helps to convert text files to HTML made with Apple Swift version 5.4.2 with help of Argument Parser.
OVERVIEW: A program to convert text files to HTML site generator
USAGE: ModernSSG --input [--stylesheet ] [--output] [--image]
OPTIONS:
-i, --input allow the user to specify an input file or folder to
be processed
-s, --stylesheet
allow the user to optionally specify a URL to a CSS
stylesheet.
-o, --output allow the user to specify an output folder to be
processed.
--image
--version Show the version.
-h, --help Show help information.
This command allows the version to specify the current version of the tool.
swift run ModernSSG --version
ModernSSG 0.0.1
This commands allows the user to specify the input file present in desktop directory for the command line tool to read and look for same file. Please mention the file extension to avoid reading error.
swift run ModernSSG --input "your text file"
swift run ModernSSG --config modernSsgConfing.json
This commands allows the user to specify the output folder present in current directory for the command line tool to read and move all output files to this folder.
swift run ModernSSG --input "your text file" --output "your output folder name"
This commands allows the user to specify the input folder/directory present in current directory for the command line tool to read and look for all files.
swift run ModernSSG -i "your input folder directory"
This command allow the user to specify a stylesheet URL to be processed on all files present in dist folder.
swift run ModernSSG --input "your text file" --stylesheet "your link here" "https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
This command allow the user to specify a image URL to be processed on file present in dist folder.
swift run ModernSSG --input "your text file" --image "your link here" "https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
Before "your filename.txt"
My first SSG Generator file
This is my first paragraph
This is my second paragraph
After "your filename.html"
<!doctype html>
<html>
<head>
<LINK rel='stylesheet' href="URL">
<meta charset='utf-8'>
<title>"Your filename"</title>
<meta name='viewport' content='width=device-width', initial-scale=1'>
</head>
<body>
<h1>This is my first SSG Generator file</h1>
<p>This is my first paragraph</p>
<p>This is my second paragraph</p>
</body>
</html>"
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Build a Command Line Tool Using Swift Argument Parser by Riccardo