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-block-code

v0.0.1

Published

Plugin for formatting a block of code in gitbook.

Downloads

4

Readme

Block Code

Gitbook Plugin

My first package in npm. I would be grateful for any.

Plugin for formatting blocks of code in gitbook pages.

Plugin abilities:

  • Adds numbering for lines of code.
  • Adds a special marker for the code block in the console.
  • Adds a button to copy the contents of the code block.
  • Formatting the copy button.

Summary

Install

book.json

{
	"plugins": [
		"block-code"
	]
}

console

gitbook install

or

console

npm install gitbook-plugin-block-code

Plugin Config

All basic settings are default.

book.json

{
	"pluginsConfig": {
		"block-code": {
			"cloneButton": true,
			"lineNumber": true,
			"cloneButtonStyle": {
				"color": "#c1c7cd",
				"color-hover": "#c1c7cd",
				"bg": "transparent",
				"bg-hover": "transparent"
			},
			"cloneButtonIcon": {
				"clone": "fa-clone",
				"check": "fa-check"
			}
		}
	}
}

Properties

|property|default|available values| |:-:|:-:|:-| |cloneButton|true| true | false| |lineNumber|true|true | false| |cloneButtonStyle|{}|contains such fields: color, color-hover, bg,bg-hover| |color|#c1c7cd | Format HEX color and transparent| |color-hover|#c1c7cd| Format HEX color and transparent| |bg|#c1c7cd | Format HEX color and transparent| |bg-hover|#c1c7cd | Format HEX color and transparent| |cloneButtonIcon|{}|contains such fields: clone, check| |clone|fa-clone|Icon font in string format| |check|fa-check|Icon font in string format|

More Detail

1. Button for copying the contents of the block with the code.

  • cloneButton
    • true
    • false

true

false

2. Numbering each line of code.

  • lineNumber
    • true
    • console
    • false

true

console

false

3. Few styles for the copy button.

  • cloneButtonStyle
    • color
    • color-hover
    • bg
    • bg-hover

hover

active

4. Copy and copy context icons.

  • cloneButtonIcon
    • clone
    • check

In order to replace one of the icons, you need to go to the site fontawesome.com, select the necessary one and copy the class that begins with fa-*title*.


Attention! Not all icons can be displayed, be careful.


Examples of

fa-align-justify

fa-bullseye

fa-clone

fa-barn

fa-cog

fa-expande

fa-paint-brush

Creators