Skip to content

Commit d9810eb

Browse files
authored
Merge fb4d7b3 into 919a900
2 parents 919a900 + fb4d7b3 commit d9810eb

3 files changed

Lines changed: 72 additions & 50 deletions

File tree

docs/badges.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
# Badges
22

3-
Projects of the [Qiskit Ecosystem](https://qisk.it/ecosystem) are invited to proudly display it in their `README.md` file. See [How to add ecosystem badge in your README](#style).
4-
The badge is also a way to signal the project maintainer the [membership status](../status/):
5-
6-
* Regular member:
7-
* Under revision:
8-
* Alumni:
9-
10-
## How to add the ecosystem badge in the project README file
11-
12-
Once your project is part of the [Qiskit Ecosystem website](https://qisk.it/ecosystem), you can add the badge to your `README.md`:
3+
Projects of the [Qiskit Ecosystem](https://qisk.it/ecosystem) are invited to proudly display it in their `README.md` file.
4+
For adding the badge to your project:
135

146
1. Find your project in the following table.
157
2. Copy the `markdown` code.
168
3. Paste it into your `README.md`.
179

18-
See [Change the badge style](#change-the-badge-style) on how to change the badge style.
10+
??? note "Badges table for all projects"
11+
{{ read_raw('docs/assets/badges_table.md') }}
12+
13+
If you want to change the badge style, follow the instructions in [Change the badge style](#change-the-badge-style).
14+
15+
Additionally, the Qiskit Ecosystem badge is also a way to signal the project maintainer the [membership status](status.md):
1916

20-
{{ read_raw('docs/assets/badges_table.md') }}
17+
If a project badge looks like ![under revision](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_under-revision) this means that the project is not passing some of the Qiskit Ecosystem criteria and it is being considered for removal.
18+
Check out the project page for details.
19+
Once a project gets removed, their badge turn into ![under revision](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_alumni)
2120

2221
## Change the badge style
2322

2423
To change the badge style, PR [the project toml file](https://github.com/Qiskit/ecosystem/tree/main/resources/members) changing the `badge.style` entry to one of these possible values:
2524

26-
`flat`: ![Qiskit Ecosystem](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_flat)
25+
`flat`: ![flat badge](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_flat)
2726

28-
`flat-square`: ![Qiskit Ecosystem](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_flat-square)
27+
`flat-square`: ![flat-square badge](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_flat-square)
2928

30-
`plastic`: ![Qiskit Ecosystem](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_plastic)
29+
`plastic`: ![plastic badge](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_plastic)
3130

32-
`for-the-badge`: ![Qiskit Ecosystem](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_for-the-badge)
31+
`for-the-badge`: ![for-the-badge badge](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_for-the-badge)
3332

34-
`social`: ![Qiskit Ecosystem](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_social)
33+
`social`: ![social badge](https://img.shields.io/endpoint?url=https://qiskit.github.io/ecosystem/b/example_social)
3534

ecosystem/cli/members.py

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,26 @@ def create_badge_endpoints(
8989
as an example. If not given, it does not create the example endpoints.
9090
output_directory: directory in which it saves the json files. By default, ./badges
9191
"""
92+
default_schemaversion = 1
93+
default_label = "Qiskit Ecosystem"
94+
alumni_label = f"{default_label} Alumni"
95+
default_namedlogo = "Qiskit"
96+
default_color = "6929C4"
97+
warning_color = "c46929"
98+
default_iserror = "true"
99+
default_style = "flat"
92100
if not output_directory:
93101
output_directory = os.path.join(self.current_dir, "badges")
94102
Path(output_directory).mkdir(parents=True, exist_ok=True)
95103
if example:
96104
for style in ["flat", "flat-square", "plastic", "for-the-badge", "social"]:
97105
data = {
98-
"schemaVersion": 1,
99-
"label": "Qiskit Ecosystem",
100-
"namedLogo": "Qiskit",
106+
"schemaVersion": default_schemaversion,
107+
"label": default_label,
108+
"namedLogo": default_namedlogo,
101109
"message": example,
102-
"color": "6929C4",
103-
"isError": "true",
110+
"color": default_color,
111+
"isError": default_iserror,
104112
"style": style,
105113
}
106114
filename = f"example_{style}"
@@ -111,46 +119,60 @@ def create_badge_endpoints(
111119
style,
112120
os.path.join(output_directory, filename),
113121
)
114-
for message in "Alumni", "Under revision":
115-
data = {
116-
"schemaVersion": 1,
117-
"label": "Qiskit Ecosystem",
118-
"namedLogo": "Qiskit",
119-
"message": message,
120-
"color": "c46929" if message == "Under revision" else "6929C4",
121-
"isError": "true",
122-
"style": "flat",
123-
}
124-
filename = f"example_{slugify(message)}"
125-
with open(os.path.join(output_directory, filename), "w") as outfile:
126-
json.dump(data, outfile, indent=4)
127-
self.logger.info(
128-
"Example Badge endpoint (status=%s): %s",
129-
message,
130-
os.path.join(output_directory, filename),
131-
)
122+
data_alumni = {
123+
"schemaVersion": default_color,
124+
"label": alumni_label, # <-
125+
"namedLogo": default_namedlogo,
126+
"message": example,
127+
"color": default_color,
128+
"isError": default_iserror,
129+
"style": default_style,
130+
}
131+
filename = "example_alumni"
132+
with open(os.path.join(output_directory, filename), "w") as outfile:
133+
json.dump(data_alumni, outfile, indent=4)
134+
self.logger.info(
135+
"Example Badge endpoint (status=Alumni): %s",
136+
os.path.join(output_directory, filename),
137+
)
138+
139+
data_under_revision = {
140+
"schemaVersion": default_schemaversion,
141+
"label": default_label,
142+
"namedLogo": default_namedlogo,
143+
"message": "Under revision", # <-
144+
"color": warning_color,
145+
"isError": default_iserror,
146+
"style": default_style,
147+
}
148+
filename = f"example_under-revision"
149+
with open(os.path.join(output_directory, filename), "w") as outfile:
150+
json.dump(data_under_revision, outfile, indent=4)
151+
self.logger.info(
152+
"Example Badge endpoint (status=Under revision): %s",
153+
os.path.join(output_directory, filename),
154+
)
132155
for project in self.dao.get_all(name):
133156
# Create a json to be consumed by https://shields.io/badges/endpoint-badge
134157
if project.badge is None:
135158
continue
136159

137-
status = None
138-
if project.status in ["Alumni", "Under revision"]:
139-
# if status is "Alumni" or "Under revision", put in in the message
140-
status = project.status
160+
is_alumni = None
161+
if project.status == "Alumni":
162+
is_alumni = alumni_label
141163

142164
status_color = None
143165
if project.status == "Under revision":
144166
# if status is "Under revision", set status color to orange as a warning.
145167
# Color from triadic palette: https://www.color-hex.com/color/6929c4
146-
status_color = "c46929"
168+
status_color = warning_color
147169

148170
data = {
149-
"schemaVersion": project.badge.schemaVersion or 1,
150-
"label": project.badge.label or "Qiskit Ecosystem",
151-
"namedLogo": "Qiskit",
152-
"message": project.badge.message or status or project.name,
153-
"color": project.badge.color or status_color or "6929C4",
171+
"schemaVersion": project.badge.schemaVersion or default_schemaversion,
172+
"label": project.badge.label or is_alumni or default_label,
173+
"namedLogo": default_namedlogo,
174+
"message": project.badge.message or project.name,
175+
"color": project.badge.color or status_color or default_color,
154176
"isError": project.badge.isError or "true",
155177
"style": project.badge.style or "flat",
156178
}

resources/classifications.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ description = "Enables algorithm discovery at the utility scale"
3737
[[categories]]
3838
name = "Game/Fun"
3939
description = "Games or playful educational resources"
40+
section = "gamefun"
4041

4142
[[categories]]
4243
name = "Paper artifact"

0 commit comments

Comments
 (0)