Hacker News new | ask | show | jobs
by danShumway 2819 days ago
How do you handle images/screenshots/handwritten notes?

I am also using Org-Mode and Dropbox for the majority of my notes. I really like it. In particular, Orgzly for Android works great with this system, so check it out if you want mobile notes as well.

The problem is that I also like to take paper notes, and take videos/pictures of stuff, and scan documents, and download webpages. Org-mode kinda stinks for embedding external content that isn't text? As far as I can tell.

I can link to external content, and if I export to HTML it'll show up. But... I never export to HTML, because, as you probably already know, it's way easier to read notes in an editable format. I can turn on picture rending in Org-mode, but it's not responsive, and I can't crop the pictures or annotate them with a stylus, or do any of a dozen different things that I want to do.

What I've thought about is that I really just want the ability to render HTML/CSS inside of an Org-mode buffer, and ideally to be able to set up custom CSS classes that would be applied to every snippet. Just set up a quick region, write some helper functions to compile/render the HTML, etc...

I've been thinking for a while about taking some time off of work to just try and solve the problem. Is it already solved? I know that at one point people were looking into getting webkit embedded into buffers. Did that go anywhere? I guess you can build GTK widgets for Org-mode as well? But then you lose the ability to define custom styles on the fly.

3 comments

You can make some tweaks to org to get images to display nicely: https://lepisma.github.io/2017/10/28/ricing-org-mode/
A) That is beautiful, thank you for sharing

B) Does it actually address the image problem? The config appears to be using the built in inline-images, which don't support responsive widths.

Even getting rid of responsive widths, simply embedding the image into the buffer isn't really good enough for handwritten notes -- you need at least the ability to crop/zoom.

I'm not sure whether it solves the problem you mention. But it might be a good starting point. If you can roll your own solution, I'd be very interested in hearing about it, and probably most org users! I keep my scanned notes in separate files, though.
For screenshots I use this little snippet:

  ;; Paste image to orgmode https://stackoverflow.com/questions/17435995/paste-an-image-on-clipboard-to-emacs-org-mode-file-without-saving-it
  (defun my-org-screenshot ()
    "Take a screenshot into a time stamped unique-named file in the
  same directory as the org-buffer and insert a link to this file."
    (interactive)
    (org-display-inline-images)
    (setq filename
          (concat
           (make-temp-name
            (concat (file-name-nondirectory (buffer-file-name))
                    "_imgs/"
                    (format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
    (unless (file-exists-p (file-name-directory filename))
      (make-directory (file-name-directory filename)))
    ; take screenshot
    (if (eq system-type 'darwin)
        (call-process "screencapture" nil nil nil "-i" filename))
    (if (eq system-type 'gnu/linux)
        (call-process "import" nil nil nil filename))
    ; insert into file if correctly taken
    (if (file-exists-p filename)
      (insert (concat "[[file:" filename "]]"))))
https://github.com/abo-abo/org-download does "Drag and drop images to Emacs org-mode". I suppose you could use https://www.emacswiki.org/emacs/EmacsImageManipulation =P

There's also https://github.com/alphapapa/org-web-tools/ for web snippets.