This week, I have a chance to create a command line tool to generate an .html file or folder from .txt file. My tool's name is shinny-ssg and it was built with C#, .Net Core 3.1 and Command Line Utils.
Features:
- generate .html files from .txt files with title
- accept folder as input path to generate .html files in the destination folder which will has the same structure as original folder
- give user the options to specify destination folder and/or stylesheet URL link
Options
How to use
- Download or clone the shinny-ssg folder to your local machine
- Use command prompt navigate to the folder netcoreapp3.1 in the shinny-ssg folder ( path
shinny-ssg\bin\Debug\netcoreapp3.1
) - In the command prompt, run shinny-ssg.exe -h to see the options
- The file will be generated in the
shinny-ssg\bin\Debug\netcoreapp3.1\dist
folder by default or in the destination folder if specified by user.
Examples
Source folder:
Command:
shinny-ssg.exe -i C:\Users\khoit\Desktop\OSD600\Sherlock-Holmes-Selected-Stories -o ../../Destination -s https://cdn.jsdelivr.net/npm/water.css@2/out/water.css
File HTML is generated with Css style
Source Code
You can find my source code in this repo:
shinny-ssg Version 0.1 - CLI Tool to generate HTML File
Features
- generate .html files from .txt files
- accept folder as input path to generate .html files in the destionation folder which will has the same structure as the original folder
- give user the options to specify destination folder and/or stylesheet url link
How to use
- Download or clone the shinny-ssg folder to your local machine
- Use command prompt to navigate to the folder netcoreapp3.1 in the shinny-ssg folder ( path
shinny-ssg\bin\Debug\netcoreapp3.1
) - In the command prompt run
shinny-ssg.exe -h
to see the options - The file will be generated in the
shinny-ssg\bin\Debug\netcoreapp3.1\dist
folder by default or in the destination folder if specified by user
Command
shinny-ssg.exe -h
shinny-ssg.exe -i
<filePath>
shinny-ssg.exe -i
<path>
-o<folder path>
-s<stylesheet link>
Option Function
OPTION | Function |
---|---|
-v --version | Name and version |
-h --help | Information |
-s --stylesheet | <'link-to-css-stylesheet'> |
-i --input | specifies an input file or |
Top comments (0)