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
70 changes: 70 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy Documentation

on:
push:
branches:
- main
- docs-website
pull_request:
branches:
- main
workflow_dispatch:

# Sets permissions for GitHub Pages deployment
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
uv sync --group docs

- name: Install Pandoc (required for nbsphinx)
run: |
sudo apt-get update
sudo apt-get install -y pandoc

- name: Build documentation
run: |
uv run sphinx-build -b html docs/source build/html

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/html

deploy:
needs: build
if: github.event_name == 'push' && ( github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docs-website' )
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ instance/

# Sphinx documentation
docs/_build/
docs/build/
docs/source/_autosummary/

# PyBuilder
.pybuilder/
Expand Down Expand Up @@ -165,8 +167,7 @@ lightning_logs/
# Training data
data/training_data.txt

# Docs
docs/
# Other
fastTextAttention.py
*.pth

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# torchTextClassifiers

[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://inseeflab.github.io/torchTextClassifiers/)

A unified, extensible framework for text classification with categorical variables built on [PyTorch](https://pytorch.org/) and [PyTorch Lightning](https://lightning.ai/docs/pytorch/stable/).

## 🚀 Features
Expand Down Expand Up @@ -30,6 +32,16 @@ uv sync
pip install -e .
```

## 📖 Documentation

Full documentation is available at: **https://inseeflab.github.io/torchTextClassifiers/**

The documentation includes:
- **Getting Started**: Installation and quick start guide
- **Architecture**: Understanding the 3-layer design
- **Tutorials**: Step-by-step guides for different use cases
- **API Reference**: Complete API documentation

## 📝 Usage

Checkout the [notebook](notebooks/example.ipynb) for a quick start.
Expand Down
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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
148 changes: 148 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
/* Custom styling for torchTextClassifiers documentation with pydata-sphinx-theme */

/* Improve code block styling */
div.highlight {
border-radius: 6px;
border: 1px solid var(--pst-color-border);
margin: 1em 0;
}

div.highlight pre {
padding: 12px;
overflow-x: auto;
}

/* Better admonition styling */
.admonition {
border-radius: 6px;
padding: 1rem;
margin: 1rem 0;
}

.admonition-title {
font-weight: 600;
margin-bottom: 0.5rem;
}

/* Improve table styling */
table.docutils {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
}

table.docutils td,
table.docutils th {
border: 1px solid var(--pst-color-border);
padding: 0.5rem;
}

table.docutils th {
background-color: var(--pst-color-surface);
font-weight: 600;
}

/* Navigation improvements */
.bd-sidebar {
font-size: 0.9rem;
}

.bd-sidebar .nav-link {
padding: 0.25rem 0.5rem;
}

/* Logo text styling */
.navbar-brand {
font-weight: 600;
font-size: 1.25rem;
}

/* Improve inline code styling */
code.docutils.literal {
background-color: var(--pst-color-surface);
padding: 0.1em 0.4em;
border-radius: 3px;
font-size: 0.9em;
}

/* Better spacing for content */
.bd-content {
padding: 2rem;
}

/* Improve heading spacing */
.bd-content h1 {
margin-top: 0;
margin-bottom: 1.5rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--pst-color-border);
}

.bd-content h2 {
margin-top: 2rem;
margin-bottom: 1rem;
}

.bd-content h3 {
margin-top: 1.5rem;
margin-bottom: 0.75rem;
}

/* Cards and grids (from sphinx-design) */
.sd-card {
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s ease;
}

.sd-card:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Improve footer spacing */
footer.bd-footer {
margin-top: 3rem;
padding-top: 2rem;
border-top: 1px solid var(--pst-color-border);
}

/* Better responsive images */
img {
max-width: 100%;
height: auto;
border-radius: 4px;
}

/* Improve API documentation layout */
dl.py.class,
dl.py.function,
dl.py.method {
margin-bottom: 2rem;
}

dt.sig {
background-color: var(--pst-color-surface);
padding: 0.5rem 1rem;
border-radius: 4px;
border-left: 3px solid var(--pst-color-primary);
}

dd {
margin-left: 2rem;
margin-top: 0.5rem;
}

/* Parameter list styling */
dl.field-list {
margin-top: 1rem;
}

dl.field-list dt {
font-weight: 600;
margin-bottom: 0.25rem;
}

dl.field-list dd {
margin-left: 1.5rem;
margin-bottom: 0.5rem;
}
16 changes: 16 additions & 0 deletions docs/source/_static/logo-ttc-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/source/_static/logo-ttc-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading