Git Product home page Git Product logo

tue-1st-ssg's Introduction

Javascript Static Site Generator (SSG)

A Javascript command line program that converts .txt and .md files into .html files.

Implemented features

  • Specifying a language to add to html tag
  • Parsing titles from .txt files => .html files to have <h1> and <title> tags
  • User can specify output folder path, instead of placing .html files in ./dist by default
  • If input path is a folder, it will look for all .txt files in the folder and in subfolder(s)
  • An index.html contains links to other .html files in folder.
  • Fully support parsing markdown files
  • User can specify a JSON formatted config file to store options, instead of passing options as command line arguments

How to use:

Run one of these commands in your terminal

ssg -i ./textfiles/file.txt

Converting file.txt in ./textfiles/ to html

ssg -i ./textfiles

Converting all .txt files found in ./textfiles folder

ssg -i ./textfiles -o ./outputFiles

Converting all .txt files found in ./textfiles folder and place html output files in ./outputFiles

Parsing JSON formatted config file with options. Use of -c or --config will ignore -i, -o, -l options in the command line.

node index.js -c configFile

Help

Usage: index [options]

Options:
  -V, --version            output the version number
  -o, --output <path>      specify a path for .html files output
  -i, --input <file path>  (required) transform .txt or .md files into .html files
  -h, --help               display help for command

Demo Link

https://tuenguyen2911.github.io/static-ssg-dps909/

tue-1st-ssg's People

Contributors

tueenguyen avatar menghif avatar oliver-pham avatar rc-lee 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.