yibie
1
重要说明:原 org-embd
已经更名为 org-embed
感谢 @RnE 带来引人启迪的想法,以及对该项目的贡献。
我在 README 里增加了 Acknowledgement 一节。
功能
- 支持在 Org-mode 中嵌入各种视频平台的视频
- 支持在 Org-mode 中嵌入任意网页
- 支持在 Org-mode 中嵌入 PDF 文件
- 模块化设计,易于扩展支持更多内容类型
支持的视频平台
- YouTube
- Bilibili
- Vimeo
- Dailymotion
- TED Talks
- 本地视频文件
支持的其他内容
14 个赞
好快!距离上个讨论还不到24小时,楼主实验成功不到16小时,我睡醒还不到8小时,这就整完了?!
1 个赞
yibie
3
感谢 Emacs 的基础框架,是如此优雅、简洁、自由、强大!
老哥好高产呀,能不能分享下怎么学习 elisp 的。
项目名还不如直接叫 org-embed,不用去猜embd是什么意思。
我自己测试了一下,开着 org modern mode 的时候显示不了
如果有人遇到同样的问题可以尝试关掉 org modern mode
org mode又伟大了一次
可惜我的电脑因为要提升多显示器的图形性能,必须要改装archlinux + sway(wayland模式), 对xwidget不友好,不知道短时间能不能用上。
RnE
15
我这里清除 XWidget Object 时出现了以下错误:
Debugger entered--Lisp error: (void-function xwidget-list)
(xwidget-list)
(let ((tail (xwidget-list))) (while tail (let ((xw (car tail))) (if (eq (current-buffer) (xwidget-buffer xw)) (progn (setq count (1+ count)) (delete-xwidget-view (get-buffer-window (xwidget-buffer xw))) (kill-xwidget xw))) (setq tail (cdr tail)))))
(let ((count 0)) (let ((tail (xwidget-list))) (while tail (let ((xw (car tail))) (if (eq (current-buffer) (xwidget-buffer xw)) (progn (setq count (1+ count)) (delete-xwidget-view (get-buffer-window ...)) (kill-xwidget xw))) (setq tail (cdr tail))))) (message "Cleaned up %d xwidgets" count))
org-embd-clean-xwidgets()
org-embd-clean-all()
funcall-interactively(org-embd-clean-all)
call-interactively(org-embd-clean-all record nil)
command-execute(org-embd-clean-all record)
execute-extended-command(nil "org-embd-clean-all" nil)
funcall-interactively(execute-extended-command nil "org-embd-clean-all" nil)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
以及:
Debugger entered--Lisp error: (wrong-type-argument xwidget-view-p #<window 3 on test.org>)
delete-xwidget-view(#<window 3 on test.org>)
(let ((xw (car tail))) (setq count (1+ count)) (delete-xwidget-view (get-buffer-window (xwidget-buffer xw))) (kill-xwidget xw) (setq tail (cdr tail)))
(while tail (let ((xw (car tail))) (setq count (1+ count)) (delete-xwidget-view (get-buffer-window (xwidget-buffer xw))) (kill-xwidget xw) (setq tail (cdr tail))))
(let ((tail (get-buffer-xwidgets (current-buffer)))) (while tail (let ((xw (car tail))) (setq count (1+ count)) (delete-xwidget-view (get-buffer-window (xwidget-buffer xw))) (kill-xwidget xw) (setq tail (cdr tail)))))
(let ((count 0)) (let ((tail (get-buffer-xwidgets (current-buffer)))) (while tail (let ((xw (car tail))) (setq count (1+ count)) (delete-xwidget-view (get-buffer-window (xwidget-buffer xw))) (kill-xwidget xw) (setq tail (cdr tail))))) (message "Cleaned up %d xwidgets" count))
org-embd-clean-xwidgets()
org-embd-clean-all()
funcall-interactively(org-embd-clean-all)
call-interactively(org-embd-clean-all record nil)
command-execute(org-embd-clean-all record)
execute-extended-command(nil "org-embd-clean-all" nil)
funcall-interactively(execute-extended-command nil "org-embd-clean-all" nil)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
环境:Cocoa XWidget。
已发 PR:
(有些好奇这两个函数是否经过测试)
yibie
16
对,这两个函数应该是忘记了测试…
或者说自以为自己测试过了…
将org 导出为HTML,视频能在HTML页面上直接播放吗?可能需要作一些org 到html的hack
yibie
20
没有考虑这个方面的场景。应该是不能的。
按照 Xwidget 的实现原理,它并没有插入 html 到 org 文件里,它只是生成了一个临时html 用于装这些内容。
但如果你要 hack 的话,可以将临时生成的 html 放进 src block 看看。