I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.8 KiB

4 years ago
  1. #+TITLE: Capture
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle capture.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  8. Capturing images, screencasts, screenshots or live-streaming. It's defined in this file.
  9. * Slides
  10. Produce high quality presentations that work anywhere with =HTML/JS= and the *Reveal.js*[fn:1] package. Achieve this behaviour in Emacs with *Ox-reveal*[fn:2]], configured to use a =cdn= allows us to produce ones that are not dependent on a local version. An important caveat here is that paths to images must be absolute URLs.
  11. #+begin_src emacs-lisp
  12. (use-package ox-reveal
  13. :after ox
  14. :custom (org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js"))
  15. #+end_src
  16. Create a capture template for creating slides quickly, with our desired configuration.
  17. #+begin_src emacs-lisp
  18. (with-eval-after-load 'org-roam
  19. (add-to-list 'org-roam-capture-templates
  20. '("s" "Slides" plain (function org-roam-capture--get-point)
  21. "%?"
  22. :file-name "docs/slides/${slug}"
  23. :unnarrowed t
  24. :head
  25. "
  26. ,#+TITLE: ${title}
  27. ,#+AUTHOR: Christopher James Hayward
  28. ,#+EMAIL: chris@chrishayward.xyz
  29. ,#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
  30. ,#+REVEAL_THEME: serif
  31. ,#+EXPORT_FILE_NAME: ${slug}
  32. ,#+OPTIONS: reveal_title_slide:nil
  33. ,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  34. ,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  35. ")))
  36. #+end_src
  37. * Screens
  38. Download *screenshot.el*[fn:4] for taking screenshots of highlighted regions or entire buffers.
  39. #+begin_src emacs-lisp
  40. (straight-use-package
  41. '(screenshot
  42. :type git
  43. :host github
  44. :repo "tecosaur/screenshot"))
  45. #+end_src
  46. Create screencasts with =one-frame-per-action= GIF recording via *Emacs gif screencast*[fn:3].
  47. + Pause / Resume
  48. + High Quality
  49. + Optimized
  50. It requires the installation of ~scrot~, ~gifsicle~, and ~convert~ from the =ImageMagick= library.
  51. #+begin_src emacs-lisp
  52. (use-package gif-screencast
  53. :commands (gif-screencast-start-or-stop gif-screencast-toggle-pause)
  54. :custom (gif-screencast-output-directory (concat dotfiles/home "docs/images/")))
  55. #+end_src
  56. + Place keybindings for capturing the screen behind =SPC s=.
  57. * Screenshot with =s=
  58. * Screencast with =c=
  59. #+begin_src emacs-lisp
  60. (dotfiles/leader
  61. "s" '(:ignore t :which-key "Screen")
  62. "ss" '(screenshot :which-key "Screenshot")
  63. "sc" '(gif-screencast-start-or-stop :which-key "Screencast"))
  64. #+end_src
  65. * Resources
  66. [fn:1] https://revealjs.com
  67. [fn:2] https://github.com/hexmode/ox-reveal
  68. [fn:3] https://github.com/takaxp/emacs-gif-screencast
  69. [fn:4] https://github.com/tecosaur/screenshot