@@ -182,27 +182,27 @@ Use ``user_log_dir`` and ``site_log_dir`` for application logs:
182182 format = " %(asctime)s - %(levelname)s - %(message)s " ,
183183 )
184184
185- ******************************
185+ ************************
186186 User media directories
187- ******************************
187+ ************************
188188
189- Unlike app dirs (data, config, cache, etc.), media dirs are **not ** scoped to the app name. They point to
190- standard user-facing folders that exist independently of any particular application. Use them when your app
191- needs to read from or save into a folder the user already expects — not when storing application state.
189+ Unlike app dirs (data, config, cache, etc.), media dirs are **not ** scoped to the app name. They point to standard
190+ user-facing folders that exist independently of any particular application. Use them when your app needs to read from or
191+ save into a folder the user already expects — not when storing application state.
192192
193193The distinction matters:
194194
195195- ``user_data_dir("MyApp") `` → ``~/.local/share/MyApp `` — your app's private storage
196196- ``user_documents_dir() `` → ``~/Documents `` — the user's document library
197197
198198On Linux, media dirs are defined by the `XDG user-dirs specification
199- <https://www.freedesktop.org/wiki/Software/xdg-user-dirs/> `_ and stored in ``~/.config/user-dirs.dirs ``.
200- The ``xdg-user-dirs `` tool lets users relocate them. Set the corresponding environment variable
201- (`` XDG_DOCUMENTS_DIR ``, `` XDG_DOWNLOAD_DIR ``, etc.) to override on a per-session basis. On macOS and
202- Windows, `` platformdirs `` returns the platform-conventional location.
199+ <https://www.freedesktop.org/wiki/Software/xdg-user-dirs/> `_ and stored in ``~/.config/user-dirs.dirs ``. The
200+ ``xdg-user-dirs `` tool lets users relocate them. Set the corresponding environment variable (`` XDG_DOCUMENTS_DIR ``,
201+ `` XDG_DOWNLOAD_DIR ``, etc.) to override on a per-session basis. On macOS and Windows, `` platformdirs `` returns the
202+ platform-conventional location.
203203
204204Media and user-facing directories
205- ==================================
205+ =================================
206206
207207Use these when your app saves or opens files the user should see in their own folders:
208208
@@ -223,32 +223,31 @@ Use these when your app saves or opens files the user should see in their own fo
223223 <https://gitlab.freedesktop.org/xdg/xdg-user-dirs/-/commit/217cae71c620ed2b3ed2936256ece68defccc6ab> `_.
224224
225225``user_publicshare_dir `` (``XDG_PUBLICSHARE_DIR ``)
226- Files shared with other local accounts. On Windows this is the machine-wide ``C:\Users\Public ``
227- (`` %PUBLIC% ``), not a per-user directory.
226+ Files shared with other local accounts. On Windows this is the machine-wide ``C:\Users\Public `` (`` %PUBLIC% ``), not
227+ a per-user directory.
228228
229229.. code-block :: python
230230
231231 from platformdirs import user_documents_path
232232
233233 report = user_documents_path() / " report.pdf"
234234
235- Do not use these to store application state or config — if the file would confuse the user when they browse
236- the folder, it belongs in ``user_data_dir `` instead.
235+ Do not use these to store application state or config — if the file would confuse the user when they browse the folder,
236+ it belongs in ``user_data_dir `` instead.
237237
238238Templates
239239=========
240240
241- ``user_templates_dir `` (``XDG_TEMPLATES_DIR ``) points to the folder used by file managers for new-file
242- templates. macOS has no platform-defined templates directory; ``~/Templates `` is returned as a pragmatic
243- fallback.
241+ ``user_templates_dir `` (``XDG_TEMPLATES_DIR ``) points to the folder used by file managers for new-file templates. macOS
242+ has no platform-defined templates directory; ``~/Templates `` is returned as a pragmatic fallback.
244243
245244Fonts
246245=====
247246
248247``user_fonts_dir `` points to the per-user font installation directory:
249248
250- - **Linux **: ``$XDG_DATA_HOME/fonts `` (default ``~/.local/share/fonts ``) — derived from ``$XDG_DATA_HOME ``,
251- not a dedicated env var. See the `XDG Base Directory Specification
249+ - **Linux **: ``$XDG_DATA_HOME/fonts `` (default ``~/.local/share/fonts ``) — derived from ``$XDG_DATA_HOME ``, not a
250+ dedicated env var. See the `XDG Base Directory Specification
252251 <https://specifications.freedesktop.org/basedir/latest/> `_.
253252- **macOS **: ``~/Library/Fonts ``
254253- **Windows **: ``%LOCALAPPDATA%\Microsoft\Windows\Fonts `` — the per-user font location added in Windows 10
@@ -266,19 +265,18 @@ Fonts
266265 Preference directory
267266**********************
268267
269- ``user_preference_dir `` is meaningful mainly on macOS, where Apple's conventions distinguish two separate
270- locations:
268+ ``user_preference_dir `` is meaningful mainly on macOS, where Apple's conventions distinguish two separate locations:
271269
272270- ``~/Library/Application Support/AppName `` — long-term application data, databases, plug-ins
273271- ``~/Library/Preferences/AppName `` — user-adjustable preference files (historically ``.plist ``)
274272
275- On Linux and Windows, ``user_preference_dir `` is an alias for ``user_config_dir `` — the XDG and Windows
276- conventions make no such distinction. On Android, it also aliases ``user_config_dir ``.
273+ On Linux and Windows, ``user_preference_dir `` is an alias for ``user_config_dir `` — the XDG and Windows conventions make
274+ no such distinction. On Android, it also aliases ``user_config_dir ``.
277275
278276Use ``user_preference_dir `` when you specifically need to follow Apple's `File System Programming Guide
279277<https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html> `_
280- and store preference files in ``~/Library/Preferences ``. For most cross-platform applications
281- `` user_config_dir `` is sufficient.
278+ and store preference files in ``~/Library/Preferences ``. For most cross-platform applications `` user_config_dir `` is
279+ sufficient.
282280
283281**************************
284282 User vs site directories
0 commit comments