Open ww-daniel-mora opened 1 year ago
Can you please provide steps to reproduce your issue?
You can view the debug log by adding the following code to your init.lua
before loading this plugin.
vim.g.mjml_preview_debug = true
Okay I actually misunderstood what I was seeing and it was working but there are 3 improvements we should make.
This structure will not be able to load the local image.
email/
- index.mjml
- images/
- some_img.png
It looks like we are hitting this catch block https://github.com/ec965/mjml-preview.nvim/blob/main/app/src/index.js#L185 when another file is requested.
The current architecture is to read your MJML file's content from the Neovim buffer rather than read the file directly. The web server isn't configured to serve arbitrary files in the filesystem.
If you want to be able to serve files from any folder on your computer, we have a couple options:
MjmlPreviewToggle
and MjmlPreviewOpen
user commands to serve an assets folder.'3' would work for your example file structure, but it would no longer work if we had a buffer that wasn't yet saved to disk.
I think we can implement 3 and then fall back to the "cwd" if the file is not saved.
Improve documentation and explain the expected mjml project structure for this plugin to work. At the moment I am unable to correctly render an mjml file and it is not clear what the plugin is doing from the documentation.