Giter Site home page Giter Site logo

my-ssg's Introduction

my-ssg

My Static Site Generator is a command line tool created to convert .txt or .md file into a .html file by using Node.js.

Features

  • Allows user to specify a URL to a CSS stylesheet if they hope to
  • If users' input is a folder, an index.html file will be generated automatically and linked to other generated HTML files.
  • All generated HTML files will be stored in ./dist folder which is created by default
  • If the input is a markdown file, all Markdown's Heading1, Heading2, and Link will be converted into their corresponding HTML element.

Options

Option Function
-i, --input <'path-to-txt'> required specifies an input file or folder to be processed
-v, --version shows tool's name and the version number
-h, --help displays all available options
-s, --stylesheet <'link-to-css-stylesheet'> applies css link to <head> of HTML file

Usage

  1. For converting a single text file:
node index.js -i testing.txt
  1. For converting a single markdown file:
node index.js -i testing.md
  1. For converting a folder with multiple text/markdown files:
node index.js -i testing
  1. For converting a single text file and adding a CSS stylesheet:
node index.js -i 'Silver Blaze.txt' -s 'https://cdn.jsdelivr.net/npm/water.css@2/out/water.css'

Example

  1. testing.txt -> command: node index.js -i testing.txt -s https://cdn.jsdelivr.net/npm/water.css@2/out/water.css
node index.js -i 'Silver Blaze.txt' -s 'https://cdn.jsdelivr.net/npm/water.css@2/out/water.css'
This is a sentence!

This is a paragraph: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the 1500s.

Transfered into:

./dist/testing.html

<!DOCTYPE html>
<html lang="en" dir="ltr">
    <head>
        <title>testing</title>
        <meta charset="utf-8" />

        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link
            rel="stylesheet"
            href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
        />
    </head>
    <body>
        <p>This is a sentence!</p>

        <p>
            This is a paragraph: Lorem Ipsum is simply dummy text of the
            printing and typesetting industry. Lorem Ipsum has been the
            industry's standard dummy text ever since the 1500s.
        </p>
    </body>
</html>
  1. testing.md -> command: node index.js -i testing.md
# MY-SSG

My Static Site Generator is a command line tool created to convert `.txt` or `.md` file into a `.html` file by using Node.js.

## Features:

-   Automatically parse title from input. (A title is defined by being the first line followed by 2 blank lines)
-   All generated HTML files will be placed into a `./dist` folder
-   All generated HTML files comes with [Water.css](https://github.com/kognise/water.css) by default.
-   Users can specify a URL to a CSS stylesheet.

Transfered into: ./dist/testing.html

<!DOCTYPE html>
<html lang="en" dir="ltr">
    <head>
        <title>testing</title>
        <meta charset="utf-8" />

        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link
            rel="stylesheet"
            href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
        />
    </head>
    <body>
        <h1>MY-SSG</h1>

        <p>
            My Static Site Generator, is a command line tool, created to convert
            `.txt` or `.md` file into a `.html` file by using Node.js.
        </p>

        <h2>Features:</h2>

        <p>
            - Automatically parse title from input. (A title is defined by being
            the first line followed by 2 blank lines) - All generated HTML files
            will be placed into a `./dist` folder - All generated HTML files
            comes with
            <a href="https://github.com/kognise/water.css">Water.css</a> by
            default. - Users can specify a URL to a CSS stylesheet.
        </p>
    </body>
</html>

Author

Vivian Vu

my-ssg's People

Contributors

hlavu avatar mqnguyen5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.