XDG library path support for OCaml via Eio capabilities
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

xdge: enable MDX on lib/xdge.mli, fix broken doc example

Run mdx on lib/xdge.mli so the {[ ... ]} odoc block now type-checks.
The example used `env#fs` (object-method shorthand for an
imaginary env), which only works inside Eio_main.run. Wrapped in
`let run () =` and now uses `Eio.Stdenv.fs env`, then prints the
resolved config dir via Fmt.pr so the value is consumed rather than
elided.

Also removed a redundant @see-with-section-heading combo that was
blocking the odoc parse: the {2 Related Libraries} heading sat inside
the @see block, which odoc rejects ("section heading not allowed in
@see"). The same URL was already linked from the introduction's
{{:...} ...} link, so the @see was duplicate.

+10 -6
+4
lib/dune
··· 2 2 (public_name nox-xdge) 3 3 (name xdge) 4 4 (libraries eio xdg unix cmdliner fmt)) 5 + 6 + (mdx 7 + (files xdge.mli) 8 + (libraries nox-xdge fmt eio eio.unix eio_main))
+6 -6
lib/xdge.mli
··· 40 40 (0o755) when accessed, except for runtime directories which require stricter 41 41 permissions as per the specification. 42 42 43 - @see <https://specifications.freedesktop.org/basedir-spec/latest/> 44 - XDG Base Directory Specification 45 - 46 43 {2 Related Libraries} 47 44 48 45 This library is used by: ··· 87 84 88 85 {b Example:} 89 86 {[ 90 - let xdg = Xdge.v env#fs "myapp" in 91 - let config = Xdge.config_dir xdg in 92 - (* config is now <fs:$HOME/.config/myapp> or the overridden path *) 87 + let run () = 88 + Eio_main.run @@ fun env -> 89 + let fs = Eio.Stdenv.fs env in 90 + let xdg = Xdge.v fs "myapp" in 91 + let config = Xdge.config_dir xdg in 92 + Fmt.pr "config dir: %a@." Eio.Path.pp config 93 93 ]} 94 94 95 95 All directories are created with permissions 0o755 if they don't exist,