通过Emacs在代码注释中插入图片 [英] Insert a picture in code comment via Emacs

查看:402
本文介绍了通过Emacs在代码注释中插入图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个想法刚刚出现在我的脑海里。有没有办法在代码注释中插入图片来帮助解释我们的代码?毕竟,一张照片值得一千字。



由于我使用Emacs,到目前为止Emacs还有任何实现?

解决方案

查看 iimage-mode :它是在文本缓冲区中显示图像的标准解决方案。例如,给出以下文件:

  / *一个图像值得一千个字:
*< path / to / image.png>
* /
int main(int argc,char ** argv){
return 0;
}

然后运行 Mx 开启iimage模式应显示 image.png 代替其路径。



但是,我同意@ user4815162342的评论,您需要与源文件一起分发图像,并记住在需要时更新它们(有时候很难更新代码注释)只是文字,它将更加难以更新图像评论)


An idea has just came to my mind. Is there any methods to insert a picture in code comment to help explain our code? After all, a picture is worth a thousand words.

Since I use Emacs, is there any implementations for Emacs so far?

解决方案

Take a look at iimage-mode: it is a standard solution to display an image in a text buffer.

For example, given the following file:

/* an image is worth a thousand words:
 * <path/to/image.png>
 */
int main (int argc, char **argv) {
  return 0;
}

then running M-xturn-on-iimage-mode should display image.png in place of its path.


However, I agree with @user4815162342's comment that you need to distribute images along with source files and to remember updating them when needed (it is sometimes hard to update code comments when they are text only; it will IMO be harder to update image comments)

这篇关于通过Emacs在代码注释中插入图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆