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-git-author

v1.1.2

Published

show git author for each article of gitbook

Downloads

787

Readme

gitbook-plugin-git-author

This is a plugin for automatically adding author and timestamp to each gitbook article, including creator and last modified user from git commits

git-author-preview

Usage

Recommended Environments

  • Node.js 4.0+
  • npm 3.0+
  • gitbook 3.0+

install

npm i -D gitbook-plugin-git-author

book.json

{
    "plugins": ["git-author"]
    "pluginsConfig": {
          "git-author":{
              "position": "bottom",
              "modifyTpl": "Last modified by {user} {timeStamp}",
              "createTpl": "Created by {user} {timeStamp}",
              "timeStampFormat": "YYYY-MM-DD HH:mm:ss"
          }
    }
}

Example

README.md file

Be sure to commit this file to git repository firstly.

# Title of the Article

content

Output

<h1>Title of the Article</h1>

<p>content</p>

<div class="git-author-container git-author-bottom">
    <div class="modified">Last modified by someone 2016-06-06 06:06:06</div>
    <div class="created">Created by someone 2016-06-06 06:06:06</div>
</div>

Options

position

default: bottom

git-author content position in the article. top or bottom

this will add a git-author-{position} className to git-author-container

createTpl modifyTpl

You can use {user} {timeStamp} as placeholder for username and timeStamp

default:

createTpl: Created by {user} {timeStamp}

modifyTpl: Last modified by {user} {timeStamp}

You may disable one of them by set it to a FALSY value.

e.g

"createTpl": false

timeStampFormat

default: YYYY-MM-DD HH:mm:ss

use moment to process timeStamp

Useful filters

You can use timeFormat nunjucks filter to format time string in each article.

timeFormat([timeFormatString])

{{ 1466749374153 | timeFormat('YYYY-MM-DD') }}

output

2016-06-24
{{ '2016-06-24T07:27:04.365Z' | timeFormat('MMMM Do YYYY, h:mm:ss a') }}

output

June 24th 2016, 3:27:04 pm

Custom styles

change default style by add a custom css file to your gitbook

book.json

{
    "styles": {
        "website": "./styles/website.css"
    }
}

website.css

.git-author-container {
    font-size: 85%;
}

.git-author-top {
    float: none;
}