Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.paths

Cross-platform path helpers. A LEAF namespace (no project deps) so any layer — core, extensions, tests — can normalize without a require cycle.

Cross-platform path helpers. A LEAF namespace (no project deps) so any
layer — core, extensions, tests — can normalize without a require cycle.
raw docstring

abbreviate-homeclj

(abbreviate-home path)
(abbreviate-home path home)

Shorten an absolute path for DISPLAY by replacing the user's home dir with ~, matching the footer/navigator/dialogs. Only rewrites when path is at or under home (so /etc/x and relative paths stay unchanged). Rendered descendants always use / separators; nil-safe.

Shorten an absolute path for DISPLAY by replacing the user's home dir with
`~`, matching the footer/navigator/dialogs. Only rewrites when `path` is at
or under home (so `/etc/x` and relative paths stay unchanged). Rendered
descendants always use `/` separators; nil-safe.
sourceraw docstring

ensure-log-date-dir!clj

(ensure-log-date-dir!)
(ensure-log-date-dir! instant)

Create the UTC date directory and return its path. Filesystem errors propagate.

Create the UTC date directory and return its path. Filesystem errors propagate.
sourceraw docstring

ensure-logs-dir!clj

(ensure-logs-dir!)

Create ~/.vis/logs (and parents) when absent; return its path string. Never throws.

Create `~/.vis/logs` (and parents) when absent; return its path string.
Never throws.
sourceraw docstring

expand-homeclj

(expand-home path)
(expand-home path home)

Expand a leading ~ path segment to the user's home directory for filesystem I/O. Bare ~ becomes home; ~/… and ~\… use native separators; ~user, mid-path tildes, and ordinary paths pass through unchanged. Nil-safe and a no-op when home is unavailable.

Expand a leading `~` path segment to the user's home directory for filesystem
I/O. Bare `~` becomes home; `~/…` and `~\…` use native separators; `~user`,
mid-path tildes, and ordinary paths pass through unchanged. Nil-safe and a
no-op when home is unavailable.
sourceraw docstring

log-date-dirclj

(log-date-dir)
(log-date-dir instant)

Diagnostic directory for an instant's UTC date: ~/.vis/logs/YYYY-MM-DD. Defaults to now; does not create directories. Long-lived writers retain the path chosen at startup rather than switching files at midnight.

Diagnostic directory for an instant's UTC date: `~/.vis/logs/YYYY-MM-DD`.
Defaults to now; does not create directories. Long-lived writers retain the
path chosen at startup rather than switching files at midnight.
sourceraw docstring

log-date-dirsclj

(log-date-dirs)

Existing UTC date directories, newest first. Ignores files, invalid dates and symlinks; retention and session log lookup share this directory boundary.

Existing UTC date directories, newest first. Ignores files, invalid dates and
symlinks; retention and session log lookup share this directory boundary.
sourceraw docstring

log-fileclj

(log-file)
(log-file role)

Diagnostic log file for this process. The name carries its role, UTC start time, and pid: ~/.vis/logs/YYYY-MM-DD/<role>-<yyyyMMddTHHmmssZ>-pid<pid>.log.

TUI and gateway are separate writers because Telemere rotates by renaming its file; sharing a path lets the non-rotating process keep writing to an orphaned descriptor. Embedded Python belongs to the gateway stream rather than a third file. The active .log remains tail-able and Telemere gzip-compresses rotated parts; housekeeping removes stale generations by age.

Diagnostic log file for this process. The name carries its role, UTC start
time, and pid: `~/.vis/logs/YYYY-MM-DD/<role>-<yyyyMMddTHHmmssZ>-pid<pid>.log`.

TUI and gateway are separate writers because Telemere rotates by renaming its
file; sharing a path lets the non-rotating process keep writing to an orphaned
descriptor. Embedded Python belongs to the gateway stream rather than a third
file. The active `.log` remains tail-able and Telemere gzip-compresses rotated
parts; housekeeping removes stale generations by age.
sourceraw docstring

logs-dirclj

(logs-dir)

Root for diagnostic logs and reports: ~/.vis/logs. Writers use UTC date directories below it. This dedicated root is accessible to the file tools and sandbox without exposing configuration, session databases or gateway tokens.

Root for diagnostic logs and reports: `~/.vis/logs`. Writers use UTC date
directories below it. This dedicated root is accessible to the file tools and
sandbox without exposing configuration, session databases or gateway tokens.
sourceraw docstring

process-idclj

(process-id)

This JVM's OS process id. Read fresh so native-image never bakes the builder's pid into the installed binary.

This JVM's OS process id. Read fresh so native-image never bakes the builder's
pid into the installed binary.
sourceraw docstring

sandbox-defs-dirclj

(sandbox-defs-dir)

Directory for persisted Python sandbox helper definitions — ~/.vis/sandbox. Its own subdir (not ~/.vis) for the same reason as logs-dir: nothing here needs to sit beside the session DB or the gateway token.

Directory for persisted Python sandbox helper definitions — `~/.vis/sandbox`.
Its own subdir (not `~/.vis`) for the same reason as `logs-dir`: nothing here
needs to sit beside the session DB or the gateway token.
sourceraw docstring

sandbox-defs-fileclj

(sandbox-defs-file session-id)

File holding ONE session's persisted sandbox helper definitions — ~/.vis/sandbox/<session-id>.py. The sandbox dies with the process, so this is what re-creates a session's own defs in a fresh one. The id is reduced to a safe file name; every other character becomes _.

File holding ONE session's persisted sandbox helper definitions —
`~/.vis/sandbox/<session-id>.py`. The sandbox dies with the process, so this
is what re-creates a session's own `def`s in a fresh one. The id is reduced
to a safe file name; every other character becomes `_`.
sourceraw docstring

set-log-role!clj

(set-log-role! role)

Set this process's diagnostic role before its first log path is opened. Accepted roles are tui, gateway, and vis (short-lived CLI work).

Set this process's diagnostic role before its first log path is opened.
Accepted roles are `tui`, `gateway`, and `vis` (short-lived CLI work).
sourceraw docstring

unixifyclj

(unixify s)

Normalize a path string to / separators on every OS. Java's File/Path APIs can hand back platform-native separators — so this is the single canonical normalizer.

Use it ONLY where a path is DATA: compared, glob-matched, shown to the model, or embedded in a URL / wire / DB. NEVER for real filesystem I/O — io/file, .exists, JGit, nio all take native paths fine. Returns nil for nil input.

Normalize a path string to `/` separators on every OS. Java's `File`/`Path`
APIs can hand back platform-native separators — so this is the single
canonical normalizer.

Use it ONLY where a path is DATA: compared, glob-matched, shown to the model,
or embedded in a URL / wire / DB. NEVER for real filesystem I/O — `io/file`,
`.exists`, JGit, nio all take native paths fine. Returns nil for nil input.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close