3

I am a programmer and I am looking for a text editor that can display images in comments. The reason is that when I am documenting some functions, I very often find myself wanting to describe them with images instead of words.

Do this kind of text editors exist?

The file doesn't contain image, it contains links to images or other types of files (in comments), the editor just displays them inline, for the pleasure of the user.

Cross-platform is preferred, or at least it should support Unix-like system such as Linux or OS X.

What programming language one uses shouldn't matter at all, as long as the syntax definition is clear.

Take the following haskell code as an example:

-- Definition of foldn
foldn c h = g where
  g 0 = c
  g n = h $ g (n - 1)

-- # Fibonacci with foldn
-- ![fib](img/fib.png)
fib = let
  f (m, n) = (n, m + n)
  outl (m, n) = m in
    outl . foldn (0, 1) f

This should be rendered in the text editor as:

-- Definition of foldn
foldn c h = g where
  g 0 = c
  g n = h $ g (n - 1)

Fibonacci with foldn

enter image description here

fib = let
  f (m, n) = (n, m + n)
  outl (m, n) = m in
    outl . foldn (0, 1) f
  • 1
    We need a few more details to give good answers here. What OS must be supported by that editor? What comments are you talking about: inline the code, or in a separate text file? In the latter case, what formats are preferred? If inline: what programming languages are targeted? – Izzy Mar 11 '15 at 11:49
  • These info have been added. – qed Mar 11 '15 at 12:11
  • Much as I like the sound of this, it's a huge step backwards from an IDE to an editor. Are you truly willing to forgo a debugger just for that? I would advise you to stick with a good IDE and add in-line comments with the path to the image. – Mawg Mar 11 '15 at 12:18
  • No, you don't have to sacrifice any of IDE or editor functionalities, it's just a richer rendering. – qed Mar 11 '15 at 12:20
  • 1
    Thanks, clearer now. But if the programming language doesn't matter, we could recommend you one suited for Visual Basic only, and it would fit your requirements. I doubt you'd be happy with that ;) Do you rather mean it should support as many as possible? As none has full support for all of them, which ones are a must to be covered? What about auto-completion, syntax highlighting, code folding, and all those other features one might wish for or expect in a "programmers editor"? – Izzy Mar 11 '15 at 12:21
1

CudaText editor (free, open source) can do it. You need to install plugin "Insert Pics" from "Plugins - Addon Manager - Install".

With plugin installed, open any text file, call plugin commands: "Plugins - Insert Pics - .....", it can add picture files into text, can del them later. It saves pictures to separate files [filename].cuda-pic.

Test of picture in file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.