Skip to content

📝 docs: restructure and fix cross-references#418

Closed
gaborbernat wants to merge 2 commits intotox-dev:mainfrom
gaborbernat:docs
Closed

📝 docs: restructure and fix cross-references#418
gaborbernat wants to merge 2 commits intotox-dev:mainfrom
gaborbernat:docs

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

@gaborbernat gaborbernat commented Feb 12, 2026

The README was a monolithic RST file containing full output examples for every platform, making it unwieldy for newcomers trying to understand what the library does. The Sphinx docs had a single api.rst page with a sparse index, and several public API entries (user_desktop_dir/user_desktop_path, site_runtime_dir/site_runtime_path) were missing. Docstrings had broken cross-references -- :param multipath: and :param opinion: both pointed to roaming instead of their own attributes, and class references used the wrong module path for XDGMixin.

📝 The README is now a lean README.md with a quick-start example and links to readthedocs. The Sphinx docs are split into a usage guide (all parameters with examples), a complete API reference, and a platform details page with a cross-platform comparison table. Docstrings across the codebase are corrected so Sphinx renders proper hyperlinks.

CONTRIBUTING.md now references tox instead of the already-removed hatch, and the proselint invocation in tox.toml is updated for its new subcommand CLI.

macOS users who set XDG environment variables (common with Homebrew and
dotfile managers) had no way to override Apple's default directories.
Meanwhile, Unix already handled XDG vars but the logic was baked into
the Unix class, making it impossible to share with macOS.

Extract XDG env var handling into an XDGMixin that both Unix and MacOS
inherit from. Each platform provides defaults in a base class
(_UnixDefaults, _MacOSDefaults), and the mixin checks XDG vars first,
falling through to platform defaults via super(). This ensures both
platforms stay in sync — adding a new XDG property to the mixin
automatically applies to both.
Several convenience functions in __init__.py had wrong Sphinx
cross-references pointing to `roaming` instead of `multipath` or
`opinion`. The _MacOSDefaults and _UnixDefaults classes referenced
a non-existent `platformdirs.xdg` module instead of `platformdirs._xdg`.

Also fixes grammar issues (appname, opinion, user_documents_path),
clarifies multipath scope, and adds missing docstrings for
_pick_get_win_folder and the Android class.
@gaborbernat gaborbernat requested a review from ofek as a code owner February 12, 2026 15:39
@gaborbernat gaborbernat changed the title docs 📝 docs: restructure docs and fix cross-references Feb 12, 2026
@gaborbernat gaborbernat changed the title 📝 docs: restructure docs and fix cross-references 📝 docs: restructure and fix cross-references Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant