Skip to content

Commit 518d937

Browse files
authored
Fix: update project name and make year version dynamic in conf.py
2 parents 83aea0b + 54d404f commit 518d937

File tree

3 files changed

+76
-5
lines changed

3 files changed

+76
-5
lines changed

_static/pyos.css

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
/* anything related to the dark theme */
2222
html[data-theme="dark"] {
2323
--pst-color-info-bg: #400f59!important;
24+
--pst-color-tbl-row: #2E2E2E!important;
25+
}
26+
27+
/* anything related to the light theme */
28+
html[data-theme="light"] {
29+
--pst-color-tbl-row: #f5f1ff!important;
30+
}
2431
}
2532

2633

@@ -331,3 +338,46 @@ aside.footnote {
331338
background-color: var(--pst-color-target);
332339
}
333340
}
341+
342+
343+
.fa-circle-check {
344+
color: #7BCDBA;
345+
}
346+
347+
/* pyOpenSci table styles */
348+
349+
.pyos-table {
350+
& th.head, .pyos-table th.head.stub {
351+
background-color: #33205C!important;
352+
353+
& p {
354+
color: #fff
355+
}
356+
}
357+
& th.stub {
358+
background-color: var(--pst-color-tbl-row);
359+
font-weight: 500;
360+
}
361+
& td {
362+
vertical-align: middle;
363+
text-align: center;
364+
}
365+
}
366+
367+
368+
/* Make the first column in a table a "header" like thing */
369+
370+
371+
/* Dark mode fix for tables */
372+
@media (prefers-color-scheme: dark) {
373+
td:not(.row-header):nth-child(1) {
374+
background-color: var(--pst-color-tbl-row); /* Adjust the dark mode color */
375+
color: #ffffff; /* Adjust the text color for better contrast */
376+
font-weight: 500;
377+
}
378+
}
379+
380+
td, th {
381+
border: 1px solid #ccc; /* Light gray border */
382+
padding: 8px; /* Add some padding for better readability */
383+
}

conf.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,29 @@
1313
# import os
1414
# import sys
1515
# sys.path.insert(0, os.path.abspath('.'))
16+
from datetime import datetime
17+
import subprocess
18+
19+
current_year = datetime.now().year
20+
organization_name = "pyOpenSci"
21+
1622

1723

1824
# -- Project information -----------------------------------------------------
1925

20-
project = "python-package-guide"
21-
copyright = "2024, pyOpenSci"
26+
project = "pyOpenSci Python Package Guide"
27+
copyright = f"{current_year}, {organization_name}"
2228
author = "pyOpenSci Community"
2329

24-
# The full version, including alpha/beta/rc tags
25-
release = "0.1"
30+
# Get the latest Git tag - there might be a prettier way to do this but...
31+
try:
32+
release_value = subprocess.check_output(["git", "describe", "--tags"]).decode("utf-8").strip()
33+
release_value = release_value[:4]
34+
except subprocess.CalledProcessError:
35+
release_value = "0.1" # Default value in case there's no tag
36+
37+
# Update the release value
38+
release = release_value
2639

2740
# -- General configuration ---------------------------------------------------
2841

tutorials/1-installable-code.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ environment and shell on your computer.
5252
You are welcome to use any Python environment manager that you choose.
5353
If you are using Windows or are not familiar with Shell, you may want to check out the Carpentries shell lesson[^shell-lesson]. Windows users will likely need to configure a tool for any Shell and git related steps.
5454

55+
:::{todo}
56+
When this lesson is published, unlink
5557
* [If you need guidance creating a Python environment, review this lesson](extras/1-create-environment.md) which walks you through creating an environment using both `venv` and `conda`.
58+
:::
59+
5660
* If you aren't sure which environment manager to use and
5761
you are a scientist, we suggest that you use `conda`, particularly if you are working with spatial data.
5862

@@ -292,8 +296,12 @@ For instance, a `build-system` table most often holds two (2) variables:
292296
2. `build-backend = `, which is used to define the specific build-backend name, (in this example we are using `hatchling.build`).
293297

294298
TOML organizes data structures, defining relationships within a configuration
295-
file. You will learn more about the `pyproject.toml` format in the
299+
file.
300+
301+
:::{todo}
302+
You will learn more about the `pyproject.toml` format in the
296303
[next lesson when you add additional metadata / information to this file.](5-pyproject-toml.md)
304+
:::
297305

298306
```toml
299307
# An example of the build-system table which contains two variables - requires and build-backend

0 commit comments

Comments
 (0)