Audit and compare HTML with lmhtml

Use these steps with the released lmhtml host and lmscript compiler. Each example creates a small synthetic input tree and writes its outputs under build/.

1. Run the link audit

Start in an empty working directory. The example downloads the release, checks local destinations across three pages, and writes a deterministic text and JSON report.

mkdir lmhtml-demo
cd lmhtml-demo
lmctl quickrun https://lmctl.com/tools/lmhtml/examples/check-links.lms
cat build/links.txt
broken-link build/example-links/about.html:0: #missing not found
broken-link build/example-links/index.html:0: missing.html not found

2. Check class and ID names

The class audit compares names used in markup with CSS selectors and reports near matches and unused definitions.

lmctl quickrun https://lmctl.com/tools/lmhtml/examples/class-typos.lms
cat build/classes.txt
class-undefined site:0: usde (did you mean used?)
class-unused site:0: footer
id-unused site:0: team (did you mean teem?)
id-unused site:0: unused-id

3. Compare and extract markup

Run the page diff and shared-template examples to see how lmhtml reports structural changes and finds repeated page sections.

lmctl quickrun https://lmctl.com/tools/lmhtml/examples/diff-pages.lms
cat build/diff.txt
diff-added build/example-diff/b.html:0: html > body:nth-child(2) > ul:nth-child(1) > li:nth-child(2)
diff-changed build/example-diff/a.html:0: html > body:nth-child(2) > p.intro:nth-child(2): attributes differ: class
diff-changed build/example-diff/a.html:0: html > body:nth-child(2) > p.intro:nth-child(2): text differs
summary a-vs-b:0: 3 differences
summary a-vs-noise:0: 0 differences
lmctl quickrun https://lmctl.com/tools/lmhtml/examples/make-template.lms
cat build/template-report.txt
common-part build/template.html:0: html > body:nth-child(2) > nav:nth-child(2) shared by 5 of 5 pages
summary template:0: 4 slots for 5 pages

4. Run a provider-session task

The solo script gives one Lead a task. The trio script passes the Lead's assignment to a Coder, asks a Reviewer to inspect the result, then returns both responses to the Lead.

lmctl autorun https://lmctl.com/tools/lmhtml/lmhtml_solo.lms
lmctl autorun https://lmctl.com/tools/lmhtml/lmhtml_trio.lms

What you learned

Each example uses the released host, creates its own fixture pages, and writes reports or rewritten copies under build/. The tool repository test script checks the expected output for every example.