Today I did my first take to build a custom build logic for my markdown files:
How do I add a a cmd to open the generated output file with the program that is connected with the extension on the operating system?
I mean open .html
with my default browser, open .pdf
with my default pdf application and so on?
I also have a question about "working_dir"
is that necessary in my scenario? And do I need to add it to each variant as well?
My build file contains the following:
{
"selector": "text.html.markdown, text.html.markdown.gfm",
"working_dir": "$file_path",
"cmd": ["pandoc", "-s", "-o", "$file_base_name.html", "$file"],
"variants": [
{ "name": "pandoc >> .docx with reference file",
"cmd": ["pandoc", "--reference-docx=I:\\DATEN\\_Daniel\\misc\\pandoc-references\\begruendung-reference_alt.docx", "-o", "$file_base_name.docx", "$file"],
},
{ "name": "pandoc >> .docx without reference file",
"cmd": ["pandoc", "-o", "$file_base_name.docx", "$file"],
},
{ "name": "pandoc >> .html",
"cmd": ["pandoc", "-s", "-o", "$file_base_name.html", "$file"],
},
{ "name": "pandoc >> .org",
"cmd": ["pandoc", "-s", "-o", "$file_base_name.org", "$file"],
},
{ "name": "pandoc >> .pdf (scrlttr2)",
"cmd": ["pandoc", "$file", "-o", "$file_base_name.pdf", "--template=scrlttr2dh.latex", "--smart"],
},
{ "name": "mmd >> .html",
"cmd": ["multimarkdown", "$file", ">", "$file_base_name.org" ],
},
]
}