Skip to main content

markdown

Function markdown 

Source
pub fn markdown(s: &EconomicsSummary) -> String
Expand description

The whole report for one summary, as Markdown. It reads nothing but s, so the same summary always renders to the same bytes. When no methodology is declared (present is false) the report stops after the verdict, its unmet thresholds and the records that could not be read, because every later section would describe evidence that cannot exist. Free text placed in a table cell has its pipes escaped and its line breaks flattened, so a reason can never split a row. Every per-pair and aggregate token figure is a reduction, spelled by amount: a negative reduction means Majordomus used more tokens, and no figure is negated on the way to the page.

use majordomus_cli::economics::{report, summarize};
let dir = tempfile::tempdir().unwrap();
let s = summarize(dir.path(), &Default::default());
let text = report::markdown(&s);
assert!(text.starts_with("# Token economics: benchmark report"));
assert!(text.contains(&s.verdict.statement));
assert!(!s.present && !text.contains("## Metrics"));