Write down the route from an extraction to a Word document - #36
Conversation
Closes the half of peopleworks#28 that PR peopleworks#29 left open: the recipe. The extraction already survives the trip through mcpOffice's Markdown converter, and this says how to make it — extract, hand a section file to word_create_from_markdown, word_convert it to PDF — and what was verified on the sample application: headings reach the outline, tables become tables, fenced C# stays code. It also answers the question the issue left for later: word_convert reaches PDF, so the route ends in a client-ready document. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Verified against the tools rather than read, since the section teaches a route somebody will follow. Everything in it holds, and the one thing I went looking to disprove turned out to be a documentation bug on your side rather than an error on ours. What I checked
Then I read [Description("Optional absolute path to a .dotx/.docx template whose styles (Heading 1-6, Normal,
tables, headers/footers) the document is built on")] string? templatePath = null)So you are right and mcpOffice's own documentation is behind its code. Worth fixing there: Your finding is real, and it is bigger than the three sitesI probed the generated Markdown across all nine sample projects, in both languages, matching any HTML-looking tag outside a code fence and outside an inline code span: Six lines, one call site — The entity sites at 499 and 915 do not fire in any fixture we have, because no fixture entity derives from a generic base. They will fire on real code, so all three get backticks. And the guard is mine. I am taking the fix rather than handing it back to you. You found it; the cleanup is not the reward. It is #39: backticks at the three sites, and the guard widened to catch a tag anywhere on a line rather than only at its start. One thing to settle before this mergesThe section says:
Both halves of that are false today, and your own findings section is what proves it. It is the kind of sentence that is worth getting right rather than softening, because it is the sentence a reader relies on when they decide not to check the output themselves. So: merge #39 first, and this becomes true as written. Nothing else in the section needs a word changed. Separately#22 is still yours if you want it — positional appearance criteria, and And XafTornado — no rush on #27, but it is the interesting one. |
Found by @MBrekhof in peopleworks#36, running the extraction through a real Word converter. `- **Base type:** ViewController<DetailView>` was printed bare, and `<DetailView>` is an inline HTML tag to every CommonMark parser. An export drops it; github.com's sanitizer strips the unknown tag. Either way the page told the reader the base class was `ViewController`, which is a different answer rather than a missing one. Backticks at the three sites that print a type name outside code: the entity base type, the controller base type, and the orphan-entity line. The guard from peopleworks#28 is mine and it missed this. It scanned only lines that *opened* with `<`, which was the shape of the `<details>` block it was written for, so a generic in the middle of a sentence walked straight past. It now matches a tag anywhere on a line, excluding fenced blocks -- where `CreateObject<Customer>()` is exactly right -- and inline code spans, which are the remedy itself and would otherwise make the guard reject its own fix. Measured before the fix across nine sample projects in both languages: six offending lines, all from the controller base type. The entity sites do not fire on any fixture we have, because no fixture entity derives from a generic base; they will on real code, so all three are fixed. AGENTS.md produced nothing, which is what he said. 392 tests, zero warnings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W45tzJFX3NoSrk7svtQeKT
Finishes #28. PR #29 made the output survive the trip; this writes the trip down.
What it says
A README section beside the HTML explainer — The same knowledge, as a document — with the route:
xaflogic extract, hand a section file to mcpOffice'sword_create_from_markdown,word_convertit to PDF. No exporter here, for the reason #28 gave, and the section says so.It answers the one question #28 left open:
word_convertreaches PDF (also html, rtf, txt, and Markdown back), so the route ends in a client-ready document. And it says which file to hand over: a section file for a single audience,_Full.mdfor the whole thing.What was verified, with the real tools
I ran the route on
PharmacyDemo.Moduleagainst mcpOffice on Document.Processor 26.1, then inspected the.docxoutline and rendered PDF pages:#–####headings#### Source code of …headings from #29 includedcsharp**bold**,`code`15 pages for the sample. 382 tests pass; nothing outside README changed.
Two things found on the way, not in this PR
- **Base type:** ViewController<DetailView>atMarkdownDocumentationGenerator.cs:602(and the entity/orphan lines at 499 and 915) emit a generic type unescaped.<DetailView>is an inline HTML tag to every CommonMark parser, so it is dropped — in the Word export, and on github.com as well, where the sanitizer strips the unknown tag. The reader seesViewController. The Emit a heading where a <details> fold was #29 guard scans only lines that open with<, so this passes it.AGENTS.mdis unaffected; it backticks every type. Separate PR if you want it: backticks at the three sites plus an inline case inPortableMarkdownTests.🤖 Generated with Claude Code