Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A "webview" or similar API #350

Open
mauricioszabo opened this issue Aug 12, 2021 · 2 comments
Open

A "webview" or similar API #350

mauricioszabo opened this issue Aug 12, 2021 · 2 comments
Labels
api API-related change/update/addition enhancement New feature or request good first issue Good for newcomers

Comments

@mauricioszabo
Copy link

I was thinking about doing some experiments on GUI-based NeoVim implementations, and I was thinking if you do have somekind of "webview" API similar to NyaoVim (https://github.com/rhysd/NyaoVim#ui-plugin-examples, for example).

If so, is there any plug-in making use of it?

@smolck smolck added api API-related change/update/addition enhancement New feature or request good first issue Good for newcomers labels Aug 13, 2021
@smolck
Copy link
Owner

smolck commented Aug 13, 2021

ATM, no and no, unfortunately. The closest thing uivonim has to that is the lua code for the LSP features, but that simply taps into hard-coded UI components.

However, this is a really nice idea that I would be happy to add, and soon. Right now I'm working on getting #336 finished which will take time, but once I'm done with that this is something I should be able to look into. In theory, it wouldn't be too terribly difficult; just provide a way to (safely) inject HTML/CSS/JS, and done. The hardest part might just be the security portion of things, although I guess I won't know until I try.

Alternatively, I could perhaps make it such that one can do all the HTML/CSS & scripting in a Lua plugin exclusively, without any HTML or JS files. Only thing is that performance might be too poor compared to a plugin loaded in directly into uivonim (via HTML), since with Lua it'd likely have to communicate over RPC, unless I generated HTML/JS/CSS at runtime based on the Lua code or something.

In any case, what did you have in mind for an API?

@smolck smolck changed the title Question: is there a "webview" or similar API? A "webview" or similar API Aug 13, 2021
@mauricioszabo
Copy link
Author

For now, I think just something that allows you to open a buffer (or even a split, even if it's "outside NeoVim") that's essentially a browser - something to open HTML, CSS, Javascript, etc. It doesn't even have to access Node.JS APIs or anything. The only "new" feature should be a way to send messages back and forth between the webview and the NeoVIM part.

From here on, more things could be added, but for now it seems enough :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API-related change/update/addition enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants