A basic Static Site Generator that converts .txt
and .md
files to .html
files.
Current release 1.0.0 on npm with the following features.
.txt
and .md
files are recursively parsed..txt
files.dist
folder will be created in the current working directory to store the generated html
file(s).For interest in developments please read CONTRIBUTING.md
npm install -g osd-sitegen
Head to any directory you wish for the default /dist
folder to be generated in, then run the tool options below.
To uninstall run
npm uninstall -g osd-sitegen
-v, --version Displays tool name and current version
-i, --input <file or directory name> Designate an input file or directory
-o, --output <directory name> Designate an output directory, default ./dist
-s, --stylesheet <stylesheet URL> Link a stylesheet URL to the html
-c, --config <file> Read and parse json properties from file as options.
-h, --help Lists all available options
osd-sitegen -v
or osd-sitegen --version
will display the tool name and current version.
Name: osd-sitegen
Version: 1.0.0
osd-sitegen -h
or osd-sitegen --help
will list the tool options as listed above.
osd-sitegen -i filename
osd-sitegen --input "directory name"
osd-sitegen -i relative-or-absolute-path-to-file-or-directory
This is the main processing option for the site generator tool.
In the case of spaces in file or directory names, quotation marks "" are needed to wrap around the name.
Sample code for using output and stylesheet options below:
sitegen -i filename -o relative-or-absolute-path-directory
sitegen -i filename -s "stylesheet url"
sitegen -i filename -o relative-or-absolute-path-directory -s "stylesheet url"
sitegen -s "stylesheet url" -i filename -o relative-or-absolute-path-directory
In the case that an output directory isn't indicated or valid, the generator will create files in a default ./dist
folder in the current working directory.
The tool supports Markdown (.md) files with full Markdown support from Remarkable
The tool supports .json
config file
osd-sitegen -c config.json
Reading and parsing json properties as options for osd-sitegen
Note: if -c
exists, other options will be ignored.
{
"input": "./testfiles",
"output": "./output",
"stylesheet": "https://cdn.jsdelivr.net/npm/water.css@2/out/water.css",
"lang": "en"
}