Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-e . # required to build API docs
linkify-it-py
myst-parser
nbsphinx
Expand Down
24 changes: 24 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ html[data-theme=light] {
body .bd-article-container {
max-width: 100em !important;
}
/* Custom CSS for the documentation site */
/* prevent logo from being too wide and text clashing with next item */
/* See https://github.com/pydata/pydata-sphinx-theme/issues/1143#issuecomment-2468763375 */

.navbar-header-items__start .navbar-item {
width: 100%;
}

.navbar-item .navbar-brand {
width: 100%;
}

.navbar-brand img {
min-width: 0;
height: auto;
max-height: 100%;
flex-shrink: 1;
}

.navbar-brand p {
flex: 0 1 auto;
}

/* sponsors */

.col {
flex: 0 0 50%;
Expand Down
7 changes: 4 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# conf.py
# Configuration file for the Sphinx documentation builder.
import setuptools_scm
from importlib.metadata import version as get_version


project = "python-cookiecutter"
copyright = "2025, University College London"
author = "Neuroinformatics Unit"

try:
full_version = setuptools_scm.get_version(root="../..", relative_to=__file__)
full_version = get_version(project)
# Splitting the release on '+' to remove the commit hash
release = full_version.split('+', 1)[0]
except LookupError:
Expand Down Expand Up @@ -84,7 +85,7 @@
},
],
"logo": {
"text": f"{project}",
"text": f"{project} v{release}",
},
"footer_start": ["footer_start"],
"footer_end": ["footer_end"],
Expand Down
3 changes: 2 additions & 1 deletion docs/source/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ If you are contributing to the Documentation, Before pushing your changes, you c
the docs:

``` sh
# Must execute from project root directory
pip install -r docs/requirements.txt
sphinx-build docs/source docs/build
```
Expand All @@ -61,7 +62,7 @@ Alternatively, you can use the following commands to install the
dependencies and build the docs:

``` sh
pip install -r docs/requirements.txt
pip install -r docs/requirements.txt # Must execute this command from project root directory
cd docs
make html
```
Expand Down
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
[project]
name = "python-cookiecutter"
authors = [{ name = "Neuroinformatics Unit" }]
description = "A tool to automatically create a Python project structure ready to release via GitHub and PyPI."
readme = "README.md"
dynamic = ["version"]

license = { text = "BSD-3-Clause" }

[build-system]
requires = [
"setuptools>=64",
"wheel",
"setuptools-scm[toml]>=8",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.ruff]
line-length = 79
exclude = ["__init__.py", "build", ".eggs"]
Expand Down
1 change: 1 addition & 0 deletions {{cookiecutter.package_name}}/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-e . # required to build API docs
linkify-it-py
myst-parser
nbsphinx
Expand Down
6 changes: 4 additions & 2 deletions {{cookiecutter.package_name}}/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import sys

import setuptools_scm
from importlib.metadata import version as get_version

# Used when building API docs, put the dependencies
# of any class you are documenting here
Expand All @@ -24,7 +24,9 @@
copyright = "2022, {{cookiecutter.full_name}}"
author = "{{cookiecutter.full_name}}"
try:
release = setuptools_scm.get_version(root="../..", relative_to=__file__)
full_version = get_version(project)
# Splitting the release on '+' to remove the commit hash
release = full_version.split('+', 1)[0]
except LookupError:
# if git is not initialised, still allow local build
# with a dummy version
Expand Down
Loading