paths

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package paths resolves mdoc's per-user directories.

User-authored files (themes, and any future hand-edited config) live under an XDG-style config directory — $XDG_CONFIG_HOME/mdoc when set, otherwise ~/.config/mdoc — on every platform. That's deliberately the same friendly ~/.config path everywhere rather than os.UserConfigDir's platform default (e.g. ~/Library/Application Support on macOS), since users have to drop theme files in by hand and navigating to Library isn't ergonomic.

Regeneratable downloads (the Chromium snapshot) are NOT here — they stay in the system cache dir; see internal/browser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns mdoc's user config directory: $XDG_CONFIG_HOME/mdoc when that env var is set, otherwise ~/.config/mdoc.

func Display

func Display(p string) string

Display formats a path for showing to the user: made absolute, then with the home directory collapsed to "~" (e.g. "~/Github/mdoc/doc.md"). Paths outside the home directory, or anything that can't be resolved, are returned as the best absolute form available. This is presentation only — never feed the result back into file operations.

func ThemesDir

func ThemesDir() (string, error)

ThemesDir returns the user-level themes directory, <ConfigDir>/themes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL