“统计”侧边栏(statbox)是一个动态组件,显示有关软件组件或人员的元数据。当前面页面的 YAML 提供了相关字段时,它会出现在 wiki 生命页面的右侧。
概述
统计框以两种模式运行:
- 手动模式:您在前面的页面手动指定元数据字段
- 自动模式:statbox JavaScript从Maven存储库中提取信息
这两种模式可以组合使用:自动填充仅填充空白字段,这允许根据需要手动覆盖。
基本使用
要启用统计框,请在前面页面的 YAML 添加至少一个受支持的字段:
---
title: My Component
name: My Component Name
icon: /media/icons/my-component.png
source-url: https://github.com/myorg/my-component
---
支持的字段
一般字段
| 领域 | 描述 | 示例 |
|---|---|---|
icon |
要在statbox标题中显示图像图标的URL | /media/icons/fiji.png |
name |
组成部分或人员姓名 | "Fiji" |
affiliation |
组织隶属关系 | "Fiji University" |
website |
主网站链接 | https://fiji.sc/ |
组件特定字段
| 领域 | 描述 | 示例 |
|---|---|---|
artifact |
Maven groupId:artifactId 用于自动填充 | sc.fiji:fiji |
repository |
Maven存储库URL(默认为maven.scijava.org) | https://repo1.maven.org/maven2 |
pom-url |
指向 POM 文件的直接 URL 以进行自动填充 | https://raw.githubusercontent.com/imagej/imagej2/main/pom.xml |
source-url |
来源代码 仓库URL | https://github.com/imagej/imagej2 |
source-label |
来源链接的自定义标签(如果未提供,则自动检测) | "on GitHub" |
license-url |
许可证详细信息 URL | /licensing/bsd |
license-label |
许可证名称/标签 | "BSD-2" |
release-url |
最新发布网址 | https://github.com/fiji/fiji/releases/latest |
release-version |
最新发布版本 | "2.14.0" |
release-date |
最新发布日期 | "2023-07-07" |
| §§§20§§§ | 发展现状 | §§§21§§§、§§§22§§§、§§§23§§§、§§§24§§§ |
| §§§25§§§ | 支持级别 | §§§26§§§、§§§27§§§、§§§28§§§、§§§29§§§ |
| §§§30§§§ | Image.sc 论坛标签 | §§§31§§§ |
团队领域
团队字段支持多种格式的多种:
| 领域 | 描述 |
|---|---|
team-founders |
项目创建者 |
team-leads |
决策者 |
team-developers |
功能开发人员 |
team-debuggers |
错误修复程序 |
team-maintainers |
发布经理 |
team-reviewers |
代码审阅者 |
team-support |
社区支持 |
team-contributors |
代码贡献者 |
特定于个人的字段
| 领域 | 描述 | 示例 |
|---|---|---|
gravatar |
个人资料图片的Gravatar 哈希 | "abc123def456..." |
forum |
Image.sc 论坛用户名 | "username" |
github |
GitHub 用户名 | "username" |
stackoverflow |
Stack Overflow 用户 ID | "12345" |
openhub |
打开集线器用户名 | "username" |
twitter |
X/Twitter 用户名 | "username" |
linkedin |
LinkedIn 个人资料路径 | "in/username" |
researchgate |
研究门简介 | "Username_Name" |
loop |
循环研究网络 ID | "12345" |
orcid |
ORCID 标识符 | "0000-0000-0000-0000" |
| §§§20§§§ | 研究员ID | §§§21§§§ |
| §§§22§§§ | Scopus 作者 ID | §§§23§§§ |
| §§§24§§§ | arXiv 作者标识符 | §§§25§§§ |
| §§§26§§§ | 谷歌学术 ID | §§§27§§§ |
| §§§28§§§ | 特别社区图标 | §§§29§§§ |
高级功能
自动坐标
最强大的功能来自Maven工件自动填充元数据:
---
title: Fiji
artifact: sc.fiji:fiji
---
这将自动填充:
- 组件名称
- 源存储库链接
- 许可证信息
- 最新发布版本和 URL
- 发布日期
- 来自POM的团队信息
- 开发和支持状态
多部分 URL 统计
多个字段标记URL/标签对,以便更好地控制显示文本:
---
release-url: https://github.com/imagej/imagej2/releases/tag/v2.14.0
release-version: "2.14.0"
license-url: /licensing/bsd
license-label: "BSD-2"
---
来源 URL 自动检测
source-url字段根据域自动生成合适的标签:
github.com→ “在 GitHub 上”gitlab.com→ “在 GitLab 上”bitbucket.org→ “在 BitBucket 上”sourceforge.net→ “在 SourceForge 上”- 其他网址→“在线”
###团队成员格式
团队字段接受支持格式的分隔列表:
- 维基人参考:
@ctrueden(查找/people/ctrueden) - 带有自定义链接的名称:
John Doe | https://johndoe.com - 普通姓名:
Jane Smith
原文:
team-leads: '@ctrueden, Curtis Rueden | /people/curtis-rueden'
team-developers: '@ctrueden, @hinerm, Jane Smith'
附属链接
affiliation字段支持Name | URL格式:
affiliation:
- 'University of Wisconsin-Madison | https://wisc.edu'
- 'Morgridge Institute for Research | https://morgridge.org'
示例
手动组件示例
---
title: Fiji
name: Fiji
icon: /media/icons/fiji.png
website: https://fiji.sc
source-url: https://github.com/fiji/fiji
license-url: /licensing/gpl
license-label: GPLv3
release-version: "2.14.0"
release-date: "2023-06-01"
dev-status: Active
support-status: Active
team-leads: '@ctrueden'
team-developers: '@ctrueden, @hinerm'
forum-tag: fiji
---
自动组件示例
---
title: ImgLib2
artifact: net.imglib2:imglib2
---
人物示例
---
title: Curtis Rueden
name: Curtis Rueden
gravatar: abc123def456
affiliation: 'University of Wisconsin-Madison | https://wisc.edu'
website: https://ctrue.name
github: ctrueden
forum: ctrueden
orcid: 0000-0001-7055-6707
scholar: VqJdqBEAAAAJ
honorific: Fiji Maintainer
---
实施细节
统计框在 _includes/layout/statbox 中使用 Liquid 模板实现,并使用 assets/js/maven.js 中的 JavaScript 进行了增强,以实现自动填充功能。当指定 artifact 或 pom-url 时,JavaScript 会自动获取并解析 Maven 元数据以填充空字段。
自动元数据填充逻辑最适合用于Maven项目管理/构建工具组件,并扩展了pom-scijava parent的构建配置和依赖版本管理,pom-scijava enforces the presence of all the needed metadata。请参阅here,了解填充的元数据位于项目pom.xml文件中的外观摘要中。
刷新按钮 (⟲) 允许用户重新加载自动数据,这在新版本可用时很有用。