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-page-numbering

v0.1.3

Published

Add support for automatic numbering of pages, table, figures, etc... in GitBook.

Downloads

1

Readme

Page numbering for GitBook

This plugin add blocks for numbering pages, table, figures, etc... in GitBook.

Disclaimer: currently only numbering of pages is supported.

Example project

Still working on this...

Installation

Add the plugin into book.json or book.js, e.g.

{
    plugins: ["page-numbering"]
}

Configuration

This plugin has a few options. You can access the options in the GitBook GUI or by adding the following to book.json or book.js.

{
    "pluginsConfig": {
        "page-numbering": {
            "skipReadme": false,
            "chapterFormat": "Chapter #chapno#   #title# ||| #chapno#   #title#",
            "forceMultipleParts": false
        }
    }
}

The value of the options shown above are the defaults properties of the plugin. Here are their meanings:

| Option | Meaning | |----------------------|---------------| | skipReadme | Skip the book readme file (usually README.md) in the numbering. | | chapterFormat | The format of the automatic headings used for chapters. See “format of chapter titles” below to see the format of this option. | | forceMultipleParts | Force multiple-part numberings. If false, the part number is skipped if the book consists of only a single part. |

Usage

You can use the following tags in a GitBook page:

{% autochapter %}{% endautochapter %} returns the chapter number of the page.

{% autochapter %} [depth] {% endautochapter %} returns the chapter number of the page up to [depth], where [depth] is an integer. If [depth] is negative, then the depth is the actual depth plus the negative number.

NOTE: in a single part document, pages with the highest level (chapters) have a depth of 2, not 1. This is done to maintain consistency with GitBook chapter numbering.

{% autotitle %}{% endautotitle %} returns the title of the page. The format in the plugin options is used to format the title.

{% autotitle %} [format] {% endautotitle %} returns the title of the page, with the specified [format]. See “format of chapter titles” below to see the format of [format].

Format of chapter titles

Enter the exact words you want to show in the chapter titles. The following text have special function:

#chapno#: replaced by the chapter number of page (e.g. 1.1).

#title#: replaced by the title of the page, as defined in SUMMARY.md or the summary file you specify in book.js.

Also, you can use ||| to use different automatic headings in pages with different depths. This can be used in both the plugin options and also the {% autochapter %} tag.

After separating the format by |||, the first part of the format is used for pages with depth 2 (i.e. chapters). The second part is used for pages with depth 3, etc. (Note: in GitBook pages cannot have a depth of 1.)

The last part of the format is used in pages with it’s correspond depth, and also pages with a higher depth. e.g. If the format has 2 parts, the second part is used for pages with depth 3, 4, 5, etc.

TODO

Figure numbering. I am not sure if it is feasible to number the figures sequentially in multiple documents (if pages are loaded out of order, then sadly it is not.)

As a workaround, you can still use the chapter numbers do the numbering yourself.

Cross referencing, i.e. obtaining the chapter number of other pages in the book.

Report bugs / Contributions

  • To report issues and request features for the GitBook plugin, post an issue in the GitHub repository