Reminder that it's 2026 and batch-mode typesetting seems an oddly low bar for what we can get from a computer.
Tree-structured documents in a live (WYSIWYG) typesetter with a programmable editor are possible, as is demonstrated by https://texmacs.org (https://www.texmacs.org/tmweb/home/videos.en.html if you don't have it installed).