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

@makerx/repository-website-generator

v1.6.2

Published

Generates a Next.js static website by converting markdown to html

Downloads

1

Readme

Repository Website Generator (repository-website-generator)

Generates a Next.js static website by converting markdown to html

npm package Build Status Downloads Issues Semantic Release

Install

npm install @makerx/repository-website-generator --save-dev

Usage

The repository website can be generated by running the following command

 npx repository-website-generator

Tip: Make it more discoverable add it to the package.json scripts collection

"scripts": {
  "generate-website": "npx repository-website-generator"
}

Testing

An easy way of testing the generated website is to use the http-server NPM package.

Install http-server

npm install --save-dev http-server

Add the following script to the package.json file

"scripts": {
  "serve-generated-website": "http-server -c-1 ./out"
}

Then build and launch the website

npx repository-website-generator && npm run serve-generated-website

Miscellaneous Pages

Miscellaneous pages can be enabled by setting the following configuration option.

  "miscellaneousPages": {
    "path": "/public-pages"
  },

Any markdown pages added to the /public-pages directory will be included in the build.

A miscellaneous markdown page has a special format to allow page related configuration settings. The format is:

---
title: Test Page
slug: test-page
menuIndex: 1
---

## A sub-title

The title property is to set the page title when showing the page.

The slug controls the link to the page. The links for miscellaneous pages are rooted. For this example, in the page above, the link would be http://localhost:3000/test-page.

The menuIndex is an optional property. Setting it allows for the control of the miscellaneous page link position.

Code Docs

Currently, only code docs generated by typedoc are supported.

To add typedoc to a solution the follow steps can be taken.

Enable code doc support in website-generator.json file

  "codeDocs": {
    "path": "/code-docs"
  },

Install the packages:

npm install typedoc, typedoc-plugin-markdown --save-dev

Then add a script entry:

"scripts": {
  "generate-doc": "typedoc",
}

And lastly, add the typedoc.json configuration file:

{
  "entryPoints": ["pages/", "shared/", "components/"],
  "entryPointStrategy": "expand",
  "out": "code-docs",
  "plugin": ["typedoc-plugin-markdown"],
  "theme": "default",
  "cleanOutputDir": true,
  "githubPages": false,
  "readme": "none",
  "entryDocument": "code-docs.md",
  "publicPath": "/"
}

Note: the out path for the doc generator must match the codeDocs path defined in the generator configuration.

Configuration options

The configuration file is a json file named website-generator.json, and must be placed at the same level as the package.json file.

Starting configuration file

{
  "outPath": "/out",
  "rootPath": null,
  "readmeFileName": null,
  "title": "My Package name",
  "titleSuperscript": "Proudly built and maintained by [MakerX](https://makerx.com.au)",
  "author": null,
  "name": null,
  "description": null,
  "gitHubUrl": null,
  "soeTags": null,
  "assetsPath": null,
  "miscellaneousPages": null,
  "codeDocs": null,
  "theme": {
    "iconLogo": "/theme/makerx-icon.png",
    "imageLogo": "/theme/makerx-logo.png",
    "imageLogoLink": "https://makerx.com.au"
  },
  "attribution": []
}

Example configuration file

{
  "outPath": "/out",
  "rootPath": null,
  "readmeFileName": null,
  "title": "TS Type Helpers",
  "titleSuperscript": "Proudly built and maintained by [MakerX](https://makerx.com.au)",
  "author": null,
  "name": null,
  "description": null,
  "gitHubUrl": null,
  "soeTags": null,
  "assetsPath": "/public-assets",
  "miscellaneousPages": {
    "path": "/public-pages"
  },
  "codeDocs": {
    "path": "/code-docs"
  },
  "theme": {
    "iconLogo": "/theme/makerx-icon.png",
    "imageLogo": "/theme/makerx-logo.png",
    "imageLogoLink": "https://makerx.com.au"
  },
  "attribution": [
    {
      "group": "Referenced packages",
      "title": "react",
      "description": "React is a JavaScript library for creating user interfaces.",
      "license": "MIT",
      "link": "github.com/facebook/react"
    },
    {
      "group": "Referenced packages",
      "title": "react-dropzone",
      "description": "Simple React hook to create a HTML5-compliant drag'n'drop zone for files.",
      "license": "MIT",
      "link": "https://github.com/react-dropzone/react-dropzone"
    }
  ]
}

outPath (Required)

Where the built site will be copied to.

rootPath (Optional)

The root path for the reference repository.

Note: By default the root path value defaults to /

readmeFileName (Optional)

The name of the main markdown file that will become in the index content.

Note: By default the readme file name value is README.md

title (Required)

The title of the repository website.

titleSuperscript (Required)

The superscript that is rendered with the title.

author (Optional)

The author of the package.

Note: By default the author is referenced from the package.json field author

name (Optional)

The name of the package.

Note: By default the author is referenced from the package.json field name

description (Optional)

The description of the package.

Note: By default the author is referenced from the package.json field description

gitHubUrl (Optional)

The GitHub URL link.

Note: By default the author is referenced from the package.json field description

soeTags (Optional)

The description of the package.

Note: By default the author is referenced from the package.json field repository.url

assetsPath (Optional)

A directory containing assets.

miscellaneousPages (Optional)

The folder containing the miscellaneous markdown files.

See adding miscellaneous pages

codeDocs (Optional)

The folder containing the code doc markdown files.

See adding code docs

theme (Required)

Theme is an object with the following properties.

theme.iconLogo (Required)

The icon logo is shown on the index page next to the H1 title.

theme.imageLogo (Required)

The image logo is shown on all pages in the footer.

theme.imageLogoLink (Required)

The link for the image logo.

Attribution

Is the collection holding additional attribution references which are shown on the attribution page.

The following properties are available per attribution reference

attribution[].group (optional)

An optional group name. All references of the same group are shown together. The group name is shown once.

attribution[].title (required)

The title of the reference.

attribution[].license (required)

The license of the reference.

attribution[].description (optional)

An optional description of the reference.

attribution[].link (optional)

An optional link to the reference.