Extending the Editor: Editor scripts, markdown, http server, javascript... defold-runtime..?

Hello,

I have a set of related questions about the Defold Editor. (sorry this is a long post in 2 parts..)
I am trying to build some editors scripts or sort of “editor extensions” to make my life easier (and maybe yours), and reading the documentation I fell into some rabbit holes!

rabbit hole 1

Considering:

  • the editor can show Markdown / html pages (then it can show images!)
  • in an editor script we can define new internal http server routes (Editor scripts) to provide an API
  • and it seems there is some custom url already defined in the editor like “defold://project.build” or “defold://open?path=/main/star-nest.vp”

So I started to think I could just

  • build an API with editor routes in an editor_script
  • provide an HTML + javascript page using this API
  • do whatever I want inside the editor just by opening the page in a tab

…BUT I try to put some scripts in Markdown file or HTML page and it doesn’t work:
Script in markdown:

And in html page:

SOOOOOO my questions are:

  • does it exists a documentation for the special urls in editor? like “defold://project.build” or “defold://open?path=/main/star-nest.vp” ? are they other ones?
  • what kind of webView or similar thing is used to display Markdown/html in the editor? Is it sandboxed without script capabilities? only plain old html?
  • should I totally forget this idea because it will never be feasible?

rabbit hole 2

another rabbit hole, I was thinking that maybe we could take another route for the editor:
allow us to use the defold engine INSIDE the editor, so we can build kind of “editor-extensions” with Defold!
Thinking of the Panthera Editor, or what d954mas has made with its calendar (Advent Calendar 2025 by d954mas), with the in-game Gizmo, 3D level editor etc… I was thinking if we could just integrate these directly into the editor, like a panel with panthera, another with custom level editor, all made with defold engine, the community could just extend it really rapidly. It could be so awesome.

Soo question:

  • could it be possible to run a defold runtime inside the editor? We could bootstrap a collection per each “editor-extension”, then the extension will just render things in specifics render targets (the panel view), and the editor could just display it in the panel?
    • then we could provide editor API functions like “create a panel for my extension, boostrap this collection into it, and give me a render target to write to”.
    • we will also need an editor API to build / compile some of the ressources to use them inside the extensions (it could be like a “live update” system, you ask for the ressource to the editor, and mount it somewhere in your extension so you can show / use it in memory in your panel…)
    • also have access to some events that are editor wise to post/receive messages from the editor and get state from the differents panels etc. (like events for short-cuts, or cliks in the panels)
    • the UI will be in defold GUI, so each extension could make whatever they want

I have really no idea of the possibilities to do it, but I really think if it is possible, it could be a enormous boost to the Defold Editor and Defold community.
Because we will use lua code we know with the engine we know to extend the editor, we use the target runtime to manipulate the source assets (so can show images, make an interactive shader editor, etc.)
So the editor will not need to evolve much from what it is now, but just be a framework for multiple editor-extensions / plugins. The editor will just glue all of it with the OS and the Bob build system, provide the code editor and existing editors.

I know this is a lengthier post I was thinking at first, but I would really appreciate ideas from the Defold team about these?

Thanks

4 Likes

Hmm, I don’t think we have this documented. There’s documentation for the http api here: defold/editor/doc/http-api.md at dev · defold/defold · GitHub (and here Editor overview). @vlaaad do we have any other documentation?

It’s a custom view, not a webview. It only renders pure markdown, no JavaScript or anything like that. We moved from a very heavyweight WebView dependency to this custom solution to reduce the size of the editor by quite a bit.

It is not possible at the moment at least. Maybe it will be possible in the future to bring in a webview dependency as part of an editor extension. @vlaaad can maybe add his opinion here?

It’s not possible at the moment, but it is actually something which we have been discussing. Not exactly like running a collection using the engine inside the editor, but to use the engine rendering capabilities when viewing components and scenes. We are also discussing a new editor script api to render primitives in the scene (for custom gizmos etc) and possibly another api to prepare and render a vertex buffer. We really want to give developers the ability to create new widgets and tools within a scene in the editor, but we have yet to design and decide on how it should be done.

Just to clarify a bit, defold editor implements a viewer for a subset of html that is typically produced by markdown libraries. No css, no js. A browser integration we had before was heavyweight and of low quality. Yes it had js, but no modern apis, e.g. no canvas, so it wasn’t possible to run defold games there.