Skip to content

Commit f06509f

Browse files
committed
fix: cleanup
1 parent dcf7c33 commit f06509f

File tree

2 files changed

+44
-71
lines changed

2 files changed

+44
-71
lines changed
2 MB
Loading

publish-share-code/cite-code.md

Lines changed: 44 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ kernelspec:
1616
(cite-your-code)=
1717
# Ways to Add a Citation to Your Code
1818

19-
[Sharing](share-your-code) and making your code **citable** helps others **acknowledge your work, build upon it, and give you proper credit**.
19+
[Sharing](share-your-code) and making your code **citable** supports others **acknowledge your work, build upon it, and give you credit**. Citation further supports making workflows open and documenting all parts of the scientific process.
2020

21-
Citations ensure that code, software, and data receive proper recognition as part of the open scientific process. Others can easily credit your work and trace research outputs by citing your code.
2221

23-
:::{tip}
24-
<i class="fa-solid fa-rocket"></i> Want to maximize your code’s impact? **Host it on [GitHub or GitLab](share-your-code) with an [open license](open-license) and make it citable.**
25-
:::
22+
:::{admonition} What you will learn
23+
:class: note
2624

25+
* How to create a DOI using Zenodo and GitHub
26+
* How to create a citation file to use on GitHub
27+
* What a DOI is
28+
:::
2729

28-
In this lesson, you will learn:
2930

30-
1. How to create a DOI using Zenodo and GitHub
31-
2. How to create a citation file to use on GitHub
32-
1. What a a DOI is
31+
<i class="fa-solid fa-rocket"></i> This lesson assumes that your code is already **hosted on [GitHub or GitLab](share-your-code) with an [open license](open-license).**
32+
:::
3333

3434
(zenodo)=
3535
## What is Zenodo?
@@ -45,7 +45,7 @@ pyOpenSci has a [Zenodo community](https://zenodo.org/communities/pyopensci/reco
4545

4646
### How does Zenodo work?
4747

48-
Zenodo makes it easy to create a **DOI** for your GitHub repository, ensuring your code is **citable and discoverable**. To create a DOI for your repo you need to:
48+
[Zenodo](https://zenodo.org/) makes creating a **DOI** for your GitHub repository easy, ensuring your code is **citable and discoverable**. To create a DOI for your repo, you need to:
4949

5050
1. <i class="fas fa-link" style="color:#81c0aa;"></i> **Link your GitHub account** to Zenodo.
5151
2. <i class="fas fa-cogs" style="color:#81c0aa;"></i> **Enable your repository** in Zenodo’s settings.
@@ -55,9 +55,9 @@ Each release gets a unique DOI, while the repository keeps a persistent record,
5555

5656
## How to create a DOI for a Python package on GitHub
5757

58-
### Step 1: Setup Zenodo
58+
### Step 1: Login to Zenodo
5959

60-
1. Go to zenodo.org and sign in using your GitHub account
60+
1. Go to [zenodo.org](https://zenodo.org/) and sign in using your GitHub account
6161
2. Go to your profile drop-down and select “GitHub
6262

6363

@@ -69,37 +69,31 @@ You should see a screen like the one below. If you‘ve never used Zenodo before
6969
:::
7070

7171

72-
When you select GitHub you might see a list of repositories if you've used Zenodo before or if it finds your repos automagically. Don't worry if you don't see that list yet, you may have to sync your account with GitHub.
72+
When you go to the Zenodo GitHub page, you will see a list of repositories if you've used Zenodo before and synced your repos. If you haven't yet synced them, read on to learn how.
7373

74-
75-
:::{figure} /images/zenodo/zenodo-github-repos.png
74+
:::{figure} /images/zenodo/zenodo-sync-repos.gif
7675
:alt: text
7776

78-
77+
Go to your account drop down and click on GitHub. You will see a list of repositories that you have access to. Click the Sync Now button to update that list.
7978
:::
8079

81-
Click the sync now button in the get started page to update your list of GitHub repos. The more repositories that you have access to, the longer this will take. It’s normal for it to take a few minutes and maybe 5 minutes or more.
80+
### Step 2. <i class="fa-solid fa-arrows-rotate"></i> Sync your GitHub repos
8281

83-
:::{figure} /images/zenodo/zenodo-sync-repos.png
84-
:alt: text
82+
Click the <kbd><i class="fa-solid fa-arrows-rotate"></i> Sync Now</kbd> button in the **<i class="fa-brands fa-github"></i> Get started** section of the page to update the displayed list of GitHub repos. The repos that Zenodo fetches are the ones that you have ownership of or write access to.
8583

84+
The more repositories that you have access to, the longer the sync process will take. It’s normal for it to take a few minutes and maybe 5 minutes or more.
8685

87-
:::
8886

8987
:::{tip}
9088
If you have access to many GitHub repositories through both your own account and other organization accounts that you may have access too, the sync button may take a long time to run. It could take 5 minutes or more for someone with hundreds to thousands of repos). Be patient.
9189
:::
9290

93-
Once your repos are synced, it's time to "flip the switch" or turn on a connection between GitHub and Zenodo for your Python package.
91+
### Step 3. <i class="fa-solid fa-toggle-off"></i> Flip the switch <i class="fa-solid fa-toggle-on"></i>
9492

95-
:::{figure} /images/zenodo/zenodo-flip-the-switch.png
96-
:alt: text
9793

94+
Once your repos are synced, you can "<i class="fa-solid fa-toggle-off"></i> flip the switch <i class="fa-solid fa-toggle-on"></i>" or turn on a connection between GitHub and Zenodo for your Python package.
9895

99-
:::
100-
101-
102-
:::{figure} /images/zenodo/zenodo-switch-on.png
96+
:::{figure} /images/zenodo/zenodo-flip-the-switch.png
10397
:alt: text
10498

10599

@@ -108,64 +102,59 @@ Once your repos are synced, it's time to "flip the switch" or turn on a connecti
108102
:::{figure} /images/zenodo/zenodo-switch-off.png
109103
:alt: text
110104

111-
105+
Once your repos are synced, you can turn "on" the connection between GitHub and Zenodo
112106
:::
113107

114-
### Step 2: Create a release of your package on GitHub
115-
116-
Head over to your repository on GitHub. The url should look something like this:
117-
118-
https://github.com/your-user-name/ff-2024-create-python-package
119-
Here is my fork: https://github.com/lwasser/ff-2024-create-python-package
120-
121-
Go to the releases tab in github. The url will look something like this (Replace my username with your github user name!):
108+
:::{figure} /images/zenodo/zenodo-switch-on.png
109+
:alt: text
122110

123-
https://github.com/lwasser/ff-2024-create-python-package/releases
111+
Once Zenoodo is connected to GitHub, the toggle will say <kbd>On <i class="fa-solid fa-toggle-on"></i></kbd>
112+
:::
124113

125-
Click the green Create a new release button
126114

127-
:::{figure} /images/zenodo/zenodo-switch-off.png
128-
:alt: text
115+
### Step 4: Create a release of your package on GitHub
129116

117+
Head over to your repository on GitHub.
130118

131-
:::
119+
* Go to the releases tab in GitHub. The URL will look something like this:
120+
* `https://github.com/your-gh-username/ff-2024-create-python-package/releases
121+
238636`
132122

133-
Create a new tagged release!
123+
* Click the <kbd style="background-color: #238636; color:#fff; padding:.5em;">Create new release</kbd> button
124+
* Create a new tagged release
134125

135-
You can either generate automatic release notes or type in notes yourself. Either is acceptable but for convenience today you could opt to generate release notes for this release!
126+
You can generate automatic release notes or type in notes yourself.
136127

137-
When you are ready, scroll to the bottom of the page and click "publish release" When you publish your release, Zendo will begin to do its job—generating a DOI for the repository and the release and processing the metadata for the release.
128+
* When you are ready to publish your release, scroll to the bottom of the page and click <kbd style="background-color: #238636; color:#fff; padding:.5em;">Publish Release</kbd>. When you publish your release, Zendo will begin to do its job—generating a DOI for the repository and the release and processing the metadata for the release.
138129

139130
:::{figure} /images/github/github-create-release.gif
140131
:alt: text
141132

142133
Once you are ready, you can create a release. Once you have created the release, zenodo will process it and create a badge for your repository. Notice that this screen cast is for a repo where a release already exists. The process is the same whether you have a release already or not!
143134
:::
144135

145-
### Step 3: Get your zenodo badge and add it to your project README file
136+
### Step 5: Add your Zenodo badge in markdown to your project README file
146137

147-
Add your zenodo badge to your readme file in your repo!
148-
Important: be sure to use the cite all versions badge.
138+
After you create a release, you will see a badge on the Zenodo website. If you click on it, it will provide you with a copyable badge format for markdown and other formats. Copy the badge in markdown format. You will add this to your readme file.
149139

150-
151-
AFTER YOU CREATE a release, you will see a badge on the Zenodo website. If you click on it, it will provide you with a copyable badge format for markdown and other formats. Copy the badge in markdown format. You will add this to your readme file.
140+
:::{important}
141+
Be sure to use the cite-all versions badge, which will always resolve to the most current DOI rather than a specific point in time.
142+
:::
152143

153144
:::{figure} /images/zenodo/zenodo-badge.png
154145
:alt: text
155146

156-
147+
Once you have created a GitHub release, you will see a badge next to the repository with a DOI. You can click on that badge to get a copy-able markdown version of the rendered badge that you can add to your README file.
157148
:::
158149

159150

160-
## About citation.cff files
151+
### Step 6: Optional--Add your DOI to the GitHub repo: the citation.cff file
161152

162-
Now that you have a DOI, add a CITATION.cff file to make it easy for others to cite your package.
153+
Now that you have a DOI, add a [CITATION.cff](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files) file to your GitHub repository to make it easy for others to cite your package.
163154
Once you have a DOI, you can add a [citation.cff file](https://citation-file-format.github.io/) to your GitHub or GitLab repository. A `CITATION.cff` file standardizes citation information, making it easy for others to cite your work correctly.
164155

165156

166157

167-
To understand citations, it's important to understand what a DOI is.
168-
169158
## What is a DOI?
170159

171160
A **DOI**, or **Digital Object Identifier**, is a unique, permanent identifier assigned to digital content such as academic papers, datasets, software, and other research outputs. It acts like a stable web link that always directs users to the reference content, even if the location of the content changes. DOIs are commonly used in academic publishing to ensure that citations remain valid and materials are easily accessible. But you can also assign DOIs to software, data, and other research outputs and supporting elements.
@@ -190,22 +179,6 @@ The Journal of Open Source Software (JOSS), [a pyOpenSci partner](https://www.py
190179

191180
* **Zenodo DOI**: Zenodo allows you to create DOIs for a wider range of digital content, including datasets, software (like your GitHub repositories), preprints, and event presentations. Zenodo is perfect for making your code or data citable, even if it’s not part of a formal publication.
192181

193-
Both types of DOIs ensure your work is easily found and cited. CrossRef is more focused on formal publications. While Zenodo offers more flexibility by covering a broader range of research outputs.
182+
Both types of DOIs ensure that your work is easily found and cited. CrossRef is more focused on formal publications. Zenodo offers more flexibility by covering a broader range of research outputs.
194183

195184
By using the right DOI for your work, you help others find and cite it easily, no matter where or how it’s shared!
196-
197-
198-
199-
200-
201-
The video below walks you through how to set this all up.
202-
203-
:::{admonition}21 October 2024
204-
:class: important
205-
This video is a draft. It will be updated over the next two months, and a more polished version will be available soon.
206-
:::
207-
208-
209-
:::{todo}
210-
<div style="padding:75% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/1021839955?badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="zenodo-rough-cut"></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
211-
:::

0 commit comments

Comments
 (0)