development_filename
Format a source filename for display in development tools. Resolves symbolic links in both files and parent directories, then removes the Zotonic root directory from paths inside that root. This makes template viewer, cross-reference and language server paths easier to read.
For example:
{{ template_file|development_filename|escape }}
With Zotonic installed in /home/developer/zotonic, the filename
/home/developer/zotonic/apps/mysite/priv/templates/page.tpl is displayed as
apps/mysite/priv/templates/page.tpl. A development build path whose priv
directory links to the source directory is first resolved to that source path.
The root itself is displayed as ..
Absolute paths outside the Zotonic root retain their full resolved path. Relative
paths are left unchanged. An undefined input returns undefined; other supported
filename inputs return a binary. If symlink resolution fails, the original path
is used for root-relative formatting. Link traversal is limited to prevent cycles.
The root is obtained from z_path:get_path() and is resolved through symlinks too.
It refers to the Zotonic installation, not the current site's directory.
This filter formats labels only: retain the original filename for opening files
or generating editor links. It does not check access permissions or HTML-escape
the result; use escape when displaying it in HTML, as in the example above.