loran_render/lib.rs
1// SPDX-License-Identifier: GPL-3.0-or-later
2// SPDX-FileCopyrightText: 2026 Mohamed Hammad
3
4#![forbid(unsafe_code)]
5
6//! Loran renderer — Markdown body → terminal output.
7//!
8//! v1 ships a single mode: ANSI-free plain text suitable for any
9//! POSIX terminal **and** for piping into `grep` / `awk` / `cut` / `sed`
10//! (PRD quality goal Q-03, NFR-050). TUI rendering with the Spacecraft Software
11//! palette is deferred to Phase 2 (Billet).
12//!
13//! Output rules (Spec §10, kept minimal so the same renderer can drive
14//! both `loran show` and the rare cases where we render a tldr body):
15//!
16//! - Headings become a blank line, the heading text in `UPPER CASE`
17//! (Standard "primary text" convention for non-coloured surfaces),
18//! another blank line.
19//! - Paragraphs become a text line followed by a blank line.
20//! - Lists are emitted with `- ` bullets, with two spaces of
21//! indentation per nesting level. Numbered lists are still bullet-
22//! formatted; numerical ordering is not preserved in v1 because the
23//! Spacecraft Software catalog content does not rely on it.
24//! - Code blocks indent every contained line by four spaces. Fence
25//! info-strings are dropped.
26//! - Inline code becomes `` `text` ``.
27//! - Links become `text (url)` — visible URLs for terminal users who
28//! cannot click.
29//! - Raw HTML is passed through verbatim.
30
31mod text;
32
33pub use text::render_text;