跳至主要内容

关于 CITATION 文件

您可以向仓库添加 CITATION 文件,帮助用户正确引用您的软件。

关于 CITATION 文件

您可以在仓库根目录添加一个 CITATION.cff 文件,让其他人了解您希望他们如何引用您的作品。该引用文件格式为纯文本,包含可供人类和机器读取的引用信息。

示例 CITATION.cff 文件

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Lisa"
  given-names: "Mona"
  orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Bot"
  given-names: "Hew"
  orcid: "https://orcid.org/0000-0000-0000-0000"
title: "My Research Software"
version: 2.0.4
doi: 10.5281/zenodo.1234
date-released: 2017-12-18
url: "https://github.com/github-linguist/linguist"

GitHub 仓库的引用提示将以以下格式显示示例 CITATION.cff 内容

APA

Lisa, M., & Bot, H. (2017). My Research Software (Version 2.0.4) [Computer software]. https://doi.org/10.5281/zenodo.1234

BibTeX

@software{Lisa_My_Research_Software_2017,
  author = {Lisa, Mona and Bot, Hew},
  doi = {10.5281/zenodo.1234},
  month = {12},
  title = {{My Research Software}},
  url = {https://github.com/github-linguist/linguist},
  version = {2.0.4},
  year = {2017}
}

请注意,上面的示例生成了一个 software 引用(即 BibTeX 中的 @software 类型,而不是 @article)。

欲了解更多信息,请访问 Citation File Format 网站。

当您在仓库的默认分支中添加 CITATION.cff 文件时,系统会自动在仓库主页右侧边栏添加一个标签为“Cite this repository”的链接。这使得其他用户可以轻松引用您的软件项目,使用您提供的信息。

Screenshot showing the main repository page. The "Cite this repository" link on the right is expanded to show details and outlined in orange.

引用除软件之外的内容

如果您希望 GitHub 的引用信息链接到其他资源(例如研究文章),可以在 CFF 中使用 preferred-citation 覆盖,并使用以下类型。

资源CFF 类型BibTeX 类型APA 注释
期刊文章/论文article@article不适用
书籍book@book不适用
小册子(已装订但未出版)pamphlet@booklet不适用
会议文章/论文conference-paper@inproceedings[会议论文]
会议论文集conference, proceedings@proceedings不适用
数据集data, database@misc[数据集]
杂志文章magazine-article@article不适用
手册manual@manual不适用
杂项/通用/其他generic,任何其他 CFF 类型@misc不适用
报纸文章newspaper-article@article不适用
软件software, software-code, software-container, software-executable, software-virtual-machine@software[计算机软件]
报告/技术报告report@techreport不适用
未出版unpublished@unpublished不适用

扩展的 CITATION.cff 文件描述软件,但将研究文章设为首选引用

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Lisa"
  given-names: "Mona"
  orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Bot"
  given-names: "Hew"
  orcid: "https://orcid.org/0000-0000-0000-0000"
title: "My Research Software"
version: 2.0.4
doi: 10.5281/zenodo.1234
date-released: 2017-12-18
url: "https://github.com/github-linguist/linguist"
preferred-citation:
  type: article
  authors:
  - family-names: "Lisa"
    given-names: "Mona"
    orcid: "https://orcid.org/0000-0000-0000-0000"
  - family-names: "Bot"
    given-names: "Hew"
    orcid: "https://orcid.org/0000-0000-0000-0000"
  doi: "10.0000/00000"
  journal: "Journal Title"
  month: 9
  start: 1 # First page number
  end: 10 # Last page number
  title: "My awesome research software"
  issue: 1
  volume: 1
  year: 2021

上面的示例 CITATION.cff 文件将在 GitHub 引用提示中产生以下输出

APA

Lisa, M., & Bot, H. (2021). My awesome research software. Journal Title, 1(1), 1. https://doi.org/10.0000/00000

BibTeX

@article{Lisa_My_awesome_research_2021,
  author = {Lisa, Mona and Bot, Hew},
  doi = {10.0000/00000},
  journal = {Journal Title},
  month = {9},
  number = {1},
  pages = {1--10},
  title = {{My awesome research software}},
  volume = {1},
  year = {2021}
}

引用数据集

如果您的仓库包含数据集,您可以在 CITATION.cff 文件的顶层设置 type: dataset,从而在 GitHub 引用提示中生成数据引用字符串。

其他引用文件

GitHub 的引用功能还会识别少量其他文件,这些文件常被社区和项目用于描述他们希望如何被引用。

GitHub 会在 Cite this repository 提示中链接这些文件,但不会尝试将其解析为其他引用格式。

# Note these are case-insensitive and must be in the root of the repository
CITATION
CITATIONS
CITATION.bib
CITATIONS.bib
CITATION.md
CITATIONS.md

# CITATION files for R packages are typically found at inst/CITATION
inst/CITATION

引用格式

我们目前支持 APA 和 BibTeX 文件格式。

您在寻找其他引用格式吗?GitHub 使用 Ruby 库来解析 CITATION.cff 文件。您可以在 ruby-cff 仓库中请求额外的格式,或自行贡献。

© . This site is unofficial and not affiliated with GitHub, Inc.