Text Editor: External Tools
Problem
GNOME Text Editor can edit text, but it doesn't provide a way to process the text with external tools.
Such an ability is important for text editors, as virtually all text files have some sort of structure that will be used by some external program, which is in fact often the whole reason why the user is editing the text at all.
For example,
- When editing documents such as LaTeX or Markdown, the user would usually want to generate output from the text file immediately after editing it.
- When editing a file that contains the source code of programs, the user would usually want to compile or execute the file immediately after editing it.
- For both natural languages and programming languages, it is common to want to verify the text file's structure or correctness, or to even automatically impose such correctness, with style/grammar checkers or formatters.
Proposed Solution
Add a way to run external tools like gedit's "External Tools" plugin.
Specifically, add a menu item in the primary menu that says "External Tools". The item will open a submenu. The contents of this submenu are the available tools, a separator, and "Manage External Tools…". If there are no tools, the submenu will show an empty state that says "No external tools available" with a "Manage External Tools…" button. The interface for managing external tools will be similar to gedit's.
Alternatively, do not provide any in-app interface for managing tools, and instead the user will create and edit them manually by placing scripts in a config directory, in which case the "External Tools" item will be hidden if there are no tools available for that file. This will reduce discoverability, but has the advantage of minimizing development burden without losing any functionality.
Possible Alternatives
It can be argued that you don't need the ability to run external tools within the text editor, as you can always just run the tool separately after you've edited and saved the file. But this is terribly inconvenient, especially when most of the tools, as can be seen in the examples listed above, are run quite frequently while editing the file.
It can also be argued that if you want to run an external tool when editing files, you should use a dedicated editor designed specifically for that tool or task. For example, Builder is a dedicated editor for developing apps. Setzer is a dedicated LaTeX editor, etc. But these solutions are undesirable in cases where one would rather not install, configure, or worse, develop complicated apps when all that's needed is a simple, general way of running external tools within a simple, general-purpose editor.
See Also
- gedit's documentation for External Tools: https://wiki.gnome.org/Apps/Gedit/Plugins/ExternalTools
- Previous issue filed against Text Editor: GNOME/gnome-text-editor#384 (closed)