-
Notifications
You must be signed in to change notification settings - Fork 32
/
example.el
43 lines (31 loc) · 1.39 KB
/
example.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;;; EXAMPLE --- Demonstrate a demo-it demonstration
;;; Commentary:
;; This is a simple demonstration that shows off a few of the
;; functions and options of the demo-it system. Evaluating this
;; buffer starts off the presentation, and hitting SPC steps through
;; the demonstration.
;;; Code:
(require 'demo-it)
;; ----------------------------------------------------------------------
;; Create some demonstration helper functions...
(defun dit-load-source-code ()
"Load some source code in a side window."
(demo-it-presentation-advance)
(demo-it-load-fancy-file "example.py" :line 5 12 :side))
(defun dit-run-code ()
"Execute our source code in an Eshell buffer."
;; Close other windows and advance the presentation:
(demo-it-presentation-return)
(demo-it-start-shell)
(demo-it-run-in-shell "python example.py Snoopy"))
;; ----------------------------------------------------------------------
;; Demonstration creation and the ordering of steps...
(demo-it-create :single-window :insert-fast
(demo-it-title-screen "example-title.org")
(demo-it-presentation "example.org")
dit-load-source-code ;; Step 3
dit-run-code) ;; Step 4
;; ----------------------------------------------------------------------
;; Start the presentation whenever this script is evaluated. Good idea?
(demo-it-start)
;;; example.el ends here