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

docusaurus-graph

v1.1.0

Published

<!-- PROJECT LOGO --> <br /> <p align="center"> <img src="assets/Graphview.png" alt="screenshot" width="700">

Downloads

81

Readme

docusaurus-graph

Table of Contents

Overview

The Docusaurus GraphView Plugin is an open source plugin designed to generate a graph view from your Docusaurus documentation files. This visual representation helps in understanding the relationships between different documents, making navigation and comprehension easier.

Built with

Features

  • Automatically generates a graph view from your documentation.
  • Interactive and customizable graph visualization.
  • Easy integration with your existing Docusaurus site.

Getting Started

To get a local copy up and running follow these next steps.

Prerequisites

This project requires Node, yarn and git installed.

Installation

To install the plugin, you need to have Docusaurus set up. Follow these steps to add the GraphView plugin to your project:

  1. Install the plugin via npm or yarn:
npm install docusaurus-graph

or

yarn add docusaurus-graph
  1. Add the plugin to your Docusaurus site configuration (docusaurus.config.js):
module.exports = {
  // Other Docusaurus configurations...
  plugins: [
    [
      'docusaurus-graph',
      {
        path: 'docs', // Specify the folder of your documentation
      },
    ],
  ],
};

The default path is docs.

  1. Build the project to create the data file.
npm run build

or

yarn build

Usage

Once the plugin is installed and configured, it will automatically generate a graph view of your documentation. You can access the graph view from a new button at the top right of your Docusaurus site.

Configuration options

The plugin supports one option to get the path folder.

Example configuration:

module.exports = {
  // Other Docusaurus configurations...
  plugins: [
    [
      'docusaurus-graph',
      {
        path: 'docs', // Specify the folder of your documentation
      },
    ],
  ],
};
  • path: (default: docs) The folder containing your documentation files.

Markdown files

To create link between files, there are 2 tags :

Categories

Set the categories tag to a markdown file or a name (a file that doesn't exist). Example:

To a markdown file (intro.md):

## [comment]: <> (congratulations.md)

sidebar_position: 6
categories: intro

---

# Congratulations!

You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.

Docusaurus has **much more to offer**!

To a name:

## [comment]: <> (congratulations.md)

sidebar_position: 6
categories: tutorial-basics

---

# Congratulations!

You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.

Docusaurus has **much more to offer**!

Result :

To set multiple categories (or references) see this example :

## [comment]: <> (congratulations.md)

sidebar_position: 6
categories:

- intro
- tutorial-basics

---

References

Set the references tag to a markdown file or a name (a file that doesn't exist). Example:

To a markdown file (intro.md):

## [comment]: <> (congratulations.md)

sidebar_position: 6
references: intro

---

#### Differences

What's the difference between categories and references ?

See the categories like a parent or a chapter. Example : Car -> Engine.
The references is more like a child. Example : Wheel -> Car.

# Congratulations!

You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.

Docusaurus has **much more to offer**!

To a name:

## [comment]: <> (congratulations.md)

sidebar_position: 6
references: tutorial-basics

---

# Congratulations!

You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.

Docusaurus has **much more to offer**!

Result :

How it works

The Docusaurus GraphView Plugin works by parsing your Docusaurus documentation files located in the specified path and creating a visual graph representation based on the relationships between them. Here’s a high-level overview of the process:

  • File Parsing: The plugin scans the documentation files in your specified folder (path) to identify references between documents.
  • Graph Construction: Using the parsed data, the plugin constructs a graph data structure where nodes represent documents and edges represent references between them.
  • Graph Visualization: The constructed graph is then rendered using a graph visualization library (such as note-graph (D3.js)), applying the configured layout and styles.
  • Interactive Elements: The generated graph is interactive, allowing users to zoom in/out and drag nodes for better viewing.

After the Docusaurus build process completes, the Docusaurus GraphView Plugin generates a data file containing the parsed documentation structure. This file, typically named docusaurus-graph.json, includes all the necessary information to construct the graph view, such as nodes (documents) and edges (links between documents). The file is created in the build directory of your Docusaurus project.

Development

If you want to contribute to the plugin or modify it for your own use, follow these steps:

  1. Clone the repository
git clone https://github.com/Arsero/docusaurus-graph.git
  1. Navigate to the project directory:
cd docusaurus-graph
  1. Install the dependencies:
yarn install
  1. Make your changes and test them locally. To test them go to the demo folder.
cd demo
yarn install
yarn start

The plugin is link to the demo project. The project is a simple docusaurus website with the plugin added.

Contributing

We welcome contributions to the Docusaurus GraphView Plugin! If you have ideas, suggestions, or bug reports, please open an issue or submit a pull request. Follow these steps to contribute:

  • Fork the repository.
  • Create a new branch for your feature or bugfix.
  • Make your changes and commit them with clear and concise messages.
  • Open a pull request to the main repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements