Markdown command line template passing not working (Win11, Ver )

Greetings gents and ladies, I hope all is well.

We have website policies hosted on github as markdown files.

Our plan was simple:

  1. Store markdown in git (version control, transparency and downloadability of policies throughout the lifecycle of the site)
  2. Release policies based on tags
  3. 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
  4. 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!

LibreOffice’s treatment of Markdown is quite recent, and may not be very mature yet.
There are some reported bugs.

  • I haven’t been able to get that command line to work in Windows 10 either.
  • A solution may be to open the markdown document and overwrite the styles with the command
    Load styles from template (from the Actions with styles icon in the sidebar)
  • Another solution that may be more convenient is to use the “Template Changer” extension Template Changer » Libreoffice Extensions

Once the template is applied to the md document (it is not necessary to convert it) it can be exported to pdf.

  • Please note that some formats do not save or do not save well in the md file