|
|
@@ -8,7 +8,6 @@
|
|
|
[frontend.state :as state]
|
|
|
[frontend.util :as util]
|
|
|
[logseq.graph-parser.config :as gp-config]
|
|
|
- [frontend.fs.protocol :as protocol]
|
|
|
[promesa.core :as p]))
|
|
|
|
|
|
(defn create-draws-directory!
|
|
|
@@ -20,15 +19,6 @@
|
|
|
(fn [_result] nil)
|
|
|
(fn [_error] nil)))))
|
|
|
|
|
|
-(defn ls-draws-directory!
|
|
|
- [repo]
|
|
|
- (when repo
|
|
|
- (p/let [repo-dir (config/get-repo-dir repo)
|
|
|
- fs (fs/get-fs repo-dir)
|
|
|
- dir (str repo (str "/" gp-config/default-draw-directory))
|
|
|
- files (protocol/readdir fs dir)]
|
|
|
- files)))
|
|
|
-
|
|
|
(defn save-draw!
|
|
|
[file data]
|
|
|
(let [path file
|
|
|
@@ -64,11 +54,6 @@
|
|
|
"{\n \"type\": \"excalidraw\",\n \"version\": 2,\n \"source\": \"%s\",\n \"elements\": [],\n \"appState\": {\n \"viewBackgroundColor\": \"#FFF\",\n \"gridSize\": null\n }\n}"
|
|
|
config/website))
|
|
|
|
|
|
-(defonce default-tldraw-content
|
|
|
- (util/format
|
|
|
- ""
|
|
|
- config/website))
|
|
|
-
|
|
|
(defn- file-name
|
|
|
[ext]
|
|
|
(str (date/get-date-time-string-2) ext))
|
|
|
@@ -89,12 +74,3 @@
|
|
|
(p/let [_ (create-draw-with-default-content path default-excalidraw-content)]
|
|
|
(println "excalidraw file created, " path))
|
|
|
text))
|
|
|
-
|
|
|
-(defn initialize-tldraw-file
|
|
|
- []
|
|
|
- (let [file (file-name ".tldr")
|
|
|
- path (str gp-config/default-draw-directory "/" file)
|
|
|
- text (util/format "[[%s]]" path)]
|
|
|
- (p/let [_ (create-draw-with-default-content path default-tldraw-content)]
|
|
|
- (println "tldraw file created, " path))
|
|
|
- text))
|