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

mark-applier

v0.5.0

Published

Markdown-to-Website Generator, GitHub README style

Downloads

9

Readme

mark-applier

Markdown-to-Website Generator, GitHub README style

Generate a barebones GitHub-readme-themed website from markdown.

Demo

https://suchipi.github.io/mark-applier/ has been generated from this README.

Features

  • Author websites the same way you write READMEs
  • Everything renders the same as it does on GitHub:
    • Headings
    • Italics
    • Bold
    • Strikethrough
    • Ordered and unordered lists
    • Blockquotes
    • Code blocks (including syntax highlighting)
    • Inline code
    • Inline HTML (including <kbd> and etc)
    • Links
    • Images
    • Tables
    • Horizontal rules
    • Line breaks
    • Task lists
    • ...and more
  • Supports both light and dark theme (based on @media prefers-color-scheme, though you can override that if you prefer)
  • Outputs each page as a single, self-contained html file
  • Supports relative links between different .md files (changes ending .md to .html in links to the same origin)
  • Super simple usage
  • Generated pages work even when JavaScript is disabled

Installation

  • Install Node.js to get the npx program.

Usage

To generate README.html from the contents of README.md:

$ npx mark-applier --input README.md --title "My Awesome Page" --output README.html

You can alternatively use yaml frontmatter to specify the page title instead of --title:

---
title: My Awesome Page
---

# My Awesome Page

...

Advanced Usage

Raw HTML

Outputs the raw rendered markdown, without the enclosing page HTML:

$ npx mark-applier --input README.md --raw --output README.html

By using --css to get the css and --raw to get the raw html, you can use your own page template instead of the one provided by mark-applier.

If you're going to use this with the CSS provided by mark-applier, you should put that raw HTML inside of an element with the class name "markdown-body", like so:

<article class="markdown-body">
  <!-- raw html goes here -->
</article>

You can also add the class name "light-theme" or the class name "dark-theme" to override the default theme (which is whatever the user's OS uses). You can put this class on the .markdown-body element or any of its parent elements.

Just the CSS

Outputs the CSS from the page, without any of the HTML.

$ npx mark-applier --css > styles.css

By using --css to get the css and --raw to get the raw html, you can use your own page template instead of the one provided by mark-applier.

Page Origin

mark-applier adds target="_blank" and some other attributes to <a> elements when they appear to be linking to an external page. To improve the accuracy of this "appear to be linking to an external page" heuristic, you can specify the origin (protocol and domain name) that the document will appear on. Specify it either in the yaml frontmatter's origin key or via the CLI option --origin:

$ npx mark-applier --input README.md --origin https://example.com --output README.html

License

MIT