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

@strv/docs

v0.1.4

Published

An opinionated Docusaurus preset by @strvcom

Downloads

16

Readme

@strv/docs

Built with ❤️ at STRV

An opinionated Docusaurus setup by @strvcom, used to help document products.

Introduction

This library is a pre-configured Docusarus setup generator, originally used to create the documentation for the STRV Website. It is composed of a set of defaults that aim at simplifying and standardizing the process of documenting projects – inside, and possibly beyond STRV.

If used to the fullest, this setup includes:

  • An index homepage
  • A general documentation builder (getting started, contributing, etc)
  • A components documentation (architecture, codebase, etc)
  • A section for ADRs (for architectural decision records)
  • A client-side search system for the above
  • Navbar links for the above
  • A code-fragment rehype plugin

All of these are opt-outs, meaning they can easily be disabled through configuration, but will be on by default.

In the end, @strv/docs main output is a Docusaurus config, and further configurations are possible and expected for each project's specific needs.

Setup

1. Install the library:

yarn add --dev @strv/docs

2. Setup docusaurus.config.js:

Create a docusaurus.config.js file on the root folder. This is a minimal example:

module.exports = require('@strv/docs').docs({
  title: 'Example Project',
  url: 'https://docs-website.com/',
  baseUrl: '/',
})

For a more complete example, check the example project's configuration.

3. Add docs scripts (optional):

Add Docusaurus building scripts to package.json:

{
  "scripts": {
    "docs:start": "docusaurus start -p 8001",
    "docs:build": "docusaurus build --out-dir build-docs",
    "docs:clear": "docusaurus clear",
    "docs:serve": "docusaurus serve -p 8001 --dir build-docs"
  }
}

Configuration

By default, @strv/docs will try to guess which features you want to enable by checking the presence of some files in your project. Alternatively, these features can be turn-off manually at the docusaurus.config.js:

module.exports = require('@strv/docs').docs({
  customFields: {
    strv: {
      homepage: false, // disable the homepage index
      pages: false, // disable pages plugin
      docs: false, // disable general docs, found at /docs/general
      adr: false, // disable adr docs, found ar /docs/adr
      components: false, // disable components docs, spread across /src files
      changelog: false, // disable Changelog link adding
      github: false, // disable GitHub links
    },
  },
})

For some configuration above, no extra effort is needed. Some of them, however, require that you start creating docs in specific locations. Furthermore, the doc generating modules – docs, adr, and `component``- will use automated sidebars, which can be overriden by placing a sidebar file on specific locations:

| Module | Description | Watched files | Custom sidebar | | ------ | ----------- | --------- | -------------- | | Pages | Add isolated React or MDX pages. You should add these pages to navbar or other links to get access to them. | ./docs/pages/**/*.(md\|mdx\|js\|jsx\|ts\|tsx) | | | General | Meant for general docs, not related to application logic | ./docs/general/**/*.(md\|mdx) | ./docs/general/sidebar.js | | ADR | Meant for architectural decision records | ./docs/adr/**/*.(md\|mdx) | ./docs/adr/sidebar.js | | Components | Meant for documenting current codebase components | ./src/**/*.(md\|mdx) | ./docs/components-sidebar.js |

Custom components source path

In case you want the components documentation to watch a different directory than /src, you can configure it in the docusaurus.config.js like so:

module.exports = require('@strv/docs').docs({
  customFields: {
    strv: {
      components: 'source', // would look for doc files under ./source/ dir
    },
  },
})

Be careful not to set a path that overlaps any other documentation kinds.