UP | HOME

感谢那些照顾过我的人,也谢谢那些伤害过我的人,让我成为这样一个人。

1. How does the idea comes up?

ID: 32bc9bda-7433-46e3-9172-ea22915b2e77
PUBDATE: <2019-08-14 Wed 19:08>

Sometimes I think what if the source code can be translated into human natural language in some way. Or display annotation beside of source code. It would help newbie (like me) to understand the program source code better and faster.

2. Emacs ElDoc

ID: c46d01e3-26fb-4ddc-a851-0bfdc360d4ea
PUBDATE: <2019-08-14 Wed 19:08>

Emacs ElDoc already display docstring for symbol in minibuffer. There are some packages can change its display place like "eldoc-overlay". Can be displayed in context with popup, property-text or overlay etc.

3. My idea details

ID: 6240c2d2-7a67-4f0c-a5cd-aeec003502ff
PUBDATE: <2019-08-14 Wed 19:08>

4. Examples

ID: bb04a9a0-f4db-4b61-9b73-7292e1a1cf25
PUBDATE: <2019-08-14 Wed 19:08>

4.1. Lisp dialects

ID: 1a80705f-783e-48b4-87ce-f7885bd0f16b
;; +--> define a function named hello-world.
;; |   +--> function name.
;; |   |          +--> arguments.
(defn hello-world []
  ;; +--> print string "Hello, World!".
  (prn "Hello, World!"))

4.2. Python/Ruby/JavaScript

ID: 21cbbb4f-7785-4c44-b6fd-ee9eb331b98a

4.3. C/C++/Java

ID: b93ee6a6-203d-41b1-bf52-08095f9cdb01

4.4. HTML

ID: 5b311bd9-227c-47c7-abca-cb1825607ed9

4.5. CSS

ID: e41180a5-4c21-4b40-8ad7-562408d7ef5b

5. Try to implement in Emacs as an extension

ID: 061cbe7c-d82f-4c69-b536-d8a5bbfae8f5
PUBDATE: <2019-08-14 Wed 19:08>

Here is an new created empty repository https://github.com/stardiviner/eldoc-annotation.el that I will add code in future.