feat(gui): support OpenDocument templates (#138) - #219
Merged
Merged
Conversation
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Templify GUI now accepts LibreOffice / OpenDocument templates (
.odt,.ott) as well as Word templates. Processing and validation go through the format-detectingTemplateProcessor(#215). This is the last PR for #138.Changes
TemplifyService:ValidateTemplateAsyncandProcessTemplateAsyncuseTemplateProcessor. The format is detected from the file content, and unsupported files fail with "Unsupported template format: …". The temp-file-then-move output handling is unchanged. A new internal helper,GetOutputExtension(templatePath), returns.odtfor OpenDocument documents and templates and.docxotherwise. It checks the content first and falls back to the file extension for unreadable or missing files.FileDialogService: the template picker has these filters: "Templates (Word, OpenDocument)" (*.docx;*.odt;*.ott, the default), "Word Documents" and "OpenDocument Text and Templates". The save dialog uses the.odttype and default extension for an.odtname, and.docxotherwise (the warning report stays.docx).MainWindowViewModel:<template>-output.odtfor ODF input. An.otttemplate produces.odt..docxand.odtwhen the new template has the other format.examples/README.md, and a "Trying It Out" section in the LibreOffice docs page.Tests
TriasDev.Templify.Tools.Tests(63 tests, 11 new):TemplifyServiceTests:.odtand an.otttemplate are processed to an.odtwith the…opendocument.textmimetype, validated, and leave no temp filesGetOutputExtensionchecks the content first (an ODT named.docxgives.odt), then falls back to the file nameMainWindowViewModelTests:.odt/.otttemplates.docx.odtand backletter-output.odtLocal checks: the Release CI build passed. Core has 2091 tests per TFM (net10/9/8, including the LibreOffice round trips), and Converter has 95.
dotnet format --verify-no-changes,dotnet packandmkdocs build --strictpassed.Public API impact
None. The changes are in the GUI application and its tests. The library is unchanged.
Fixes #138