A plugin for Obsidian that allows seamless editing of QMD files as if they were Markdown.
QMD files combine Markdown with executable code cells and are supported by Quarto, an open-source publishing system. These files are compatible with editors like RStudio and VSCode.
This plugin originated in 2022 as a minimal change to a now-archived project by deathau: deathau/txt-as-md-obsidian. It has since evolved to include additional integrations and features.
As of the end of 2024, there are also other plugins exist that make it easier to work with Obsidian and Quarto:
- Ridian offers R code block execution and variable previews.
- Quarto Exporter helps export Obsidian Markdown files into the QMD format.
The main difference between this plugin and these other plugins is that this plugin allows you to compile QMD files as they are, without exporting them to another folder. In this regard, it is more similar to the Pandoc plugin.
- Added an option to run Quarto preview for the current
qmd
file.
- Repurposed the plugin to enable viewing and editing of QMD files.
- Made the plugin available via BRAT and Obsidian.
- Initial release by death_md, supporting
.txt
files.
- Use Obsidian 1.8’s web preview to enable seamless in-app previews.
- Recognize
{language}
for code block syntax highlighting. - Add CSS support for callout blocks.
- Enable the creation of new QMD files.
- Add a render command.
To enable linking with Quarto files, ensure the "Detect all file extensions" toggle is activated in the Files & Links
section of Obsidian settings.
If you'd like to hide additional file types, use the following CSS snippet. Save it in your snippets folder and enable it via the Appearance menu in Obsidian. You can add more file extensions as needed.
div[data-path$='.Rproj'] {
display: none;
}
div[data-path$='.cls'] {
display: none;
}
div[data-path$='.yml'] {
display: none;
}
div[data-path$='.json'] {
display: none;
}
This plugin requires Obsidian v0.10.12 or later to work properly, as the necessary APIs were introduced in this version.
The plugin is available in Obsidian's community plugin list.
For beta releases, you can use the BRAT plugin.
- Download the latest release from the Releases section of the GitHub repository.
- Extract the plugin folder from the zip file to your vault's plugins directory:
<vault>/.obsidian/plugins/
- Note: On some systems, the
.obsidian
folder might be hidden. On macOS, pressCommand + Shift + Dot
to reveal hidden folders in Finder.
- Note: On some systems, the
- Reload Obsidian.
- If prompted about Safe Mode, disable it and enable the plugin.
Alternatively, go to Settings → Third-party plugins, disable Safe Mode, and enable the plugin manually.
Important: Third-party plugins can access files on your computer, connect to the internet, and install additional programs.
The source code for this plugin is open and available on GitHub for audit. While I assure you that the plugin does not collect data or perform any malicious actions, installing plugins in Obsidian always involves a level of trust.
This project is built using TypeScript for type checking and documentation.
It relies on the latest Obsidian plugin API in TypeScript Definition format, which includes TSDoc comments for documentation.
Note: The Obsidian API is in early alpha and may change at any time.
To contribute or customize the plugin:
- Clone this repository.
- Run
npm i
oryarn
to install dependencies. - Use
npm run build
to compile the plugin. - Copy
manifest.json
,main.js
, andstyles.css
to a subfolder in your plugins directory:<vault>/.obsidian/plugins/<plugin-name>/
- Reload Obsidian to apply changes.
Alternatively, clone the repository directly into your plugins folder. After installing dependencies, run npm run dev
to enable watch mode for live compilation.
Reload Obsidian (Ctrl + R
) to view updates.