1

The question itself might be confusing given I'm using the word embed here, which have different meaning. What i mean by that is:

  • Embed like what chat.stackoverflow does. Say I'm posting a single SO/SE link (from a post) on any chat on SO/SE, it will embed like so:

embedded test

Where this is the embedded link (do bear in mind this is just an example to illustrate what i mean, and not intended to be the final form).

Basically, what i mean by embed is either:

  • Show a part of the link, either at the start, end or any wanted part?
  • Show the whole content of the link in current buffer, but in a separate block (so it doesn't clutter any other existing text in the current buffer)

I'm also aware of possibly related things, like org-screenshot, though it's not exactly what i want, but still useful.

How could i do this?

Nordine Lotfi
  • 357
  • 2
  • 13
  • https://emacs.stackexchange.com/tags/elisp/info – Drew Sep 29 '20 at 22:49
  • yes, but I'm indirectly asking this to be made in elisp. Though it is true I wasn't sure of which tags would be right for this post - Any recommendation is welcome :) @Drew – Nordine Lotfi Sep 29 '20 at 22:53
  • nevermind, just saw you edited the tag. Disregard what i said in my last comment :D @Drew – Nordine Lotfi Sep 29 '20 at 22:54
  • Org mode Hyperlinks? Is that close to what you are looking for? – NickD Sep 30 '20 at 00:18
  • Sadly no, as it doesn't embed them like in the example i provided in my post (afaik) @NickD – Nordine Lotfi Sep 30 '20 at 01:49
  • 1
    You might want to check my Emacs extension org-link-beautify (https://github.com/stardiviner/org-link-beautify) It provides video preview. The implementation is here https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L152 I think you can use similar way to embed URL content. (P.S If you want to implement this feature, PR welcome) – stardiviner Sep 30 '20 at 03:50
  • Thanks, didn't knew that one :D I'll check it out and try to contribute @stardiviner – Nordine Lotfi Sep 30 '20 at 04:01
  • 1
    I learnt the feature via Discourse's Onebox which "turning media URLs into simple HTML previews of the resource", it requires the target websites supports some protocols such as facebook opengraph and twitter card, these info is easy to get since they are part of the HTML meta headers, StackExchange supports both. Not sure what you want, Emacs is a plain text environment it's char-by-char not pixel by pixel unlike the web browser. – xuchunyang Sep 30 '20 at 10:51
  • basically like what inline image embed in Emacs does (where it temporary preview it) but for links (like what SO/SE does, but not necessarily exactly the same, see what stardiviner said in his comment which look similar to what i want) @xuchunyang – Nordine Lotfi Sep 30 '20 at 11:45
  • onebox is a good idea too, though it depend on the HTML meta headers, but that's probably fine as an alternative :) @xuchunyang feel free to post this as answer too – Nordine Lotfi Sep 30 '20 at 11:46

0 Answers0