pub fn process_file_includes(
markdown: &str,
base_dir: &Path,
depth: usize,
) -> Result<(String, Vec<IncludedFile>), String>Expand description
Process file includes in Nixpkgs/NixOS documentation.
This function processes file include syntax:
```{=include=}
path/to/file1.md
path/to/file2.md
```§Arguments
markdown- The input markdown textbase_dir- The base directory for resolving relative file pathsdepth- Current recursion depth (use 0 for initial call)
§Returns
Returns Ok((processed_markdown, included_files)) where included_files is
a list of all successfully included files.
§Errors
Returns Err(message) if recursion depth exceeds [MAX_INCLUDE_DEPTH],
which likely indicates a circular include cycle.
§Safety
Only relative paths without “..” are allowed for security.