I would like to write an extension that basically serves as a front-end to several file format conversion tools (think on pandoc for the moment). My idea would be that, when a user right-clicks on a file in the filebrowser, tha context meno would contain a “convert to…” option that contains itself several formats that the file could be converted to.
I have seen some documentation to add entries to context menus, but the filebrowser is apparently an exception to that.
@miguelmarco one way to do it would be to first create the command that will trigger the file format conversion (which can be a call to as server endpoint), and then add it to the context menu using the following:
app.contextMenu.addItem({
command: CommandIDs.convert, // id of your command
selector: '.jp-DirListing-item[data-isdir="false"]',
rank: 100
});