obsidian-enhancing-export icon indicating copy to clipboard operation
obsidian-enhancing-export copied to clipboard

add support for quarto

Open fcskit opened this issue 2 years ago • 4 comments

Would it be possible to add support for quarto (https://quarto.org) as an alternative to pandoc?

I played around with pandoc and quarto a bit in the last days and it seams to me that quarto is far more user friendly and supports more advanced formatting options (i.e. grid layout for images and tables, rendering of python, R, and other code) than pandoc and supports most of the pandoc options to be directly made in the yaml frontmatter (like selecting the type of output format and template). In particular the latter feels to me much more obsidian-like than having to create a hole set of different command templates.

fcskit avatar Jul 28 '23 10:07 fcskit

Arbitrary commands are supported by design. You can try it out, but I'm out of energy.

If you want, I can guide you how to achieve it.

mokeyish avatar Jul 28 '23 23:07 mokeyish

Thank you for your reply. I'm currently also lacking a bit of energy.

I tried calling quarto form the plugin as suggested by you but struggled, since the enhancing export plugin lets me change the parameters that are passed to pandoc but not the pandoc command itself. So how could I call quarto directly?

Another issue is, that Quarto expects the input files to have .qmd as file extension not .md as used by Obsidian. So one would probably need to make a temporary copy of the input file with a .qmd extension and delete it after quarto has processed it. Maybe that could be solved by a small shell script that accepts the MD filename from the obsidian vault as input and then creates a copy that is processed by quarto and cleans up afterwards.

Any suggestions how to achieve this with the enhancing export plugin or would that need its own plugin?

fcskit avatar Aug 10 '23 13:08 fcskit

Thank you for your reply. I'm currently also lacking a bit of energy.

I tried calling quarto form the plugin as suggested by you but struggled, since the enhancing export plugin lets me change the parameters that are passed to pandoc but not the pandoc command itself. So how could I call quarto directly?

Another issue is, that Quarto expects the input files to have .qmd as file extension not .md as used by Obsidian. So one would probably need to make a temporary copy of the input file with a .qmd extension and delete it after quarto has processed it. Maybe that could be solved by a small shell script that accepts the MD filename from the obsidian vault as input and then creates a copy that is processed by quarto and cleans up afterwards.

Any suggestions how to achieve this with the enhancing export plugin or would that need its own plugin?

Did you do this with a new custom command template?

FeralFlora avatar Mar 01 '24 22:03 FeralFlora

I used the shell commands plugin of obsidian and set up the following script:

mkdir -p path_to_temp_dir/{{title}}
cp {{file_path:absolute}} path_to_temp_dir/{{title}}/{{title}}.qmd
 path_to_quarto_dir/bin/quarto render path_to_temp_dir/{{title}}/{{title}}.qmd > path_to_temp_dir/{{title}}/{{title}}.log 2>&1

fcskit avatar Mar 04 '24 10:03 fcskit