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

mdweblog

v0.6.7

Published

Static blog site generator. No JavaScript. Mermaid support.

Downloads

7

Readme

MD Weblog

Builds a static blog site from markdown files that requires no JavaScript to browse and supports mermaid diagrams embedded as svg.

Version 1.0.0 Plans

CAUTION: This package is currently at version 0.5.0
It will generate a static site, but quite a poor one. I am planning to get a version 1.0.0 out within the next week or so. Until then, I'm publishing this to test other workflows while I finish up the build.

What is this, and why does it exist?

MDWeblog is a static site generator written in node.js. There are tons of really great static site generators out there, so why did I build this? Partially because I wanted more control over how content is generated. I knew that I wanted support for mermaid diagrams, because mermaid is awesome. I also wanted to use only html and ensure that no JavaScript was running on the site.

Mostly though, I built MDWeblog because building software is fun. I learn so much by building utilities and I wanted to see what was involved in creating a static site generator myself. It was a fun project and I learned a lot. Bonus: I use it to generate my blog!

Why not use [insert blog software here]?

I've been a WordPress user for years. They provide a fantastic framework for building rich sites with tons of features. I couldn't hope to begin to build a tenth of the features they provide.

Yet my needs and use for a blog have changed. I don't interact with others via a blog anymore. I've never seen it as a source of revenue so I don't show ads. It started as a place to share thoughts and as a repository for ideas and notes, or write-ups of projects that held my interest.

I have relieved my blog of many of the duties it once performed, moving notes to their own repository, images to my photo sharing site, social blurbs to Twitter, and so on.

What I'd like to achieve with my blog today is very different than what I set out to achieve when I wrote that first post over two decades ago. As my needs have changed, I've gone seeking simpler tools that fit more closely with my workflows.

Architecture

Uses two html templates (one for index, another for a post) to build a static HTML site from Markdown content. Apply whatever styling is necessary via CSS in the template files. The content of posts, title, date, and author will be replaced within the template file during generation. Very simple.

Design

The following diagram illustrates the basic workflow used to assemble the blog site.

graph TD;
    Weblog;
    BuildSite[Build blog site];
    MDFiles{{Enumerate markdown files}};
    ReadIndexTemplate[Read index template];
    ReadContentTemplate[Read content template];
    BuildIndexPage[Build index page];
    ContentTemplate{{Content template}};
    IndexTemplate{{Index template}};
    MDContent{{Page content}};
    ContentIndex{{Content index}};
    ParseContent[Parse markdown content];
    HeaderInfo{{Header: title, author, date}};
    PageContent{{Page content}};
    BuildContentPage[Build content page];
    MermaidDiagrams{{Mermaid diagrams}};
    ContentPages{{Content pages}};
    IndexPage{{Index page}};
    AssembleSite[Assemble site];
    OutputSite[Output site];

    Weblog-->BuildSite;

    subgraph BuildSiteSG[Build site]
        BuildSite-->ReadIndexTemplate;
        BuildSite-->MDFiles;
        BuildSite-->ReadContentTemplate;
    end;

    subgraph BuildIndexSG[Build index page]
        MDFiles--for each-->ContentIndex;
        ContentIndex-->BuildIndexPage;
        ReadIndexTemplate-->IndexTemplate;
        IndexTemplate-->BuildIndexPage;
    end;

    subgraph BuildContentPagesSG[Build content pages]
        MDFiles--for each-->MDContent;
        MDContent-->ParseContent;
        ParseContent-->HeaderInfo;
        ParseContent-->PageContent;
        ParseContent-->MermaidDiagrams;
        ReadContentTemplate-->ContentTemplate;
        ContentTemplate-->BuildContentPage;
        HeaderInfo-->BuildContentPage;
        PageContent-->BuildContentPage;
        MermaidDiagrams-->BuildContentPage;
    end;
    
    subgraph AssembleSiteSG[Assemble site]
        BuildIndexPage-->IndexPage;
        BuildContentPage-->ContentPages;
        IndexPage-->AssembleSite;
        ContentPages-->AssembleSite;
    end;

    AssembleSite-->OutputSite;

Libraries

This package uses the following amazing libraries:

  • Marked - Used to parse the markdown content and convert it to HTML.
  • MermaidJS - Used to parse mermaid diagram content and convert it to SVG.

The project uses other libraries, which you can see in the package.json file within the repo. I wanted to call special attention to both marked and mermaid because I think they are great!