mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-08 07:08:39 +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.show = "Alt-b"
|
||||||
|
|
||||||
|
keybinding.bookmark.export = "Alt-e"
|
||||||
|
|
||||||
keybinding.gemtext.scaling.increase = "Control-plus"
|
keybinding.gemtext.scaling.increase = "Control-plus"
|
||||||
|
|
||||||
keybinding.gemtext.scaling.decrease = "Control-minus"
|
keybinding.gemtext.scaling.decrease = "Control-minus"
|
||||||
@ -241,6 +243,8 @@ keybinding.gemtext.scaling.reset = "Control-0"
|
|||||||
|
|
||||||
keybinding.gemtext.refresh = "Control-r"
|
keybinding.gemtext.refresh = "Control-r"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# emphasize text
|
# emphasize text
|
||||||
|
|
||||||
emphasize.wrapped.asterisk = yes
|
emphasize.wrapped.asterisk = yes
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
manage
|
manage
|
||||||
up
|
up
|
||||||
bookmark
|
bookmark
|
||||||
|
export
|
||||||
toggle
|
toggle
|
||||||
show
|
show
|
||||||
select
|
select
|
||||||
@ -413,6 +414,13 @@
|
|||||||
+key-bookmark+
|
+key-bookmark+
|
||||||
+key-show+)
|
+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
|
(swconf:gen-simple-access (keybinding-gemtext-scaling-increase
|
||||||
:transform-value-fn (lambda (a) (keybinding->tk-event a))
|
:transform-value-fn (lambda (a) (keybinding->tk-event a))
|
||||||
:configuration-tree *client-configuration*)
|
:configuration-tree *client-configuration*)
|
||||||
|
@ -267,6 +267,10 @@
|
|||||||
(_ "Show")
|
(_ "Show")
|
||||||
(menu:show-bookmarks-clsr main-window)
|
(menu:show-bookmarks-clsr main-window)
|
||||||
:accelerator (client-configuration:config-keybinding-bookmark-show))
|
: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 bookmarks (_ "Manage") (menu:manage-bookmarks-clsr main-window))
|
||||||
(gui:make-menubutton tour
|
(gui:make-menubutton tour
|
||||||
(_ "Manage")
|
(_ "Manage")
|
||||||
|
@ -65,6 +65,21 @@
|
|||||||
(lambda ()
|
(lambda ()
|
||||||
(client-main-window:show-bookmarks-page main-window)))
|
(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)
|
(defun manage-bookmarks-clsr (main-window)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(client-bookmark-window:manage-bookmarks main-window)))
|
(client-bookmark-window:manage-bookmarks main-window)))
|
||||||
|
@ -29,8 +29,11 @@
|
|||||||
t)
|
t)
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
|
(defun gemini-generate-raw-bookmark-page ()
|
||||||
|
(ui::generate-bookmark-page))
|
||||||
|
|
||||||
(defun gemini-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)
|
(defun gemini-bookmark-delete (iri)
|
||||||
(db:bookmark-delete iri))
|
(db:bookmark-delete iri))
|
||||||
|
@ -132,6 +132,7 @@
|
|||||||
(gen-rpc "clear-tour" 'clear-tour)
|
(gen-rpc "clear-tour" 'clear-tour)
|
||||||
(gen-rpc "tour-all-links" 'tour-all-links)
|
(gen-rpc "tour-all-links" 'tour-all-links)
|
||||||
(gen-rpc "gemini-generate-bookmark-page" 'gemini-generate-bookmark-page)
|
(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
|
(gen-rpc "gemini-bookmark-add" 'gemini-bookmark-add
|
||||||
"iri" 0
|
"iri" 0
|
||||||
"section" 1
|
"section" 1
|
||||||
|
@ -3399,6 +3399,7 @@
|
|||||||
:config-gemtext-padding
|
:config-gemtext-padding
|
||||||
:config-keybinding-bookmark-toggle
|
:config-keybinding-bookmark-toggle
|
||||||
:config-keybinding-bookmark-show
|
:config-keybinding-bookmark-show
|
||||||
|
:config-keybinding-bookmark-export
|
||||||
:main-window-select-colors
|
:main-window-select-colors
|
||||||
:emphasize-wrapped-asterisk-p
|
:emphasize-wrapped-asterisk-p
|
||||||
:config-inline-scaling-ratio
|
:config-inline-scaling-ratio
|
||||||
@ -3547,6 +3548,7 @@
|
|||||||
:show-certificates
|
:show-certificates
|
||||||
:show-streams
|
:show-streams
|
||||||
:show-bookmarks-clsr
|
:show-bookmarks-clsr
|
||||||
|
:export-bookmarks-clsr
|
||||||
:manage-bookmarks-clsr
|
:manage-bookmarks-clsr
|
||||||
:show-search-frame-clsr
|
:show-search-frame-clsr
|
||||||
:show-tour
|
:show-tour
|
||||||
|
Loading…
x
Reference in New Issue
Block a user