Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
31 changes: 31 additions & 0 deletions .github/workflows/cookiecutter_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Documentation
on:
push:
branches: [main]
tags: ['*']

jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'

- name: Install dependencies
run: |
pip install -r docs/requirements.txt

- name: Build docs
run: |
cd docs
make clean && make html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
Empty file added docs/.nojekyll
Empty file.
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
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
myst-parser
pydata-sphinx-theme
sphinx
93 changes: 93 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/* Top navbar */
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.8rem 2rem;
background: transparent;
}

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

.navbar-center-group {
flex: 1;
display: flex;
justify-content: center;
gap: 2rem;
margin: 0 2rem;
float: right;
}

.navbar-nav {
display: flex;
gap: 1.5rem;
margin: 0;
padding: 0;
align-items: center;
}

.navbar-icons {
display: flex;
gap: 1.5rem;
align-items: center;
}

/* Rest of your existing styles remain */
.navbar-brand-logo img { height: 40px; }
.nav-link { color: white !important; font-weight: 500; }
.icon-link { color: white !important; font-size: 1.2rem; }
.bd-sidebar-secondary { display: none !important; }

/* Mobile responsiveness */
@media (max-width: 768px) {
.navbar {
flex-wrap: wrap;
padding: 0.8rem;
}

.navbar-center-group {
order: 2;
width: 100%;
margin: 1rem 0;
justify-content: center;
}

.navbar-brand {
order: 1;
}
}

/* Search field positioning */
.navbar-search {
margin-left: auto;
flex: 0 0 250px;
}
.bd-search {
display: flex;
gap: 1rem;
float: right;
position: relative;
}

/* Search input styling */
.bd-search .form-control {
background: rgba(255, 255, 255, 0.1) !important;
border: 1px solid rgba(255, 255, 255, 0.3) !important;
color: white !important;
padding: 0.5rem 1rem !important;
}

.bd-search .btn {
color: rgba(255, 255, 255, 0.7) !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
.navbar-search {
flex: 1 1 100%;
order: 3;
margin-top: 1rem;
}
}
Binary file added docs/source/_static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/source/_templates/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<nav class="bd-navbar navbar">
<!-- Left: Logo -->
<div class="navbar-brand">
<a class="navbar-brand-logo" href="{{ pathto(master_doc) }}">
<img src="{{ pathto('_static/logo.png', 1) }}" alt="{{ project }} logo">
</a>
</div>

<!-- Center: Navigation items -->
<div class="navbar-center-group">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link" href="https://cookiecutter-data-science.drivendata.org/">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ pathto('contributing') }}">Contribute</a>
</li>
</ul>

<div class="navbar-icons">
<a href="https://github.com/neuroinformatics-unit/python-cookiecutter" class="icon-link" title="GitHub">
<i class="fab fa-github">GitHub</i>
</a>
<a href="https://github.com/yourusername/cookiecutter-python/stargazers" class="icon-link" title="Give us a Star">
<i class="fas fa-star" style="color: gold;">Give a Star</i>
</a>
</div>
</div>

<!-- Right: Custom Search -->
<div class="navbar-search">
{% include "search-field.html" %}
</div>
</nav>
11 changes: 11 additions & 0 deletions docs/source/_templates/search-field.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{%- if pagename != "search" %}
<div class="bd-search">
<form class="bd-search d-flex" action="{{ pathto('search') }}" method="get">
<input type="search" class="form-control" name="q" id="search-input" placeholder="{{ _('Search...') }}"
aria-label="{{ _('Search...') }}" autocomplete="off">
<button class="btn" type="submit">
<i class="fas fa-search"></i>
</button>
</form>
</div>
{%- endif %}
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>
61 changes: 61 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# conf.py

# -- Project information -----------------------------------------------------
project = 'cookiecutter-python'
author = 'Name'
release = '0.1.0'

# -- General configuration ---------------------------------------------------
extensions = [
"myst_parser",
"sphinx_design",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon"
]

myst_enable_extensions = [
"colon_fence",
"deflist",
"linkify",
"substitution",
"tasklist",
]

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

templates_path = ['_templates']

# -- HTML output options -----------------------------------------------------
html_theme = 'pydata_sphinx_theme'
html_logo = "_static/logo.png"
html_static_path = ["_static"]

html_theme_options = {
# Disable all default search locations
"navbar_end": [],
"navbar_persistent": [],

# Configure navbar
"navbar_start": [],
"navbar_center": ["navbar.html"],
"navbar_end": [],

# Disable right sidebar and TOC
"show_toc_level": 0,
"secondary_sidebar_items": [],

# Keep other settings
"show_nav_level": 2,
"navigation_depth": 3,
"collapse_navigation": True,
}

html_sidebars = {
"**": ["sidebar-nav.html", "search-field.html"]
}

def setup(app):
app.add_css_file("css/custom.css")
90 changes: 90 additions & 0 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Contributing to cookiecutter-python
=====================================

Thank you for considering contributing to cookiecutter-python!
We welcome contributions that improve the project, whether it’s code, documentation, or enhancements.
Please follow the guidelines below to ensure a smooth process.

Workflow
--------

1. **Fork and Clone the Repository**
Fork the main repository on GitHub, then clone your fork locally:

.. code-block:: bash

git clone https://github.com/<your-username>/python-cookiecutter.git
cd python-cookiecutter

2. **Create a New Branch**
Create and switch to a new branch for your changes:

.. code-block:: bash

git checkout -b my_new_feature

3. **Make Your Changes**
Edit the website content, code, or documentation as needed.
When you’re ready, add and commit your changes with a descriptive message:

.. code-block:: bash

git add .
git commit -m "Describe your changes here"

4. **Push Your Branch and Create a Pull Request**
Push the new branch to GitHub:

.. code-block:: bash

git push origin --set-upstream origin my_new_feature

Then, open a pull request against the `main` branch of the main repository.
This will automatically trigger a GitHub Action to verify that the website builds correctly.

5. **Review and Merge**
If the build checks pass, assign someone to review your pull request.
Once approved and merged into the `main` branch, another GitHub Action will build the website and publish it to the `gh-pages` branch.

6. **Deployment**
After merging, the updated website will be available at:
`python-cookiecutter.github.io`

Local Testing
-------------

Before pushing your changes, you can test the website locally:

- **First-Time Setup:**
Install the required dependencies and build the site:

.. code-block:: bash

pip install -r docs/requirements.txt
sphinx-build docs/source docs/build

Alternatively, you can use the following commands to install the dependencies and build the site:

.. code-block:: bash

pip install -r docs/requirements.txt
cd docs
make html

- **Rebuilding the Site:**
Each time you update the documentation, rebuild the site by running:

.. code-block:: bash

rm -rf docs/build && sphinx-build docs/source docs/build

Then, open ``docs/build/index.html`` in your browser to preview the changes.

Additional Guidelines
---------------------

- **Coding Standards:** Ensure that your contributions follow the project's coding and documentation guidelines.
- **Commit Messages:** Write clear and concise commit messages.
- **Documentation:** If your changes affect the website or project behavior, please update the documentation accordingly.

Thank you for your contributions!
Loading