How is the darktable usermanual is generated?

Perhaps this isn’t the right place to ask this question.

1)
From the sources what part of the build process transforms XML into usermanual HTML
Where and what in the build process does the docbook file: usermanual/darkroom/modules/effect/watermark.xml

become:
watermark.html in the usermanaual

2)
Where in the codes does cross reference xref link
xref linkend=“blending_operators” get mapped to darkroom/concepts/blend_operators.xml
…and ultimately to blending.html#blending_operators in the manual?

I’d like to use or rewrite those parts of the build process codes in order to make an epub generation script.

I’ve got most of it done already. But i’m having trouble automating the xref cross references in docbook xml files.

This is the part where the user manual is generated, there are some comments which helps to understand how that works:

and
https://github.com/darktable-org/darktable/blob/master/doc/usermanual/CMakeLists.txt

Thank you. That got the wheels turning. i think darktable-master/src/common/usermanual_url.c was what I needed. Rather than xsl I’m using pandoc. And a little perl. I might make something useful.

I see that we are rewriting image URIs, which seems like a bad idea.

It looks like if I open darktable.XML in an editor, it can’t resolve the image paths. Am I making some mistake here?