All Contributors

All Contributors

  • 文档
  • GitHub
  • Languages icon中文
    • English
    • 日本語
    • Deutsch
    • Español
    • Français
    • Bahasa Indonesia
    • 한국어
    • Polski
    • Português (Brasil)
    • Русский

›@all-contributors Bot 🤖

规范

  • 概览
  • 规范
  • Emoji键 ✨
  • 仓库维护人员
  • 工具

@all-contributors Bot 🤖

  • 概览
  • 安装
  • 用法
  • 配置
  • FAQs

CLI

  • 概览
  • 安装
  • 用法
  • 配置

项目

  • 帮助我们改进
  • 行为准则
  • 如何实现?
Edit

Bot配置

你可以通过更新.all-contributorsrc JSON文件来配置all-contributors机器人。 The data used to generate the contributors list will be stored there, and you can configure how you want @all-contributors to generate the list.

你正在浏览🤖Bot配置,它类似于CLI配置。

这些是你可以指定的键:

选项描述范例/默认
projectName必要,项目名称范例:all-contributors-cli
projectOwner必要,项目的持有用户名称Example: tenshiAMD
repoType仓库类型, 必须是github或者gitlab默认:github
repoHost指向仓库的主机名, 如果你用自己托管的仓库请更改默认:https://github.com如果仓库类型是github,或者https://gitlab.com如果仓库类型是gitlab。
files要更新文件的数组默认:['README.md']
imageSize用户头像尺寸 (以像素为单位)默认:100
commit当添加贡献者时,自动提交徽章默认:false
commentConventionCommit convention (angular, atom, ember, eslint, jshint, gitmoji, or none).Default: angular
contributorsPerLine贡献者表的最大列数默认:7
contributorsSortAlphabeticallytrue: 按字母顺序排列。 false: 按添加顺序显示。默认:false
badgeTemplate定义你自己的lodash模版来生成徽章
contributorTemplate定义你自己的lodash模版来生成贡献者
wrapperTemplateDefine your own lodash template to wrap the list of contributors
types对于贡献者类型,具体说明自定义符号或者链接模版 可以覆盖记录的类型
linkToUsageAdds a footer with link to usage (either true or false)Default: true
skipCiMakes the CI ignore the commit. (either true or false)Default: true
contributors@all-contributors add可以用来更新此项目的贡献者列表。
{
  "projectName": "all-contributors",
  "projectOwner": "all-contributors",
  "repoType": "github",
  "repoHost": "https://github.com",
  "files": ["README.md"],
  "imageSize": 100,
  "commit": false,
  "contributorsPerLine": 7,
  "contributorsSortAlphabetically": false,
  "badgeTemplate": "[![All Contributors](https://img.shields.io/github/all-contributors/<%= projectOwner %>/<%= projectName %>?color=ee8449&style=flat-square)](#contributors)",
  "contributorTemplate": "<a href=\"<%= contributor.profile %>\"><img src=\"<%= contributor.avatar_url %>\" width=\"<%= options.imageSize %>px;\" alt=\"\"/><br /><sub><b><%= contributor.name %></b></sub></a>",
  "wrapperTemplate": "\n<table>\n  <tbody><%= bodyContent %>  </tbody>\n<%= tableFooterContent %></table>\n\n",
  "types": {
    "custom": {
      "symbol": "🔭",
      "description": "A custom contribution type.",
      "link": "[<%= symbol %>](<%= url %> \"<%= description %>\"),"
    }
  },
  "linkToUsage": true,
  "skipCi": true,
  "contributors": []
}

移动所有贡献者表格到另一个文件

如你所知,贡献者表格默认在文件 README.md中。 但如果你的项目有大量的贡献者,那么就不适合在 README.md 文件中列举所有贡献者。 相反,你可以使用另一个单独文件来实现这一点。

下列步骤能帮助你实现这一目标。 在本教程中,我们将列举贡献者的文件命名为 CONTRIBUTORS.md。

  1. 安装机器人, 请参阅 安装 页面以获取安装说明。

  2. 添加您的第一个贡献者。 请参阅 机器人安装方法 页面以获取安装说明。

  3. 创建 CONTRIBUTORS.md 文件。

  4. Copy the code which can be found in this guide.

  5. 在 .all-contributorsrc JSON 文件中修改 files 属性的值为新的文件名。

    {
    "files": [
      "CONTRIBUTORS.md"
    ],
    ...
    }
    
  6. Now you should be good to go. New contributors will be added to this new file instead of the README.md file.

← 用法FAQs →
All Contributors