This html demo page supports adding comments to the content. Try highlighing some text (even this line) to add your own!
This page was generated using R markdown and annotatorjs. Notes you add to this page are temporary but it should be possible to make a version that saves notes by setting up storage and modifying the R markdown source files.
The following image is from a sample page where a comment was added.
On the sample page where the image was taken, the following javascript was run in the chrome developer console:
function view_note(my_note) {
note_details = my_note.text + "\n" +
my_note.quote + "\n" +
my_note.ranges[0].start + "\n" +
my_note.ranges[0].end + "\n" +
my_note.ranges[0].startOffset + "\n" +
my_note.ranges[0].endOffset;
console.log(note_details);
};
view_note(jQuery("#mycontent").data('annotator').viewer.annotations[0]);
And this was the output:
// 2,508 kilometres long according to Wikipedia
// longest
// /p
// /p
// 29
// 36
Comments can be added to tables and code.
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
Embedded plots can’t be commented on directly. Annotate the surrounding text instead.