3rd / image.nvim

🖼️ Bringing images to Neovim.
MIT License
803 stars 35 forks source link

add integrations for html and css files #148

Closed zuloo closed 2 months ago

zuloo commented 2 months ago

I added integrations for html (aswell as xhtml and htm) and css (aswell as sass and scss).

I included code to search for the linked images in parent directories, so image urls relative to the webroot can be resolved. That worked for me as long as webpack did not change the names of packed asset directories.

BTW: in integrations/neorg.lua line 33

(#eq? name "image")

should actually be

(#eq? @name "image"))

according to treesitter doku.

I do not use or have neorg, so maybe you want to check if that is a mistake

zuloo commented 2 months ago

something wrong with the PR? or just lazy?

3rd commented 2 months ago

Nothing wrong, not lazy :joy: (made me chuckle), I saw it the first time and thought about it on and off, and I think it's ok if we don't enable it by default. I don't think most people would expect it to work in HTML/CSS. Personally I imagined this plugin will be just a library for a long time, but integrations matter to users more. What do you think about disabling it by default?

Edit: We need to document it in the readme as well.

zuloo commented 2 months ago

as a frontend/fullstack dev, I think the integrations are very useful. It's a nice feature to see that images get resolved to avoid typos and stuff, for example. But yes, disabling them by default is fine. Maybe just mention them in the readme, so people can copy paste the config to enable them.

3rd commented 2 months ago

I wasn't able to make changes to this PR to disable them by default :( Can you help? Edit: I'll merge it into a feature branch first.