mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-01 04:26:47 +01:00
- [GUI] added command to export bookmarks as gemtext file.
This commit is contained in:
parent
0a8ec90f81
commit
a32ad1ce1c
@ -233,6 +233,8 @@ keybinding.bookmark.toggle = "Control-d"
|
||||
|
||||
keybinding.bookmark.show = "Alt-b"
|
||||
|
||||
keybinding.bookmark.export = "Alt-e"
|
||||
|
||||
keybinding.gemtext.scaling.increase = "Control-plus"
|
||||
|
||||
keybinding.gemtext.scaling.decrease = "Control-minus"
|
||||
@ -241,6 +243,8 @@ keybinding.gemtext.scaling.reset = "Control-0"
|
||||
|
||||
keybinding.gemtext.refresh = "Control-r"
|
||||
|
||||
|
||||
|
||||
# emphasize text
|
||||
|
||||
emphasize.wrapped.asterisk = yes
|
||||
|
@ -45,6 +45,7 @@
|
||||
manage
|
||||
up
|
||||
bookmark
|
||||
export
|
||||
toggle
|
||||
show
|
||||
select
|
||||
@ -413,6 +414,13 @@
|
||||
+key-bookmark+
|
||||
+key-show+)
|
||||
|
||||
(swconf:gen-simple-access (keybinding-bookmark-export
|
||||
:transform-value-fn (lambda (a) (keybinding->tk-event a))
|
||||
:configuration-tree *client-configuration*)
|
||||
+key-keybinding+
|
||||
+key-bookmark+
|
||||
+key-export+)
|
||||
|
||||
(swconf:gen-simple-access (keybinding-gemtext-scaling-increase
|
||||
:transform-value-fn (lambda (a) (keybinding->tk-event a))
|
||||
:configuration-tree *client-configuration*)
|
||||
|
@ -267,6 +267,10 @@
|
||||
(_ "Show")
|
||||
(menu:show-bookmarks-clsr main-window)
|
||||
:accelerator (client-configuration:config-keybinding-bookmark-show))
|
||||
(gui:make-menubutton bookmarks
|
||||
(_ "Export")
|
||||
(menu:export-bookmarks-clsr main-window)
|
||||
:accelerator (client-configuration:config-keybinding-bookmark-export))
|
||||
(gui:make-menubutton bookmarks (_ "Manage") (menu:manage-bookmarks-clsr main-window))
|
||||
(gui:make-menubutton tour
|
||||
(_ "Manage")
|
||||
|
@ -65,6 +65,21 @@
|
||||
(lambda ()
|
||||
(client-main-window:show-bookmarks-page main-window)))
|
||||
|
||||
(defun export-bookmarks-clsr (main-window)
|
||||
(lambda ()
|
||||
(a:when-let ((file-path (gui:get-save-file :file-types (list (list (_ "Gemtext files")
|
||||
"*.gmi"))
|
||||
:title (_ "Choose file for exporting…")
|
||||
:parent main-window)))
|
||||
(ev:with-enqueued-process-and-unblock ()
|
||||
(let ((page (comm:make-request :gemini-generate-raw-bookmark-page 1)))
|
||||
(with-open-file (stream file-path
|
||||
:direction :output
|
||||
:if-exists :supersede
|
||||
:if-does-not-exist :create)
|
||||
(write-sequence page stream)
|
||||
(info-operation-completed main-window)))))))
|
||||
|
||||
(defun manage-bookmarks-clsr (main-window)
|
||||
(lambda ()
|
||||
(client-bookmark-window:manage-bookmarks main-window)))
|
||||
|
@ -29,8 +29,11 @@
|
||||
t)
|
||||
nil))
|
||||
|
||||
(defun gemini-generate-raw-bookmark-page ()
|
||||
(ui::generate-bookmark-page))
|
||||
|
||||
(defun gemini-generate-bookmark-page ()
|
||||
(gemini-parse-string (ui::generate-bookmark-page)))
|
||||
(gemini-parse-string (gemini-generate-raw-bookmark-page)))
|
||||
|
||||
(defun gemini-bookmark-delete (iri)
|
||||
(db:bookmark-delete iri))
|
||||
|
@ -132,6 +132,7 @@
|
||||
(gen-rpc "clear-tour" 'clear-tour)
|
||||
(gen-rpc "tour-all-links" 'tour-all-links)
|
||||
(gen-rpc "gemini-generate-bookmark-page" 'gemini-generate-bookmark-page)
|
||||
(gen-rpc "gemini-generate-raw-bookmark-page" 'gemini-generate-raw-bookmark-page)
|
||||
(gen-rpc "gemini-bookmark-add" 'gemini-bookmark-add
|
||||
"iri" 0
|
||||
"section" 1
|
||||
|
@ -3399,6 +3399,7 @@
|
||||
:config-gemtext-padding
|
||||
:config-keybinding-bookmark-toggle
|
||||
:config-keybinding-bookmark-show
|
||||
:config-keybinding-bookmark-export
|
||||
:main-window-select-colors
|
||||
:emphasize-wrapped-asterisk-p
|
||||
:config-inline-scaling-ratio
|
||||
@ -3547,6 +3548,7 @@
|
||||
:show-certificates
|
||||
:show-streams
|
||||
:show-bookmarks-clsr
|
||||
:export-bookmarks-clsr
|
||||
:manage-bookmarks-clsr
|
||||
:show-search-frame-clsr
|
||||
:show-tour
|
||||
|
Loading…
x
Reference in New Issue
Block a user