I was wondering if any of our skilled CSS or other community members would know how to design a way to annotate code viewed via code body?
Just imagine if we could annotate key code in the core, not touch the tiddler, for documentation or our own research projects, and to do this to specific pieces of text.
- We could even indicate where to make changes to hack or customise.
When viewing a tiddler with code-body=yes we see the “code” of the tiddler, in a simple text form. It would be great if we could select a piece of unique code (used as the key) then annotate it, write a sentence or paragraph relating to the code piece. Then display an icon showing it is annotated and along with the mouse over the text display the content of the annotation on mouse over.
- An option to hide the annotation icon(s) would be good
I have some ideas how to achieve this but not enough to bring it to fruition.
I see value in creating an annotation tiddler containing the source tiddler, the string you are annotating so we can use the text field as the annotation and use search and tagging against the annotation tiddlers.
- The annotation tiddler could also optionally display within it the code tiddler and only this annotations selected code.
Requirements;
While viewing or editing code on any tiddler select some code and click to create the annotation tiddler, accept details of the annotation. Allowing this from both the view template and editor toolbar would be helpful.
While viewing the code highlight/icon indicate the presence of the annotation on mouse over display the annotation text field (rendered) and on click open the annotation tiddler.
Both of the above could be designed for use in other use cases if generalised, such as;
- A writer/reviewer annotating a draft (in view mode, no code formatting?)
- Send the resulting annotations to author
[Late note]
Yes, my mistake I am looking at the <$dynannotate> now.
- Its awefully complex so I do need help
