summaryrefslogtreecommitdiff
path: root/src/md_generator.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-06-20 09:10:18 +0300
committerA Farzat <a@farzat.xyz>2026-06-20 10:51:40 +0300
commit1fe05c6389e8e9a69cc7126dc967b79d5f75f432 (patch)
tree991da542ff3cfce4132ca1752a35b64cd669aed7 /src/md_generator.rs
parenta658ae86ace40a00a8476a19f55aca3fe72abd8a (diff)
downloadrepo2markdown-1fe05c6389e8e9a69cc7126dc967b79d5f75f432.tar.gz
repo2markdown-1fe05c6389e8e9a69cc7126dc967b79d5f75f432.zip
Add markdown generator module/function docs
Diffstat (limited to 'src/md_generator.rs')
-rw-r--r--src/md_generator.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/md_generator.rs b/src/md_generator.rs
index 54b7cbb..48f066c 100644
--- a/src/md_generator.rs
+++ b/src/md_generator.rs
@@ -1,3 +1,8 @@
+//! Generate Markdown from null-separated path lists.
+//!
+//! This module reads a stream of NUL-separated file paths, normalizes each path, skips duplicates,
+//! and renders selected files into Markdown.
+
use std::{
collections::HashSet,
ffi::OsStr,
@@ -15,6 +20,18 @@ use crate::{
const DEFAULT_PROJECT_NAME: &str = "Project Outline";
+/// Generates Markdown for the files listed in `input`.
+///
+/// `input` is expected to contain a NUL-separated sequence of paths, such as output from
+/// `find -print0` or `git ls-files -z`.
+///
+/// Relative input paths are resolved against `origin_base`. File headings use paths made relative
+/// to `root`.
+///
+/// Duplicate files are skipped after normalization, while preserving the first occurrence order.
+///
+/// Rendering behavior such as file-size limits and placeholder output is controlled by
+/// `render_options`.
pub fn generate_markdown_from_paths<R: Read, W: Write>(
mut input: R,
output: W,