Hi, On Mon, 2026-10-12 at 03:29 -0700, Osman Vielma wrote: > Hi Osamu, > > Attached is the code from the Pandoc proof of concept, with the Lua filter and > instructions to run it against debian/2.100. I made the source and output > paths configurable and checked that it reproduces the chapter 3 sample I sent > you byte for byte with Pandoc 2.9.2.1.
Quite impressive. I understand your code includes some operations which should be moved to Makefile but well written to show how you did. TBH, I never knew how to use lua filter with pandoc. > It starts from the merged DocBook XML, applies the repository's table and URL > transforms, resolves the entities and cross-references, and then converts to > GFM. The README describes the extra handling for tables and admonitions, and > the limitations. This is still a proof of concept, not a ready-to-merge build > patch. > > Using Pandoc in place of w3m sounds worth exploring. Thank you for sharing > your draft MR; I would welcome adapting this code to that approach. I tried to use pandoc as shown in my MR draft: https://salsa.debian.org/debian/debian-reference/-/merge_requests/31 Here, this code on "md" branch creates a huge single markdown file in build/ directory upon running: $ make txt LANGPO=ja. As I checked how markdown and gfm version looks under my text viewer (neovim with syntax highlight and hiding.) GFM looks better than pandoc's MARKDOWN. Use of xsltproc leaves space in XML like `<ulink ...> <literal>` causing generated gfm to have `[ `mc` ](...)`. Your python-lxml generate XML file with `<ulink ...><literal>` (no space) resulting `[`mc`](...)`. (nicer) Before going further, can you tell me a few things. * Do you think chaper-by-chaper file output is better? (I think so too.) * Can you implement similar chaper-by-chaper file output using xslt and xsltproc (I suppose html generating xslt does this, so we should be able to do it.) * Do you know how to remove useless space? Osamu

