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

gumdrop

v4.2.1

Published

Zero-configuration script to display Markdown documents as static HTML pages

Downloads

38

Readme

Gumdrop

Version License Code style

Zero-configuration script to display Markdown documents as static HTML pages

Gumdrop is designed to be an easy to use, standalone script that can generate websites and documentations written in Markdown. It dinamically loads all its dependencies from a CDN (including the Markdown parser) and does not require any configuration or initialization.

Installation

Gumdrop does not require installation you just have to load it into an HTML document with a script tag.

<script src="https://cdn.jsdelivr.net/npm/gumdrop@4"></script>

Usage

To create a static website with Markdown all you need to to is to create a HTML template (index.html) on your file server and add Gumdrop as an external script file.

<main></main>
<script src="path/to/gumdrop.js">

Be aware, that you have to serve your files via http/https protocol, as the file protocol does not support fetch requests.

Markdown files in the pages folder can be loaded. Gumdrop watches the hash fragment of the URL and loads the corresponding Markdown file from the pages folder. The parsed Markdown files get rendered in the <main> HTML node if present, in body otherwise. The default file that gets loaded if no file is specified is pages/index.md. To create a link to another file in the pages folder simply create a link with its name prefixed by #!/.

[Link to about.md](#!/about)

Static resources (e.g. images) can be loaded from any folder that is served by your file server, paths are relative to index.html. Error pages for various HTTP errors can be placed in the errors folder. Each file should be named according to the HTTP error code it represents (e.g. errors/404.md).

Additional data can be specified for your documents in a YAML Front Matter. You can access this data in any of your Markdown documents with mustache templates.

You can also use separate files to store data and link these resource files to a document in the front matter. Resource files can use YAML (default), JSON or Markdown type. Any value in a document's front matter that is annotated with the !file type is considered a file resource. File paths starting with a leading / are relative to index.html, if the leading / is missing then the data folder is assumed as the resource location. If no file type (extension) is given then the .yaml extension is assumed. For .md resource files the returned value will be the rendered Markdown document.

# data/todo.yaml

todos:
  - title: First todo
    text: Complete your first assignment
    completed: true
  - title: YAML
    text: Learn more about YAML Front Matters
    completed: false
---
todos: !file todo.yaml
---
{{#todos}}
- **{{title}}**: {{text}} {{#completed}}(✔){{/completed}}
{{/todos}}

Features

  • Zero configuration, no initialization needed
  • No server side code, only needs a static file server
  • No build/generation step, it's just files you serve
  • Extra Markdown features via ExtraMark
  • Navigation by fetch requests
  • Local caching of files for faster load times
  • Additional data in front matter and data files handled by mustache templates
  • Error pages for various HTTP error codes (404, 500, 300)

Syntax highlighting

Fenced code blocks are automatically processed by Prism.js. Languages supported are the default languages in the Prism.js bundle. For syntax highlighting you have to include a Prism.js style in your index.html.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism.css" />

Using with GitHub Pages

You can use Gumdrop with GitHub Pages as it can serve as a static file server. To prevent GitHub Pages from trying to transform your site with Jekyll add an empty .nojekyll file to the root of your site.

Contributing

All ideas, recommendations, bug reports, pull requests are welcome. :smile: