DEV Community

Cover image for OSD600 - Siteit can turn your .txt files into .html
TD
TD

Posted on

OSD600 - Siteit can turn your .txt files into .html

About Siteit

Siteit simply turns your .txt extension files into .html files.

I programmed my static site generator (SSG) tool called Siteit using NodeJS and Javascript, trying my best to rely on as few external node modules as possible. Some may label this approach as re-inventing the wheel, but the reasoning behind not relying on too many npm dependencies was to improve my coding skills.

Honestly, I was a little nervous sharing my code publicly on GitHub, as certain planned features are yet to be implemented.

Finding a Partner

For some reason, I thought finding a partner to review my code would be difficult, but it was not as I was able to find two.

First, I connected with Chen-Yuan through a post he created on Slack regarding seeking a peer code tester and reviewer for his tool called staticSiteCon. Since it uses NodeJS and Javascript, It was not difficult to test and review the code.

Testing staticSiteCon

It's worth noting that at the time of testing, the project features section of README.md was labelled "WIP" so it proved difficult to differentiate bugs from features not yet implemented. Lastly, The source code is somewhat difficult to follow.

Issues I Created

  1. SSG breaks when a file with an extension other than .txt is supplied
    When a text file with an extension other than .txt is supplied, the staticSiteCon crashes and throws an ENOTDIR error.

  2. HTML pages generated by SSG only contains
    The static pages that are generated by the staticSiteCon only contain <p></p> tags in the HTML markup.

  3. -i and --input flag with no source crashes the application
    Running the SSG tool using the -i or --input flag with no source file supplied crashes the application with an error.

  4. Add support for programmatic generation and deletion of the ./dist directory
    The tool does not support programmatic generation and deletion of the ./dist directory. If the directory that comes with the project is deleted, relocated, or renamed, the program throws a compiler error and crashes.

  5. Add support for outputting success/error messages to terminal
    Running tool with an invalid option does not generate an error message. Also, the tool does not generate any success messages, so there is no way to know whether HTML pages were successfully generated without having to manually check the ./dist folder.

  6. Cannot execute the tool from terminal without prefixing node keyword
    To run the SSG tool from the terminal, I have to prefix staticSiteCon -h with node command. The terminal throws an error if I try to run the tool without adding node first.

Issues Created By Chen-Yuan

  1. The tool reports an issue when reading a single txt file as input (Closed)

  2. Output folder is always immediately deleted. (Closed)

  3. README.md instruction is currently missing. (Closed)

  4. The tool doesn't generate output after creation of output folder. (Closed)

  5. "siteit -i ./source_directory" command generates an error. (Closed)

  6. The tool inaccurately shows error message about invalid source files.

Later,Tymur connected with me via Slack DM to test his SSG tool Izyum. This SSG is created using Typescript and NodeJS.

Testing Izyum

It's worth noting that at the time of testing, the project contains minor bugs, and additional features needed to be implemented. The source code is clear and neatly organized.

Issues I Created

  1. -i and --input option with no source supplied crashes the tool #1
    Running the tool with the -i or --input option with no source file or directory supplied crashes it.

  2. Tool crashes when input file extension is not .txt
    The tool crashes when the -i option is used and the source file supplied is not in .txt format

  3. Tool requires files to be within a directory when -i flag is used
    The tool crashes with an error if the source file provided is not within a directory.

  4. .html files generated has formatting issues #4
    .html files generated have formatting issues.

  5. Tool is missing additional features required

  6. Supplying a text file + directory crashes the tool
    Using the --input flag and providing a text file with a directory crashes the tool with an error

Open Issues Created by Tymur

  1. Tool doesn't work with filenames that have space

  2. The Resulted HTML is not valid

  3. The Resulted HTML is not valid

Closed issues authored by Tymur can be found here

The first release is will be available with full all features implemented by Sunday, September 18th

Top comments (0)