DEV Community

Cover image for Shinny-ssg CLI Tool
Emily
Emily

Posted on • Edited on

2

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 and .md 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, language attribute for HTML files 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
  • If there is no error, the app exits with code 0, otherwhise it exits with code -1

Command

shinny-ssg.exe -h

shinny-ssg.exe -i <filePath>

shinny-ssg.exe -i <path> -o <folder path>

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay