📝 docs: restructure and fix cross-references#418
Closed
gaborbernat wants to merge 2 commits intotox-dev:mainfrom
Closed
📝 docs: restructure and fix cross-references#418gaborbernat wants to merge 2 commits intotox-dev:mainfrom
gaborbernat wants to merge 2 commits intotox-dev:mainfrom
Conversation
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.rstpage 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 toroaminginstead of their own attributes, and class references used the wrong module path forXDGMixin.📝 The README is now a lean
README.mdwith 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.mdnow referencestoxinstead of the already-removedhatch, and theproselintinvocation intox.tomlis updated for its new subcommand CLI.