Skip to content

Commit 90d16f2

Browse files
committed
Dashboard: add tutorial
1 parent cec3e6d commit 90d16f2

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

extensions/lem-dashboard/dashboard-items.lisp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,3 @@ Returns three values: prefix, main-text, suffix."
212212
(lambda ()
213213
(find-file f))))))
214214
(insert-character point #\Newline))))))))
215-
216-
(defclass dashboard-init-file (dashboard-item)
217-
()
218-
(:documentation "Lets the user open their init file.")
219-
(:default-initargs
220-
:item-attribute 'document-header4-attribute
221-
:action (lambda ()
222-
(lem:call-command 'lem-core/commands/file:open-init-file nil))))
223-
224-
(defmethod draw-dashboard-item ((item dashboard-init-file) point)
225-
(insert-string point (create-centered-string "Open Init File") :attribute 'document-header4-attribute)
226-
(insert-character point #\Newline))

extensions/lem-dashboard/default-dashboard.lisp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
(make-instance 'dashboard-recent-files
5454
:file-count file-count
5555
:bottom-margin 1)
56+
(make-instance 'dashboard-command
57+
:display-text "⚒ Tutorial (t)"
58+
:action-command 'lem-tutor:tutorial
59+
:item-attribute 'document-header2-attribute
60+
:bottom-margin 1)
5661
(make-instance 'dashboard-command
5762
:display-text " New Lisp Scratch Buffer (l)"
5863
:action-command 'lem-lisp-mode:lisp-scratch
@@ -87,6 +92,7 @@
8792
(define-key *dashboard-mode-keymap* "r" 'dashboard-move-to-recent-projects)
8893
(define-key *dashboard-mode-keymap* "f" 'dashboard-move-to-recent-files)
8994
(define-key *dashboard-mode-keymap* "l" 'lem-lisp-mode/internal:lisp-scratch)
95+
(define-key *dashboard-mode-keymap* "t" 'lem-tutor:tutorial)
9096
(define-key *dashboard-mode-keymap* "i" 'lem-core/commands/file:open-init-file)
9197

9298
(set-default-dashboard)

extensions/lem-dashboard/lem-dashboard.asd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(defsystem "lem-dashboard"
2-
:depends-on (:lem/core)
2+
:depends-on (:lem/core
3+
:lem-tutor)
34
:serial t
45
:components ((:file "lem-dashboard")
56
(:file "dashboard-items")

extensions/lem-dashboard/lem-dashboard.lisp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
(:local-nicknames (:button :lem/button)
1212
(:history :lem/common/history)
1313
(:project :lem-core/commands/project)
14-
(:file :lem-core/commands/file)))
14+
(:file :lem-core/commands/file))
15+
(:documentation "The dashboard is composed of multiple DASHBOARD-ITEM of different kinds (a list of files, a URL, a clickable link… see them in dashboard-items.lisp).
16+
17+
The default dashboard is defined in default-dashboard.lisp.
18+
19+
To change the layout, pass SET-DASHBOARD a list of items (which eventually sets *dashboard-layout*). See also REDRAW-DASHBOARD."))
1520

1621
(in-package :lem-dashboard)
1722

0 commit comments

Comments
 (0)