There are some STW templates in LibreOffice, packaged and distributed. One of them is share/template/common/internal/html.stw (generated using "StarOffice 6.1 BETA1 (Win32)"); it is loaded automatically when opening an HTML document using "HTML Document" filter (not "HTML Document (Writer)"). There are some problems here. Why would we use a really obsolete file format as a built-in template? Why would we keep it as a binary in the source, which makes it not obvious how to change e.g. curious peculiarity that HTML documents have first level of outline numbering unassigned to a heading paragraph style (unlike the other levels)? The proposal is to replace this STW with the source XML files, which would be compiled into an OTT at build time, similar to how our other built-in templates are created. I hope that this could be easyhackable - but I don't know much about the actual machinery used for our templates generated from XMLs. Heiko, could you please advise?
The correct WEB document template extension is not OTT, but OTH. The code that creates the path of the template is HTMLReader::GetTemplateName (sw/source/filter/html/swhtml.cxx). It already tries to load OTH first (since commit 1ee901d4496b79d39fbffde8bce988a159dda74e), so the proposal would need no code changes beyond the way how the binary is generated and packaged.
Laurent has gained some mastery in this area, though mostly for Impress (see README in https://gerrit.libreoffice.org/c/core/+/140537 and https://gerrit.libreoffice.org/c/core/+/137159 for the actual conversion).
I want to finish update of Impress templates bug 160712 before LibO 24.8 beta1. Then this bug sounds interesting.
Laurent Balland committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c49da95942f456623e91ae1f5c1a68efd83fec6c tdf#161173 Replace HTML template and idxexample It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.