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

singlemd

v0.0.4

Published

Make a website with just a single Markdown file

Downloads

4

Readme

Motivation

  • There are many, many, many solutions to create a static website but I've found that the overall setup, development, deployment to be overboard for just a simple site.

  • I also didn't want to write HTML when most of my content could be done in Markdown. I liked the simplicity of writing a README file.

why can't a README just be my website.


Install

npm install singlemd

Usage

This command reads README.md and writes the converted html into index.html

singlemd --input ./README.md --output index.html

If you want to add an optional css file. The contents will be appended to the <head> in a <style> tag.

singlemd --input ./README.md --output index.html --style ./style.css

Options

singlemd <options>
--input ........ markdown file path (.md, .markdown)
--output ....... output path. Default 'index.html'
--style ........ css path to add in template (optional)
--title ........ add custom title (optional)
--version ...... show package version
--help ......... show help menu for a command

Examples


Usage with Gitlab Pages

Because this CLI can output a single html file, you can use Gitlab's CI integration to output a simple Gitlab page by adding the following .gitlab-ci.yml

image: node:8.12.0 

pages:
  cache:
    paths:
    - node_modules/

  script:
  - npm install singlemd -g
  - singlemd --input ./README.md --output index.html --style ./style.css
  - mkdir ./public && mv index.html ./public
  artifacts:
    paths:
    - public
  only:
    - master

Other Options

  • Github Pages
    • Github does allow you upload a markdown page and deploy that to its own website. It's not configurable. You're stuck with Jekyll Themes, and having to override any of their boilerplate css.
  • ShowdownJS
    • The biggest inspiration for writing this package, however they don't provide a full website output.
    • The showdownjs CLI provides a way to convert your files from markdown, however they output solely the html content, but nothing surrounding it. So adding a GFM or any custom styles is not possible.

TODO

  • Add option for favicon
  • Support Multiple Themes (right now only GFM)
  • Support CLI abbreviations
  • Support for Github Actions