org-remark icon indicating copy to clipboard operation
org-remark copied to clipboard

Support taking annotations and marginalia in EWW buffers.

Open vedang opened this issue 3 years ago • 3 comments

EWW buffers are not associated with a file, which causes buffer-file-name to return nil.

This change extracts the functionality to find the source filename into a separate function. Earlier, org-remark used buffer-file-name to find the source filename.

This allows us to handle eww-mode within the new function (and potentially more such modes in the future).

We also add org-remark-auto-on to the eww-after-render-hook to make sure that existing annotations are loaded.

The end result is that it is now possible to annotate web-pages inside EWW.

Function introduced:

  1. org-remark-source-find-file-name - All direct calls to buffer-file-name are now replaced by this function.

Functions changed:

  1. org-remark-global-tracking-mode - org-remark-auto-on runs on EWW render completion.
  2. org-remark-highlight-get-title - This function can also extract the highlight title from the EWW URL now.

How I've tested the changes:

  • Does taking notes work in eww buffers? - Tested for archived urls (of the file:// type) - Tested for normal urls
  • Does taking notes work for different types of web-pages? - URLs that end in a '/' (need special handling) - URLs that end in '.html'
  • Does reloading the EWW page maintain the notes? - Tested for archived urls - Tested for normal urls
  • Does different kinds of highlighting work correctly? - Tested org-remark-mark - Tested org-remark-mark-yellow - Tested org-remark-mark-red-line
  • Does remark functionality work? - Tested org-remark-view-next - Tested org-remark-view-prev - Tested org-remark-view - Tested org-remark-save - Tested org-remark-open - Tested org-remark-toggle
  • Check what happens when existing notes are modified - Tested for archived urls - Tested for normal urls
  • Check what happens when new notes are added to an existing annotated web-page - Tested for archived urls - Tested for normal urls

vedang avatar Apr 25 '22 22:04 vedang

More testing:

Ensured that all the above functions are working on normal files as well (i.e. no regressions)

vedang avatar Apr 26 '22 02:04 vedang

I would like to merge it but sorry just very briefly, two things:

  1. Have you done FSF paperwork for copyright assignment, or willing to do so?
  2. How do you think about the change of the web page? It will dislocate the location of highlights

nobiot avatar Apr 27 '22 15:04 nobiot

  1. I am willing to do the FSF paperwork. I sent them an email 2 days ago but have not heard back from them
  2. I did not think about changes on the web-page. Yes that will dislocate the location of the highlights and there will not be an automatic way to clean the highlights up.

vedang avatar Apr 27 '22 17:04 vedang

  1. I did not think about changes on the web-page. Yes that will dislocate the location of the highlights and there will not be an automatic way to clean the highlights up.

Suggestion: to make automatically a local copy when annotations are made.

Suggestion: maybe if visiting a page that already has annotations, to offer the user to load the saved version or the updated version. A prompt for an automatic ediff, showing differences, could be nice.

Ypot avatar Oct 15 '22 18:10 Ypot

@vedang I realise it's been an awful a lot of time since you initially created this PR (Thank you!). Is there any change to move it forward? I do not see your name as part in FSF -- have you had a chance to proceed with the paperwork by any chance?

nobiot avatar Nov 26 '22 12:11 nobiot

@nobiot : I have completed FSF paperwork in May and received a PDF regarding the same from the FSF. Should I attach it here or maybe privately send it to you? I am not sure if anything else is needed, I didn't look into it since the FSF email said that all necessary work was complete.

vedang avatar Nov 27 '22 05:11 vedang

I will also rebase my changes on top of the latest master and push them back, so that this PR becomes mergeable.

vedang avatar Nov 27 '22 05:11 vedang

@vedang thank you for your quick reply and confirmation about the FSF paperwork. That is enough for me :). Merged. Thank you also for additional work to rebase your PR; much appreciated.

I’ll add a new section to acknowledge your (and others’) contributions somewhere in the documentation.

nobiot avatar Nov 27 '22 08:11 nobiot