Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Add `CITATION.cff` and a method to automatically update this citation with new releases (#1964)

Darylgolden454edecb8e0e
diff --git a/CITATION.cff b/CITATION.cff
new file mode 100644
index 000000000..697aaf6c4
--- /dev/null
+++ b/CITATION.cff
@@ -0,0 +1,13 @@
+# YAML 1.2
+---
+authors:
+ -
+ name: "The Manim Community Developers"
+cff-version: "1.1.0"
+date-released: 2021-08-02
+license: MIT
+message: "We acknowledge the importance of good software to support research, and we note that research becomes more valuable when it is communicated effectively. To demonstrate the value of Manim, we ask that you cite Manim in your work."
+title: Manim – Mathematical Animation Framework
+url: "https://www.manim.community/"
+version: "v0.9.0"
+...
\ No newline at end of file
diff --git a/README.md b/README.md
index be2227e08..dbd1a58c6 100644
--- a/README.md
+++ b/README.md
@@ -168,25 +168,10 @@ Most developers on the project use [Poetry](https://python-poetry.org/docs/) for
We acknowledge the importance of good software to support research, and we note
that research becomes more valuable when it is communicated effectively. To
demonstrate the value of Manim, we ask that you cite Manim in your work.
-Currently, the best way to cite Manim is to reference the
-[Manim home page](https://www.manim.community) using this BibTeX entry (the
-entry is for release `v0.9.0`, but can be adapted easily):
-
-```BibTeX
-@Manual{Manim:v0.9.0,
- key = {Manim},
- author = {{The Manim Community Developers}},
- title = {{Manim} -- {M}athematical {A}nimation {F}ramework ({V}ersion v0.9.0)},
- note = {\url{https://www.manim.community}},
- year = 2021,
-}
-```
-
-This should render a reference that looks more or less like this:
-
-42. The Manim Community Developers,
- [Manim – Mathematical Animation Framework (Version v0.9.0)](https://www.manim.community).
- 2021.
+Currently, the best way to cite Manim is to go to our
+[repository page](https://github.com/ManimCommunity/manim) (if you aren't already) and
+click the "cite this repository" button on the right sidebar. This will generate
+a citation in your preferred format, and will also integrate well with citation managers.
## Code of Conduct
diff --git a/scripts/TEMPLATE.cff b/scripts/TEMPLATE.cff
new file mode 100644
index 000000000..6a0d5477c
--- /dev/null
+++ b/scripts/TEMPLATE.cff
@@ -0,0 +1,13 @@
+# YAML 1.2
+---
+authors:
+ -
+ name: "Manim Community Developers"
+cff-version: "1.1.0"
+date-released: <date_released>
+license: MIT
+message: "We acknowledge the importance of good software to support research, and we note that research becomes more valuable when it is communicated effectively. To demonstrate the value of Manim, we ask that you cite Manim in your work."
+title: Manim – Mathematical Animation Framework
+url: "https://www.manim.community/"
+version: "<version>"
+...
\ No newline at end of file
diff --git a/scripts/dev_changelog.py b/scripts/dev_changelog.py
index e962759b0..3bf6adfc0 100755
--- a/scripts/dev_changelog.py
+++ b/scripts/dev_changelog.py
@@ -44,9 +44,11 @@ This script was taken from Numpy under the terms of BSD-3-Clause license.
"""
import datetime
+import os
import re
from collections import defaultdict
from pathlib import Path
+from posixpath import dirname
from textwrap import dedent, indent
import click
@@ -75,6 +77,18 @@ PR_LABELS = {
}
+def update_citation(version, date):
+ current_directory = os.path.dirname(__file__)
+ parent_directory = os.path.split(current_directory)[0]
+ with open(os.path.join(current_directory, "TEMPLATE.cff"), "r") as a, open(
+ os.path.join(parent_directory, "CITATION.cff"), "w"
+ ) as b:
+ contents = a.read()
+ contents = contents.replace("<version>", version)
+ contents = contents.replace("<date_released>", date)
+ b.write(contents)
+
+
def process_pullrequests(lst, cur, github_repo, pr_nums):
lst_commit = github_repo.get_commit(sha=this_repo.git.rev_list("-1", lst))
lst_date = lst_commit.commit.author.date
@@ -190,6 +204,10 @@ def main(token, prior, tag, additional, outfile):
authors = contributions["authors"]
reviewers = contributions["reviewers"]
+ # update citation file
+ today = datetime.date.today()
+ update_citation(tag, str(today))
+
if not outfile:
outfile = (
Path(__file__).resolve().parent.parent / "docs" / "source" / "changelog"
@@ -203,7 +221,6 @@ def main(token, prior, tag, additional, outfile):
f.write(f"{tag}\n")
f.write("*" * len(tag) + "\n\n")
- today = datetime.date.today()
f.write(f":Date: {today.strftime('%B %d, %Y')}\n\n")
heading = "Contributors"