DEV Community

Cover image for Glazed Donut: Release 0.1
dbelokon
dbelokon

Posted on

Glazed Donut: Release 0.1

Yay!! I finally have my own open source project😋🙈

Here is some intro to it:

Glazed Donut is a static website generator. Basically what it does it that it generates HTML files from text files.

You can view the project here.

Currently, it has the following features:

  1. It allows you to specify a URL to a CSS stylesheet of your choice that will be used to style the generated HTML files.
  2. You can specify a destination folder where you want your HTML files to be stored. By default, it will store it in the dist folder.
  3. Accepts a text file that will be converted to a static HTML page.
  4. Can convert multiple text files into HTML files at once if you provide a path to a folder with text files that you want to use.
  5. You can check program's version by typing -v or --version in the terminal.
  6. Displays a help message with the command usage instructions if you type -h or --help.

How to use it:

It is very easy to use it. You just have to follow the installation process provided in the README.md.

Then, you can do start playing around!

Example 1:

Firstly, you probably want to know what commands it supports.

go to the terminal and type this:

-h

or

--help

Once you've done it, you will see all the commands that are supported and their definitions, copyright, name and version of the software:
alt text

Example 2:

Scenario 1

Let's say you have a text file named page1.txt that's located in the C:\Users\You\Dir1 and you want to convert into an HTML page.

  1. Go to the terminal and type:

-i C:\Users\You\Dir1\page1.txt

or

--input C:\Users\You\Dir1\page1.txt

You will get a page1.html file generated in the dist folder (full path: C:\Users\UserName\glazed-donut\glazed-donut\bin\Debug\netcoreapp3.1\dist)

Scenario 2

What if you decided to go crazy and convert a bunch of files at once? You have now 4 text files you want to convert into HTML pages (page1.txt, page2.txt, page3.txt, page4.txt) that are located in the C:\Users\You\Dir2 folder. Suddenly, you want to also have them placed in the C:\Users\You\MyWebsite folder.

Here is how you can do it:

-i C:\Users\You\Dir2 -o C:\Users\You\MyWebsite

alternatively,

--input C:\Users\You\Dir2 --output C:\Users\You\MyWebsite

Now, you can find the generated HTML files (page1.html, page2.html, page3.html, page4.html) inside the MyWebsite Folder.

Example 3

You can also combine all the commands like -i, -o, and -s.

Imagine you have a Data folder with page1.txt and page2.txt and you want them to be styled with this stylesheet: https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/tufte.min.css and then placed under the StaticWebsite folder.

You would do the following:

-i C:\Users\You\Data -o C:\Users\StaticWebsite -s https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/tufte.min.css

Here you go, you now have 3 HTML files inside the StaticWebsite folder, styled with this CSS stylesheet.

Lastly, thanks to this awesome open source project, I didn't have to worry too much about implementing the command line parser😁

You are welcome to fork my project and use it or give any feedback! It is still in the process of development, so expect to have more exciting features coming up soon😊

Latest comments (0)