npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

osd-sitegen

v1.0.2

Published

static site generator

Downloads

3

Readme

OSD-SiteGen

About

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.

Features

  • Allows the user to specify an input file or input folder to be processed.
  • Allows the input to be a deep tree of files and folders, all .txt and .md files are recursively parsed.
  • Parsed titles (if any) from input .txt files.
  • Allows specification of a different output directory. If there's no directory specified, a dist folder will be created in the current working directory to store the generated html file(s).
  • Allows specification of a stylesheet through linking a stylesheet URL
  • Automatically generates an index.html file with relative links to each of the generated html files
  • Markdown support: Full markdown support through Remarkable
  • Supports parsing of config JSON files containing SSG options

Development

For interest in developments please read CONTRIBUTING.md

Installation

  1. Make sure you have npm installed
  2. Please make sure you have the latest version of Node ("v16.13.0")
  3. run the following in terminal or command line
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

Tool options

  -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

Version option example

osd-sitegen -v or osd-sitegen --version will display the tool name and current version.

  Name:  osd-sitegen
  Version:  1.0.0

Help option example

osd-sitegen -h or osd-sitegen --help will list the tool options as listed above.


Input option examples

 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.


Output and Stylesheet option examples

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.


Markdown

The tool supports Markdown (.md) files with full Markdown support from Remarkable


Config file:

The tool supports .json config file

Usage

osd-sitegen -c config.json

Reading and parsing json properties as options for osd-sitegen Note: if -c exists, other options will be ignored.

Example.json

{
  "input": "./testfiles",
  "output": "./output",
  "stylesheet": "https://cdn.jsdelivr.net/npm/water.css@2/out/water.css",
  "lang": "en"
}

Special thanks to

Andrei Batomunkuev Tue Nguyen

Generated Pages live example

Link to the example webpage