DEV Community

Cover image for Shinny-ssg CLI Tool
Emily
Emily

Posted on • Edited on

Shinny-ssg CLI Tool

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

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:
Alt Text
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

Destination folder
Alt Text

File HTML is generated with Css style
Alt Text

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)