-
Notifications
You must be signed in to change notification settings - Fork 5
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
adamltyson
merged 37 commits into
neuroinformatics-unit:main
from
richarddushime:sphnix-docs
Mar 12, 2025
Merged
Add website #134
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 f882987
Github repos creation
richarddushime c20945b
Fix pre-commit issues
richarddushime acecc88
title update
richarddushime 43f7a9c
description
richarddushime 5279ba8
Fix Requested Changes
richarddushime b82c0a0
improved layout
richarddushime dc847e8
Update .github/workflows/cookiecutter_docs.yml
richarddushime 2fac121
Update docs/source/conf.py
richarddushime 7708016
Update docs/source/conf.py
richarddushime bbad1ee
Update docs/source/index.md
richarddushime bbfa393
Update docs/source/project_setup.md
richarddushime ccb30f4
Update docs/source/project_setup.md
richarddushime 13cdc82
Update docs/source/contributing.md
richarddushime 3d7ec7a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 067a818
Update docs/source/contributing.md
richarddushime d9d5efb
Update docs/source/contributing.md
richarddushime a860e1a
Update docs/source/contributing.md
richarddushime 1db8ebd
Update docs/source/get_started.md
richarddushime 353e9aa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1c7341b
Update docs/source/index.md
richarddushime 0ffa2a8
Update docs/source/project_setup.md
richarddushime 7855823
Minor Requested changes
richarddushime 9b67998
Update README.md
richarddushime be81e07
Update README.md
richarddushime 31618c5
Update docs/source/modules.md
richarddushime 921f001
Restructuring the Navbar and Contents
richarddushime eded354
Minor Fixes
richarddushime 4a2d475
Update docs/source/index.md
richarddushime e82601c
Update docs/source/index.md
richarddushime 01b656a
Update docs/source/index.md
richarddushime 56a7686
Update docs/source/contributing.md
richarddushime 8575e62
Final
richarddushime 0717d5d
lints errors fix
richarddushime 92ccf06
lints fix
richarddushime 44323ff
Merge branch 'main' into sphnix-docs
adamltyson 865fff7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
python-cookiecutter.neuroinformatics.dev | ||
python-cookiecutter.neuroinformatics.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
richarddushime marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
{ | ||
"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 | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.