{"id":14384747,"url":"https://github.com/L3au/gitbook-plugin-git-author","last_synced_at":"2025-08-23T17:33:29.462Z","repository":{"id":73215347,"uuid":"60713534","full_name":"L3au/gitbook-plugin-git-author","owner":"L3au","description":"A gitbook plugin to show git author info","archived":false,"fork":false,"pushed_at":"2020-05-27T08:48:31.000Z","size":139,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-11T17:16:02.106Z","etag":null,"topics":["git","gitbook","gitbook-plugin","timestamp"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gitbook-plugin-git-author","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/L3au.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-06-08T16:39:07.000Z","updated_at":"2023-03-10T09:37:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"1683efb4-55b7-4b2f-a601-3291bc394b03","html_url":"https://github.com/L3au/gitbook-plugin-git-author","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":0.3939393939393939,"last_synced_commit":"3a2ad92623e0194809f3a3908af86c393a2602a9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L3au%2Fgitbook-plugin-git-author","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L3au%2Fgitbook-plugin-git-author/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L3au%2Fgitbook-plugin-git-author/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L3au%2Fgitbook-plugin-git-author/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/L3au","download_url":"https://codeload.github.com/L3au/gitbook-plugin-git-author/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230716642,"owners_count":18269813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","gitbook","gitbook-plugin","timestamp"],"created_at":"2024-08-28T18:01:38.154Z","updated_at":"2024-12-21T12:30:55.391Z","avatar_url":"https://github.com/L3au.png","language":"JavaScript","readme":"# gitbook-plugin-git-author\n\nThis is a plugin for automatically adding author and timestamp to each gitbook page, including creator and last-modified from git commits\n\n[![npm](https://img.shields.io/npm/v/gitbook-plugin-git-author.svg)](https://www.npmjs.com/package/gitbook-plugin-git-author)\n[![travis](https://img.shields.io/travis/L3au/gitbook-plugin-git-author.svg)](https://travis-ci.org/L3au/gitbook-plugin-git-author)\n[![codecov](https://codecov.io/gh/L3au/gitbook-plugin-git-author/branch/master/graph/badge.svg)](https://codecov.io/gh/L3au/gitbook-plugin-git-author)\n[![npm-downloads](https://img.shields.io/npm/dm/gitbook-plugin-git-author.svg)](https://www.npmjs.com/package/gitbook-plugin-git-author)\n\n![git-author-preview](https://raw.githubusercontent.com/L3au/gitbook-plugin-git-author/master/src/assets/preview.png)\n\n## Usage\n\n### Recommended Environments\n\n- Node.js 4.0+\n- npm 3.0+\n- gitbook 3.0+\n\n### install\n\n```sh\nnpm i -D gitbook-plugin-git-author\n```\n\n### book.json\n\n```js\n{\n    \"plugins\": [\"git-author\"]\n    \"pluginsConfig\": {\n          \"git-author\":{\n              \"position\": \"bottom\",\n              \"modifyTpl\": \"Last modified by {user} {timeStamp}\",\n              \"createTpl\": \"Created by {user} {timeStamp}\",\n              \"timeStampFormat\": \"YYYY-MM-DD HH:mm:ss\"\n          }\n    }\n}\n```\n\n## Example\n\n`README.md` file\n\nBe sure to commit this file to git repository firstly.\n\n```markdown\n# Title of the Article\n\ncontent\n```\n\n### Output\n\n```html\n\u003ch1\u003eTitle of the Article\u003c/h1\u003e\n\n\u003cp\u003econtent\u003c/p\u003e\n\n\u003cdiv class=\"git-author-container git-author-bottom\"\u003e\n  \u003cdiv class=\"modified\"\u003eLast modified by someone 2016-06-06 06:06:06\u003c/div\u003e\n  \u003cdiv class=\"created\"\u003eCreated by someone 2016-06-06 06:06:06\u003c/div\u003e\n\u003c/div\u003e\n```\n\n## Options\n\n### `position`\n\ndefault: `bottom`\n\ngit-author content position in the article. `top` or `bottom`\n\nthis will add a `git-author-{position}` className to `git-author-container`\n\n### `createTpl` `modifyTpl`\n\nYou can use `{user}` `{timeStamp}` as placeholder for username and timeStamp\n\ndefault:\n\ncreateTpl: `Created by {user} {timeStamp}`\n\nmodifyTpl: `Last modified by {user} {timeStamp}`\n\nYou may disable one of them by set it to a FALSY value.\n\ne.g\n\n```\n\"createTpl\": false\n```\n\n### `timeStampFormat`\n\ndefault: `YYYY-MM-DD HH:mm:ss`\n\nuse [moment](https://www.npmjs.com/package/moment) to process timeStamp\n\n## Useful filters\n\nYou can use `timeFormat` nunjucks filter to format time string in each article.\n\n### `timeFormat`([timeFormatString])\n\n```\n{{ 1466749374153 | timeFormat('YYYY-MM-DD') }}\n```\n\noutput\n\n```\n2016-06-24\n```\n\n```\n{{ '2016-06-24T07:27:04.365Z' | timeFormat('MMMM Do YYYY, h:mm:ss a') }}\n```\n\noutput\n\n```\nJune 24th 2016, 3:27:04 pm\n```\n\n## Custom styles\n\nchange default style by add a custom css file to your gitbook\n\n`book.json`\n\n```js\n{\n    \"styles\": {\n        \"website\": \"./styles/website.css\"\n    }\n}\n```\n\n`website.css`\n\n```\n.git-author-container {\n    font-size: 85%;\n}\n\n.git-author-top {\n    float: none;\n}\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FL3au%2Fgitbook-plugin-git-author","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FL3au%2Fgitbook-plugin-git-author","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FL3au%2Fgitbook-plugin-git-author/lists"}