node-tilify

1.0.6 • Public • Published

Node-TILify

Welcome to Node-TILify. An open source CLI software that helps you convert a text file or a directory of text file(s) into html file(s) blazingly fast 🏃‍♂️ 💨 ⚡️. The name of the project was chosen to showcase which language/framework was used to build this tool -- Node.js, what the tool is all about -- TIL - Today I Learned, & the value that it adds to your workflow -- Amplifying Knowledge.

How to install

Make sure you have latest node installed on your computer.

To install this program globally on your machine, run the command:

npm i -g node-tilify

You can now run the program to see how to use this tool:

node-tilify -h

Features

  • Pass in a txt file and it'll generate an html file.
  • Pass in a directory and it'll search through all the txt files in that directory and generate html files which are then stored in ./til directory.
  • Every paragraph is enclosed with <p> tag.
  • Every hyperlink starting with https:// or http:// is enclosed with <a> tag.
  • Every line that ends in ^ is enclosed in <h2> tag.
  • Optional Feature #1: If the first line of the text has 2 spaces after it, a <title> tag is added to the <head> and a <h1> tag is added at the beginning of <body>.
  • Optional Feature #5: Stylesheet is added to every html file to improve the looks of it.
  • Passing -h or --help command prints help menu.
  • Passing -v or --version command prints version and name of the tool.
  • Optional Feature #2: Passing -o or --output command followed by an output directory path, stores all the generated HTML files to that directory. If no directory exists, it'll create one. It overwrites the content of the files that match with the input file or directory of files and creates a new file if it doesn't exist in the output directory.
  • Name of the generated html file is the same as name of txt file.
  • Converts Markdown horizontal lines to HTML horizontal lines.
  • Converts Markdown links to HTML links.
  • Converts Markdown images to HTML images.
  • TOML Configuration: Instead of repeatedly passing in command-line arguments, you can now set your preferences in a TOML configuration file. Use the -c or --config flags followed by the path to your TOML configuration file.

Usages / Examples

  • node-tilify -h / node-tilify --help - To print help menu
  • node-tilify -v / node-tilify --version - To print version and name of the tool
  • node-tilify input.txt - To read txt file and generate html from it to be stored in ./til directory
  • node-tilify ./examples - To read txt files from a directory and generate html from it to be stored in ./til directory
  • node-tilify input.txt -o collection / node-tilify input.txt -output collection - To read a txt file and generate html from it to be stored in ./collection directory
  • node-tilify ./examples -o collection / node-tilify ./examples --output collection - To read txt files from a directory and generate html from it to be stored in ./collection directory
  • node-tilify --config path_to_your_config.toml / node-tilify -c path_to_your_config.toml- To utilize your configuration file settings for conversion.

Usages / Examples (with Output)

To generate multiple HTML files from a directory with your preferred output directory:

Command Line:

sohamthaker@Sohams-MacBook-Pro Node-TILify % node-tilify examples -o output
HTML files generated successfully stored at output!

partial output of examples/Kubernetes101.txt

Kubernetes 101


TIL about Kubernetes, Google’s open source container orchestration system.

I spent a half-day at Google’s office space today learning about Kubernetes from the folks at Apprenda. Going in to the session, I thought I had a grasp on what Kubernetes was, but quickly realized I had many misconceptions.

We worked through the following repository, provided by Apprenda, for learning some of the basics of Kubernetes: https://github.com/apprenda/hands-on-with-kubernetes-gke.

Here are some things that I learned from the session:

Kubernettes !== Docker^

I thought Kubernetes was just a different way to build container images like you can with Docker… not so!

Kubernetes is a container orchestration system: in other words, it provides the necessary components for configuring, deploying and scaling images that are built with Docker.

partial output of output/Kubernetes101.html

<!DOCTYPE html>
    <html lang="en-us">
    <head>
      <meta charset="utf-8">
      <link rel=stylesheet href=https://cdn.jsdelivr.net/npm/water.css@2/out/water.css>
      <title>Kubernetes 101</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body>
     <h1>Kubernetes 101</h1>

     <p>TIL about Kubernetes, Google’s open source container orchestration system.</p>

     <p>I spent a half-day at Google’s office space today learning about Kubernetes from the folks at Apprenda. Going in to the session, I thought I had a grasp on what Kubernetes was, but quickly realized I had many misconceptions.</p>

     <p>We worked through the following repository, provided by Apprenda, for learning some of the basics of Kubernetes: <a href="https://github.com/apprenda/hands-on-with-kubernetes-gke." target="_blank">https://github.com/apprenda/hands-on-with-kubernetes-gke.</a></p>

     <p>Here are some things that I learned from the session:</p>

     <h2>Kubernettes !== Docker</h2>

     <p>I thought Kubernetes was just a different way to build container images like you can with Docker… not so!</p>

     <p>Kubernetes is a container orchestration system: in other words, it provides the necessary components for configuring, deploying and scaling images that are built with Docker.</p>

Configuration Using TOML

Now with TOML configuration support, streamline your repetitive tasks by setting your configurations just once!

How to Use

  1. Create a .toml file with your desired configuration. Here's an example format:
# This is a sample TOML configuration file
input = "./src"

# Output directory where generated files will be saved
output = "./build"

# Stylesheet URL
stylesheet = "https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"

# Language setting
lang = "fr"
  1. Run the following command:
node-tilify -c path_to_your_config.toml
  1. That's it! Your files will be generated in the output directory you specified in your configuration file.

Readme

Keywords

none

Package Sidebar

Install

npm i node-tilify

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

1.8 MB

Total Files

38

Last publish

Collaborators

  • sdthaker