Greetings gents and ladies, I hope all is well.
We have website policies hosted on github as markdown files.
Our plan was simple:
- Store markdown in git (version control, transparency and downloadability of policies throughout the lifecycle of the site)
- Release policies based on tags
- Run a runner to install soffice and populate a markdown file in a pre-defined template. Use soffice to export the newly created odt file as pdf
- Append the pdf to the release
Easy peasy right! Not really…
Opening the template with soffice works flawlessly (Run soffice path/to/file.ott), creating a new writer document based on the template file.
Opening markdown is just as easy (Run soffice path/to/file.md ), opening the markdown file for editing.
Our use case requires that the markdown is opened with a template file, applying both the template and opening the markdown for editing purposes.
Based on the official documentation here, you should be able to load a markdown file with a template by running:
soffice --infilter=‘Markdown:{“TemplateURL”:{“type”:“string”,“value”:"./template.ott"}}’ test.md
What is the expected TemplateURL string/path suppose to be?
When I run the command as follows in the C:\Program Files\LibreOffice\program folder, it just opens the markdown file without applying the passed in template:
C:\Program Files\LibreOffice\program> .\soffice.com --infilter=‘Markdown:{“TemplateURL”:{“type”:“string”,“value”:“C:\Users\user1\Downloads\policy_template.ott”}}’ “C:\Users\user1\Downloads\terms_and_conditions.md”
Output:
Dependencies and Specifications:
OS: Windows 11 Pro
Version: 25H2
Build: 26200.8457
Libreoffice Version: 26.2.3.2 70e089b17412e4cb7773e41413306b17a2328c34
Summary:
We need to load a markdown file and apply a template to later export to pdf.
The official method doesn’t seem to work, it opens the markdown file without the template. It could be that I’m just passing in the incorrect url, maybe more documentation has to be provided on this command?
Any assistance would be greatly appreciated.
Thank you LibreOffice Team for such a great piece of software!
