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

git-wiki-to-html

v0.3.0

Published

Export github/git markdown based wiki repository to HTML based site with navigation

Downloads

1,186

Readme

git-wiki-to-html

Scope

Export a gihub.com wiki to a website.

Generate files required for a single page javascript application starting from the markdown files of a github.com Wiki repository. Beside the content .html files corespondent to each .md file, it will also generate a multi-level menu based on filenames.

Example

I have a Github Wiki with the following pages (created via the administration panel):

Overview.md

Migration:Migration from 3.x to 4.x.md

Migration:Migration from 4.x to 5.x.md

New Features:New Features in 4.x.md

New Features:New Features in 3.x.md

I want to run a command to transform the files to a list of HTML/json files required for a standalone website.

Menu

  • Overview
  • Migration ^
    • Migration from 3.x to 4.x
    • Migration from 4.x to 5.x
  • New Features ^
    • New Features in 4.x
    • New Features in 3.x

Content (dinamically loaded on menu click)

{Overview.md content transformed to HTML}

Module Features

  • generates a menu HTML (or json) file that can be loaded in a javascript single page application (customisable template)
  • generates for each of the markup files a HTML correspondent (customisable template and parsing rules)
  • transforms internal (wiki) links to clickable local links
  • supports multi-language templates (ex: en:Overview.md / fr:Overview.md) with only one entry in meny
  • it provides a template for markdown side menu - auto-generate the github.com Wiki sidemenu from a repository

Install

npm install -g git-wiki-to-html

Usage

Help and syntax:

git-wiki-to-html

If you get command not found check that your (npm bin -g) folder is in your system $PATH

Example from a github wiki repository

Real example starting from a public wiki repository: https://github.com/expressjs/express.wiki

git clone https://github.com/expressjs/express.wiki.git
mkdir express-website
# generates in dest folder .html files for each .md file and a menu with local links to them in index.html
git-wiki-to-html --src=express.wiki/ --dest=express-website/
# generates in the dest folder the menu and files for an Angular based application
git-wiki-to-html --src=express.wiki/ --dest=express-website/ --template=angular
cd express.wiki
# generates a _Sidebar.md file with
git-wiki-to-html --template=markdown
# commit and push your changes to origin to have a sidebar menu
git commit -m "Sidebar update for my wiki page"
git push master origin

Ex of result for above:

  * [Home](./Home)
  * [Application Patterns](./Application-Patterns)
  * [ESON JSON Configuration](./ESON-JSON-Configuration)
  * [Migrating from 2.x to 3.x](./Migrating-from-2.x-to-3.x)
  * [Migrating from 3.x to 4.x](./Migrating-from-3.x-to-4.x)
  * [New features in 3.x](./New-features-in-3.x)
  * [New features in 4.x](./New-features-in-4.x)
  * [README template](./README-template)

Customizing

Use --option=/path/to/my/options.json to override the parsing rules with custom ones

  • menu - replace rules for generating the menu file
  • rules (pre/post) - Regex rules to be applied before and after HTML transformation
  • rules.order - Specify a custom order (default lexical) to the menu items
  • rules.exclude - Specify a a list of items to be excluded (a category will match all subcategories)
  • separator - provide a different separator
  • prefixFiles - option to select only files starting with a prefix
  • linkTemplate - define your local link template
  • menuFile - replace the default filename for the menu file
  • multilang - enable/disable menu parsing rules for locale prefixes

Source and target directory can be set using --src / --dest

A particular template can be used from default / angular / markdown

Implementation example

my Sales Activity - Online Help

Note: This application is build using this module and supports over 12 languages (Choose for example: French / Spanish, German to see how the content is displayed in a different language)