Skip to content

Add website #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d3c74f6
Improve doc content #58
richarddushime Mar 3, 2025
f882987
Github repos creation
richarddushime Mar 3, 2025
c20945b
Fix pre-commit issues
richarddushime Mar 3, 2025
acecc88
title update
richarddushime Mar 5, 2025
43f7a9c
description
richarddushime Mar 5, 2025
5279ba8
Fix Requested Changes
richarddushime Mar 5, 2025
b82c0a0
improved layout
richarddushime Mar 6, 2025
dc847e8
Update .github/workflows/cookiecutter_docs.yml
richarddushime Mar 7, 2025
2fac121
Update docs/source/conf.py
richarddushime Mar 7, 2025
7708016
Update docs/source/conf.py
richarddushime Mar 7, 2025
bbad1ee
Update docs/source/index.md
richarddushime Mar 7, 2025
bbfa393
Update docs/source/project_setup.md
richarddushime Mar 7, 2025
ccb30f4
Update docs/source/project_setup.md
richarddushime Mar 7, 2025
13cdc82
Update docs/source/contributing.md
richarddushime Mar 7, 2025
3d7ec7a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 7, 2025
067a818
Update docs/source/contributing.md
richarddushime Mar 7, 2025
d9d5efb
Update docs/source/contributing.md
richarddushime Mar 7, 2025
a860e1a
Update docs/source/contributing.md
richarddushime Mar 7, 2025
1db8ebd
Update docs/source/get_started.md
richarddushime Mar 7, 2025
353e9aa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 7, 2025
1c7341b
Update docs/source/index.md
richarddushime Mar 7, 2025
0ffa2a8
Update docs/source/project_setup.md
richarddushime Mar 7, 2025
7855823
Minor Requested changes
richarddushime Mar 7, 2025
9b67998
Update README.md
richarddushime Mar 10, 2025
be81e07
Update README.md
richarddushime Mar 10, 2025
31618c5
Update docs/source/modules.md
richarddushime Mar 10, 2025
921f001
Restructuring the Navbar and Contents
richarddushime Mar 10, 2025
eded354
Minor Fixes
richarddushime Mar 10, 2025
4a2d475
Update docs/source/index.md
richarddushime Mar 11, 2025
e82601c
Update docs/source/index.md
richarddushime Mar 11, 2025
01b656a
Update docs/source/index.md
richarddushime Mar 11, 2025
56a7686
Update docs/source/contributing.md
richarddushime Mar 11, 2025
8575e62
Final
richarddushime Mar 11, 2025
0717d5d
lints errors fix
richarddushime Mar 12, 2025
92ccf06
lints fix
richarddushime Mar 12, 2025
44323ff
Merge branch 'main' into sphnix-docs
adamltyson Mar 12, 2025
865fff7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 12, 2025
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
Empty file added .gitattributes
Empty file.
46 changes: 46 additions & 0 deletions .github/workflows/docs_build_and _deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Deploy Sphinx Docs

# Generate the documentation on all merges to main, all pull requests, or by
# manual workflow dispatch. The build job can be used as a CI check that the
# docs still build successfully. The deploy job only runs when a tag is
# pushed and actually moves the generated html to the gh-pages branch
# (which triggers a GitHub pages deployment).
on:
push:
branches:
- main
tags:
- '*'
pull_request:
merge_group:
workflow_dispatch:

jobs:
linting:
# scheduled workflows should not run on forks
if: (${{ github.event_name == 'schedule' }} && ${{ github.repository_owner == 'neuroinformatics-unit' }} && ${{ github.ref == 'refs/heads/main' }}) || (${{ github.event_name != 'schedule' }})
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/lint@v2

build_sphinx_docs:
name: Build Sphinx Docs
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/build_sphinx_docs@main
with:
python-version: 3.12
use-make: true

deploy_sphinx_docs:
name: Deploy Sphinx Docs
needs: build_sphinx_docs
permissions:
contents: write
if: (github.event_name == 'push' && github.ref_type == 'tag') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/deploy_sphinx_docs@main
with:
secret_input: ${{ secrets.GITHUB_TOKEN }}
use-make: true
326 changes: 33 additions & 293 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-cookiecutter.neuroinformatics.dev
python-cookiecutter.neuroinformatics.dev
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
13 changes: 13 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
linkify-it-py
myst-parser
nbsphinx
pydata-sphinx-theme
setuptools-scm
sphinx
sphinx-autodoc-typehints
sphinx-copybutton
sphinx-design
sphinx-gallery
sphinx-notfound-page
sphinx-sitemap
sphinx-togglebutton
64 changes: 64 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
html[data-theme=dark] {
--pst-color-primary: #04B46D;
--pst-color-link: var(--pst-color-primary);
}

html[data-theme=light] {
--pst-color-primary: #03A062;
--pst-color-link: var(--pst-color-primary);
}

body .bd-article-container {
max-width: 100em !important;
}

.col {
flex: 0 0 50%;
max-width: 50%;
}

.img-sponsor {
height: 50px;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
padding-left: 5px;
}

.things-in-a-row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}

/* grids to match theme colors */
.sd-card-icon {
color: var(--sd-color-primary);
font-size: 1.5em;
margin-bottom: 0.5rem;
}

.sd-card {
padding: 1.5rem;
transition: transform 0.2s;
}

.sd-card:hover {
transform: translateY(-5px);
}

/* Ensuring content area uses full width when sidebar is hidden */
.bd-page-width {
max-width: 90% !important;
}

/* Hide sidebar on pages with hide-sidebar metadata */
body[data-hide-sidebar="true"] .bd-sidebar-primary {
display: none !important;
}

/* Expand content width when sidebar hidden */
body[data-hide-sidebar="true"] .bd-main {
flex-grow: 1;
max-width: 75%;
}
Binary file added docs/source/_static/dark-logo-niu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/favicon.ico
Binary file not shown.
Binary file added docs/source/_static/light-logo-niu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/source/_templates/footer_end.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="things-in-a-row">
<a href="https://neuroinformatics.dev/" target="_blank" >
<img src="{{ pathto('_static/light-logo-niu.png', 1) }}" alt="Sponsors" class="only-light img-sponsor"/>
<img src="{{ pathto('_static/dark-logo-niu.png', 1) }}" alt="Sponsors" class="only-dark img-sponsor"/>
</a>
<p class="sphinx-version">python-cookiecutter is based on <a href="https://github.com/napari/napari-plugin-template" target="_blank">cookiecutter-napari-plugin</a>.</p>
</div>
9 changes: 9 additions & 0 deletions docs/source/_templates/footer_start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<p class="sphinx-version">
{% trans sphinx_version=sphinx_version|e %}Created using <a href="https://www.sphinx-doc.org/" target="_blank" >Sphinx</a> {{ sphinx_version }}.{% endtrans %}
<br/>
</p>
<p class="theme-version">
{{ _("Built with the") }}
<a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html" target="_blank" >PyData Sphinx Theme</a>
{{ theme_version }}.
</p>
7 changes: 7 additions & 0 deletions docs/source/_templates/sidebar-nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="sidebar-header-items__center">
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
<div class="bd-toc-item navbar-nav">
{{ toctree(maxdepth=2, includehidden=True, collapse=False) }}
</div>
</nav>
</div>
142 changes: 142 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# conf.py
# Configuration file for the Sphinx documentation builder.
import setuptools_scm


project = "python-cookiecutter"
copyright = "2025, University College London"
author = "Neuroinformatics Unit"
try:
full_version = setuptools_scm.get_version(root="../..", relative_to=__file__)
# 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
release = "0.0.0"

# -- General configuration ---------------------------------------------------
extensions = [
"myst_parser",
"sphinx_design",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.githubpages",
"sphinx_autodoc_typehints",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx_sitemap",
"nbsphinx",
]

# Configure MyST Parser
myst_enable_extensions = [
"colon_fence",
"deflist",
"fieldlist",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"substitution",
"tasklist",
"attrs_inline"
]

myst_heading_anchors = 4

source_suffix = {
'.md': 'markdown',
'.rst': 'restructuredtext'
}

templates_path = ['_templates']
exclude_patterns = [
"**.ipynb_checkpoints",
"**/includes/**",
]

# -- HTML output options -----------------------------------------------------
html_theme = 'pydata_sphinx_theme'
html_logo = "_static/dark-logo-niu.png"
html_static_path = ["_static"]
html_title = "Python Cookiecutter"
html_favicon = "_static/favicon.ico"


html_theme_options = {
"navbar_start": ["navbar-logo"],
"navbar_center": ["navbar-nav"],
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/neuroinformatics-unit/python-cookiecutter",
"icon": "fa-brands fa-github",
"type": "fontawesome",
},
{
"name": "Zulip (chat)",
"url": "https://neuroinformatics.zulipchat.com/#narrow/channel/406003-Python-cookiecutter",
"icon": "fa-solid fa-comments",
"type": "fontawesome",
},
],
"logo": {
"text": f"{project}",
},
"footer_start": ["footer_start"],
"footer_end": ["footer_end"],
"external_links": [],
}

# Sitemap configuration
github_user = "neuroinformatics-unit"
html_baseurl = "https://python-cookiecutter.neuroinformatics.dev"
sitemap_url_scheme = "{link}"


# -- HTML sidebar configuration ---------------------------------------------
html_sidebars = {
# Apply sidebar to ALL pages except index
"**": ["sidebar-nav.html"],
"index": []
}
html_show_sourcelink = False


def setup(app):
app.add_css_file("css/custom.css")


# What to show on the 404 page
notfound_context = {
"title": "Page Not Found",
"body": """
<h1>Page Not Found</h1>

<p>Sorry, we couldn't find that page.</p>

<p>We occasionally restructure the python-cookiecutter website, and some links may have broken.</p>

<p>Try using the search box or go to the homepage.</p>
""",
}

# needed for GH pages (vs readthedocs),
# because we have no '/<language>/<version>/' in the URL
notfound_urls_prefix = None

# The linkcheck builder will skip verifying that anchors exist when checking
# these URLs
linkcheck_anchors_ignore_for_url = [
"https://neuroinformatics.zulipchat.com/",
"https://neuroinformatics.zulipchat.com/#narrow/channel/406003-Python-cookiecutter",
"https://github.com/pypa/setuptools_scm#default-versioning-scheme",
]
# A list of regular expressions that match URIs that should not be checked
linkcheck_ignore = [
"https://github.com/",
"https://opensource.org/license/bsd-3-clause/", # to avoid odd 403 error
]
Loading