14. Conclusion
In this document, we have demonstrated a converter that transforms ODT documents created by LibreOffice or DOCX documents from Word into a high-quality static HTML site.
In the chapter [Examples in this document], we presented the structures correctly handled by the Gemini/ChatGPT converter.
We have also shown how to export the HTML sites created by the ODT and DOCX converters to GitHub (see the chapter “Hosting the HTML Site on GitHub”)
Apart from the structures in the examples chapter, nothing is guaranteed. It is likely that the converter will display anomalies. You will then need to start a new chat with Gemini or ChatGPT to resolve these anomalies. The simplest approach is to provide the current converter to the AI along with its configuration file. Then ask the AI if it understands the code you’ve provided. This forces it to analyze the code. It will always respond that it fully understands the code. That’s when you should ask it for the desired changes. For both Word and LibreOffice, you can assist the AI with macros. The AI does not “see” the ODT or DOCX document being processed. It therefore lacks certain information. As a result, the DOCX-to-HTML converter couldn’t properly handle the numbering of rich code blocks. It couldn’t read the line number of the first line in a code block to render it in HTML. It always started the code at line 1, even if the code in the DOCX file started at line 12. So I used a macro to help. I placed the document cursor on the numbered line and asked ChatGPT to generate a VBA macro that would provide it with the characteristics of that line, enabling it to generate the HTML numbering correctly. ChatGPT did so, and I gave it the result of its macro. That solved the problem: the retrieved information showed it that the line number was being propagated by its style, not by the numbering icon. It then changed its algorithm, and it worked. So we can help AI make progress.
Another, simpler approach is to modify your document. When the converter produces an error, try modifying your document so that it uses only the structures from the examples chapter.