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

gitbook-plugin-related-links

v1.0.0

Published

Handles related links for pages

Downloads

5

Readme

gitbook-plugin-related-links

This plugin manages related links for the Markdown files in your Gitbook. It retrieves the title for the links so you can just list the filename and not worry about changing files when your topic titles change.

The plugin takes file names from the front matter of a Markdown file, gets the titles from those files, and generates a related links section at the bottom of the file with links to each of those files. This keeps your related links sections consistent and keeps you from having to hard-code the titles of links to other pages in your Gitbook.

Notes:

  • This plugin currently supports only Markdown files, not AsciiDoc files.
  • To determine the title of a page, the plugin retrieves the first H1 in the file and uses its text. The plugin could be enhanced to use the title from front matter or from the summary file.
  • If the file name does not end in .md, the plugin copies the link to the related links section without changing anything. In this way you can specify custom link text as usual by using a standard Markdown link, or you can link to an external site by putting in a URL. However, to keep the YAML legal, you must surround Markdown links with single quotes. See the example below.

Installation

Add the plugin to your book.json:

{
  "plugins": [ "related-links" ],
  "pluginsConfig": {
     "header": "### Related topics"
  }
}

Then run gitbook install.

Configuration

  • header: Specify the heading under which to put the related links. The plugin adds this heading and an unordered list of links under it at the bottom of the Markdown file. The default is "### Related topics".

Example

Here's a Markdown file with some links in the front matter:

---
relatedLinks:
- myFile.md
- http://gitbook.com
- ../otherfiles/relatedFile.md
- '[My custom link text](someOtherFile.md)'
---
# Here's my file that needs related links

At build time, before Gitbook converts the Markdown to HTML, the plugin gets the link titles from the MD files in the front matter. The resulting file looks like this:

# Here's my file that needs related links

### Related links
- [My special file](myFile.md)
- http://gitbook.com
- [My related file](../otherfiles/relatedFile.md)
- [My custom link text](someOtherFile.md)

Tests

To run tests, run these commands:

npm install
npm run test

Contributing

License: MIT