Skip to content

Docs audit [April 2026]: Add dev docs#3336

Draft
deruyter92 wants to merge 15 commits into
docs/audit-2026from
arash/dev_docs
Draft

Docs audit [April 2026]: Add dev docs#3336
deruyter92 wants to merge 15 commits into
docs/audit-2026from
arash/dev_docs

Conversation

@deruyter92
Copy link
Copy Markdown
Collaborator

@deruyter92 deruyter92 commented May 19, 2026

Replacement PR for #3187 by @arashsm79 (credits go to @arashsm79, see the original PR for commit history).

Progress:

  • rebased on main
  • moved dev docs to root (include deeplabcut.core and other deeplabcut APIs)
  • fix CI build for mkdocs
  • update configuration and custom models sections
  • remove incomplete docs from index
  • add versioning deployment + workflows

Description

Dev docs: build & deploy approach

This PR adds a second documentation site alongside the existing Jupyter Book, aimed at maintainers and developers. It lives under /dev/ on GitHub Pages and is versioned with mike.

What gets built

  • API docs: all API in deeplabcut, except cli, gui, benchmark, version -> should probably be limited further as most API has no clear docstrings currently, and some are distracting from the main APIs.
  • Integration with main docs: _toc.yml links to docs/dev.md, which redirects to /dev/ (mike default → /dev/main/)

CI on PRs (build only)

  • build-dev-docs.yml — reusable workflow; installs .[dev-docs] + cairo deps, runs mkdocs build -f dev-docs/mkdocs.yml
  • Called from intelligent-testing.yml when the docs lane runs
  • Validates the site builds; does not deploy

Auto-deploy on push to main

deploy-docs.yml publishes both doc sets to the gh-pages branch:

  1. Build Jupyter Book (build-main-docs.yml) → artifact
  2. Deploy main docs — peaceiris to gh-pages root, keep_files: true (preserves /dev/)
  3. Deploy dev docsmike deploy maingh-pages/dev/main/, then mike set-default main so /dev/ redirects to the moving docs from main

The main version label means “docs tracking the main branch”, distinct from frozen release snapshots like 2.9 or 3.0.

Manual release snapshots

manage-dev-docs.yml (workflow_dispatch only):

  • deploy-version: deploy a pinned label (e.g. 2.9) from a git tag
    • Checkout workflow branch for dev-docs/ + pyproject.toml (tooling always current)
    • Overlay only deeplabcut/ from the tag (API matches that release)
    • mike deploygh-pages/dev/<version>/
  • delete-version: remove a version from gh-pages

Design choices worth noting

  • Two doc systems, one gh-pages branch — JB at root, dev docs under /dev/; peaceiris runs before mike so root deploy doesn’t wipe versioned docs
  • Branch vs tag split for manual deploys — modern mkdocs tooling from branch, API source from tag
  • No deploy on PR — only build validation; deployment happens after merge to main

@C-Achard C-Achard added the documentation documentation updates/comments label May 20, 2026
@C-Achard C-Achard added this to the Docs audit: April 2026 milestone May 21, 2026
@C-Achard C-Achard changed the title docs [April 2026] add dev docs Docs audit [April 2026]: Add dev docs May 21, 2026
@deruyter92 deruyter92 changed the base branch from main to cy/docs-audit-2026-toc-update May 27, 2026 08:57
@C-Achard C-Achard force-pushed the cy/docs-audit-2026-toc-update branch from 546d24f to b52abbf Compare May 27, 2026 12:17
Base automatically changed from cy/docs-audit-2026-toc-update to docs/audit-2026 May 27, 2026 13:07
@deruyter92 deruyter92 requested a review from C-Achard May 27, 2026 15:41
@deruyter92
Copy link
Copy Markdown
Collaborator Author

@C-Achard, ready for intermediate review. We should discuss limiting the documented API further to focus only on the current main API. Let's also discuss the workflows.

@C-Achard
Copy link
Copy Markdown
Collaborator

Thanks, having a look now!

Copy link
Copy Markdown
Collaborator

@C-Achard C-Achard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, there are a lot of comments, I'd suggest discussing this together @deruyter92, or happy to answer here if you have questions.

Thanks for adapting this!

- name: Configure git for mike
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the bot need special permissions ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, we need to add permissions for pushing to the gh-pages branch

Comment thread pyproject.toml
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on compat, should this be numpy instead?

[tool.ruff.lint.pydocstyle]
convention = "google"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And should we add auto dosctring formatting? Some API docs render weirdly for me, I think because of styling issues in the dosctrings

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather stick with google, which should normally work well with mkdocs as well.

I agree that a lot of docstrings render weirdly at the moment, which is probably worth an extra PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #3353

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow avoid duplicates?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the deploy one

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes good suggestion, this is duplicated now indeed

Comment thread pyproject.toml
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend adding:

[tool.ruff.format]
docstring-code-format = true

This helps make docstrings more consistent.

Warning

This is going to change a lot of files though! We could make a separate PR if preferred

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do it in a separate PR!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #3353

Comment thread dev-docs/mkdocs.yml
returns_multiple_items: false
docstring_section_style: table
separate_signature: true
line_length: 88
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
line_length: 88
line_length: 120
dosctring_style: numpy

This solves a lot of rendering oddities in parameters for me, but not all. Still, params sections render correctly with this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, feel free to play around with it in this branch. I'm currently not working at it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #3353

Comment thread dev-docs/mkdocs.yml

copyright: "Copyright © 2026 The DeepLabCut Team"

nav:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we put mds in a folder tree mirroring the TOC or at least grouped by topic for future extensibility?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we can do that, good suggestion.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend not adding this, I think contribution guides cover dev installation well enough.
pre-commit usage and config, CI workflows, etc, would be better topics IMO

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. Let's keep it in the main docs only


## Running Top-Down Video Analysis with Existing Bounding Boxes

When `deeplabcut.pose_estimation_pytorch.apis.videos.video_inference` is called with a top-down model, it is assumed that a detector snapshot is given as well to obtain bounding boxes with which to run pose estimation. It's possible that you've already obtained bounding boxes for your video (with another object detector or through some other means), and you want to reuse those bounding boxes instead of running an object detector again.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of guidance is super nice

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we add it in the main docs as well? or only dev-docs material?

Comment thread dev-docs/mkdocs.yml
Comment on lines +111 to +114
extra:
version:
provider: mike
default: main
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
extra:
version:
provider: mike
default: main
extra:
main_docs_url: "https://deeplabcut.github.io/DeepLabCut/"
version:
provider: mike
default: main

Comment thread dev-docs/mkdocs.yml
Comment on lines +118 to +119
nav:
- Get Started:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nav:
- Get Started:
nav:
- "← Main Documentation": "https://deeplabcut.github.io/DeepLabCut/"
- Get Started:

@deruyter92
Copy link
Copy Markdown
Collaborator Author

@C-Achard: green light to play around with this branch, I am currently not working on it. Good suggestions overall!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation documentation updates/comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants