AndreasThinks / obsidian-to-quarto-exporter

Export Obsidian notes to Quarto-compatible QMD files.
MIT License
16 stars 0 forks source link

Inconsistent YAML resource-path formatting #3

Open machado-t opened 2 weeks ago

machado-t commented 2 weeks ago

When exporting .qmd files from Obsidian, I need to specify resource-path in the YAML front matter to ensure Quarto can locate media files. However, I’m running into issues with inconsistent formatting depending on how I set the resource-path property type in Obsidian:

  1. Text Property Type: Setting resource-path as a text property results in single quotes around the value:

resource-path: '["C:/Users/me/MyVault/Media"]'

Quarto doesn’t recognize this as a list format, so the path isn’t applied correctly.

  1. List Property Type: Setting resource-path as a list property sometimes produces the correct single-line format:

resource-path: ["C:/Users/me/MyVault/Media"]

However, other times it exports as a multiline list:

    resource-path:
      - C:/Users/me/MyVault/Media

This multiline format fails during rendering in RStudio.

Desired Outcome:

A consistent export format for resource-path that Quarto can reliably interpret, ideally as:

resource-path: ["C:/Users/me/MyVault/Media"]

This formatting issue disrupts rendering in RStudio and requires manual YAML edits after each export. Is there a way to lock or specify the output format for resource-path as a single-line list? If possible, removing single quotes from around the list when exporting would resolve the issue, as Quarto doesn’t need the quotes in this case. Or, in the other hand, is there a workaround for this, or am I configuring resource-path incorrectly in Obsidian? Thanks for this great plugin!

AndreasThinks commented 2 weeks ago

Oh interesting, this isn't how I use quarto, I normally just dump any assets in teh same dir as the relevant qmd file. I'll have a look.