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

githubdocs

v0.0.7

Published

Easily build a searchable documentation Single Page Application (SPA) using markdown files in your Github Repo or local files.

Downloads

21

Readme

Githubdocs

Easily build a searchable documentation Single Page Application (SPA) using markdown files in your Github Repo or local Markdown files. Github docs is a lightweight alternative to Gitbooks allowing simple but powerful Markdown generate documentation websites.

Website from Github Repo

Installation

  1. Clone Repository: git clone https://github.com/mrvautin/githubdocs.git && cd githubdocs
  2. Install dependencies: npm install
  3. Start application: npm start
  4. Go to http://127.0.0.1:5555 in your browser

Demo

https://githubdocs.markmoffat.com

Markdown files

The docs menu and files are built using files from your Github repo set in the config. Files should have the title of the doc in a single markdown hash/# (HTML = H1) tag in the file. This is used to build the slug of the doc and the menu title etc.

See example docs here: https://github.com/mrvautin/githubdocs/tree/master/exampleDocs

Search

Search is built using Lunr.js. The index is built and stored in memory on startup. When searched from the client the API is called returning any matching docs from the embedded DB. The menu will then display the match docs. When the search term is removed, the full list of docs is returned.

Config

The config file is located here: /config/config.json.

An example config:

{
    "title": "githubdocs",
    "githubRepoOwner": "mrvautin",
    "githubRepoName": "githubdocs",
    "githubRepoPath": "exampleDocs",
    "updateDocsInterval": 300000,
    "addAnchors": true,
    "menuItems": [
        {
            "menuTitle": "About",
            "menuLink": "/about"
        },
        {
            "menuTitle": "Contact",
            "menuLink": "/contact"
        }
    ]
}

|Setting|Description| |--- |--- | |title|Sets the value to be displayed at the top of the page| |githubRepoOwner|Owner/username of the Github repo| |githubRepoName|Name of the repo holding the Markdown files| |githubRepoPath|Directory relative to the root of the repo holding the Markdown files| |updateDocsInterval|Determines the interval (in milliseconds) to poll Github for updates to your Markdown files/docs| |addAnchors|Transforms H1, H2, H3, H4, H5 info HTML anchor points for easy sharing| |menuItems|Not sure how useful this is. Set the menu items in the top navigation|

Static websites

It's also possible to create a site from local Markdown files rather than using a Github repo.

Building

You can build your website using the following command from the root of your app:

node githubdocs build

Starting

You can start your website using the following command from the root of your app:

node githubdocs serve

Or

node server.js

Config

To do this you place your Markdown files into the docs folder and add the Titles and file names to your config.json file.

An example config.json for a static site:

"docs": [
    {
        "title": "Aut procul ursos nondum",
        "file": "docs/Aut procul ursos nondum.md"
    },
    {
        "title": "dsdsd ursos sdsdds dsdsd",
        "file": "docs/dsdsd ursos sdsdds dsdsd.md"
    },
    {
        "title": "Erant ventorum aliter esse pervenientia mutua numquam",
        "file": "docs/Erant ventorum aliter esse pervenientia mutua numquam.md"
    },
    {
        "title": "Suam aera",
        "file": "docs/Suam aera.md"
    }
]

The title property will be used for the menu, title and slug. The file value is the name and path to the file.

Layouts

You can also specify your own layout file. The default index.html file is used unless you specify a different file in your config.json.

{
    "layoutFile": "material.html"
}

Included is a material.html design template and a Bootstrap template (index.html).