krz/orgo

Lightning fast org-mode static site generator. fast go org-mode static-site-generator

Commit 2eac492d17

2eac492d17d6d5a1062e0cae8af31ad7c35dc76b

parent: f274b51656

Unregistered key

cmc <hello@cleberg.net> · 2026-08-23 05:13 UTC
committer: <noreply@github.com>

audit: entities are supported, not out of scope (#30)

`\alpha` renders as `&alpha;` in orgo exactly as in Emacs, from an entity table
generated out of org's own `org-entities`. The audit counted every use as
out-of-scope anyway, and `docs/guide/05-org-support.org` listed entities under
"Not supported, and what happens instead" as rendering to "Literal text" — while
the Supported section three tables above documented all 412 names, the
`\alphabet` boundary and `#+OPTIONS: e:nil`. The document contradicted itself.

`fixtures/audit-entities.org` joins the Emacs oracle, which reports 100%
agreement with 0 unexplained lines.

The out-of-scope fixture still reports 10 genuine gaps, so this narrows what the
audit calls a gap without blunting it.

Layout: unified · split

docs/guide/05-org-support.org −1
@@ -186,7 +186,6 @@ a build.
186| Macros ={{{name}}}=, radio targets | Literal text. | 186| Macros ={{{name}}}=, radio targets | Literal text. |
187| Drawers other than =PROPERTIES= | Captured and dropped, including =LOGBOOK=. | 187| Drawers other than =PROPERTIES= | Captured and dropped, including =LOGBOOK=. |
188| Non-HTML export blocks | Dropped entirely. | 188| Non-HTML export blocks | Dropped entirely. |
189| Entities =\alpha= | Literal text. |
190| =#+TODO:= sequences | Not read; the default keyword set is used. | 189| =#+TODO:= sequences | Not read; the default keyword set is used. |
191| Planning lines, =: = fixed-width | Render as ordinary paragraphs. | 190| Planning lines, =: = fixed-width | Render as ordinary paragraphs. |
192 191
src/audit.rs +3 −1
@@ -345,7 +345,9 @@ impl Audit {
345 self.count(Scope::Out, "LaTeX fragment", at); 345 self.count(Scope::Out, "LaTeX fragment", at);
346 } 346 }
347 if entity_ref(line) { 347 if entity_ref(line) {
348 self.count(Scope::Out, "entity (\\name)", at); 348 // Rendered, and rendered as org renders it: `\alpha` becomes `&alpha;` in
349 // both exporters. `fixtures/audit-entities.org` holds the oracle to that.
350 self.count(Scope::In, "entity (\\name)", at);
349 } 351 }
350 for (marker, name) in [ 352 for (marker, name) in [
351 ('*', "bold"), 353 ('*', "bold"),
tests/constructs.rs +10 −3
@@ -388,6 +388,7 @@ fn well_formed_fixtures_produce_no_diagnostics() {
388 "timestamps.org", 388 "timestamps.org",
389 "images.org", 389 "images.org",
390 "tblfm.org", 390 "tblfm.org",
391 "audit-entities.org",
391 ] { 392 ] {
392 let document = parse_fixture(name); 393 let document = parse_fixture(name);
393 assert!( 394 assert!(
@@ -792,13 +793,19 @@ fn audit_ignores_backslashes_that_are_not_entities() {
792 ); 793 );
793} 794}
794 795
795/// A bare entity outside verbatim still counts. 796/// A bare entity outside verbatim still counts, and counts as supported: `\alpha`
797/// becomes `&alpha;` in orgo exactly as in Emacs, which the oracle checks on this same
798/// fixture. The 412 names come from org's own `org-entities`.
796#[test] 799#[test]
797fn audit_counts_real_entities() { 800fn audit_counts_real_entities() {
798 let report = audit_fixture("audit-entities.org"); 801 let report = audit_fixture("audit-entities.org");
802 let line = report
803 .lines()
804 .find(|l| l.contains("entity (\\name)"))
805 .expect("a real entity is counted");
799 assert!( 806 assert!(
800 report.contains("entity (\\name)"), 807 line.starts_with("IN "),
801 "a real entity was not counted:\n{report}" 808 "an entity orgo renders exactly as Emacs does must not read as a gap:\n{line}"
802 ); 809 );
803} 810}
804 811
tests/oracle.rs +1
@@ -629,6 +629,7 @@ fn every_divergence_from_emacs_is_deliberate() {
629 "images.org", 629 "images.org",
630 "elements.org", 630 "elements.org",
631 "tblfm.org", 631 "tblfm.org",
632 "audit-entities.org",
632 ]; 633 ];
633 let mut offenders = Vec::new(); 634 let mut offenders = Vec::new();
634 for fixture in fixtures { 635 for fixture in fixtures {