|
@@ -430,25 +430,6 @@
|
|
|
(.setAttribute anchor "download" (.-name zipfile))
|
|
|
(.click anchor))))))
|
|
|
|
|
|
-(defn export-page-as-markdown!
|
|
|
- [page-name]
|
|
|
- (when-let [repo (state/get-current-repo)]
|
|
|
- (when-let [file (db/get-page-file page-name)]
|
|
|
- (when-let [path (:file/path file)]
|
|
|
- (when-let [content (get-page-content repo page-name)]
|
|
|
- (let [names [page-name]
|
|
|
- format (f/get-format path)
|
|
|
- files [{:path path :content content :names names :format format}]
|
|
|
- files
|
|
|
- (export-files-as-markdown repo files (state/export-heading-to-list?))
|
|
|
- data (js/Blob. [(second (first files))]
|
|
|
- (clj->js {:type "text/plain;charset=utf-8,"}))
|
|
|
- anchor (gdom/getElement "export-page-as-markdown")
|
|
|
- url (js/window.URL.createObjectURL data)]
|
|
|
- (.setAttribute anchor "href" url)
|
|
|
- (.setAttribute anchor "download" path)
|
|
|
- (.click anchor)))))))
|
|
|
-
|
|
|
(defn export-repo-as-opml!
|
|
|
#_:clj-kondo/ignore
|
|
|
[repo]
|
|
@@ -462,25 +443,6 @@
|
|
|
(.setAttribute anchor "download" (.-name zipfile))
|
|
|
(.click anchor)))))))
|
|
|
|
|
|
-(defn export-page-as-opml!
|
|
|
- [page-name]
|
|
|
- (when-let [repo (state/get-current-repo)]
|
|
|
- (when-let [file (db/get-page-file page-name)]
|
|
|
- (when-let [path (:file/path file)]
|
|
|
- (when-let [content (get-page-content repo page-name)]
|
|
|
- (let [names [page-name]
|
|
|
- format (f/get-format path)
|
|
|
- files [{:path path :content content :names names :format format}]
|
|
|
- files (export-files-as-opml repo files)
|
|
|
- data (js/Blob. [(second (first files))]
|
|
|
- (clj->js {:type "text/plain;charset=utf-8,"}))
|
|
|
- anchor (gdom/getElement "export-page-as-opml")
|
|
|
- url (js/window.URL.createObjectURL data)
|
|
|
- opml-path (string/replace (string/lower-case path) #"(.+)\.(md|org|markdown)$" "$1.opml")]
|
|
|
- (.setAttribute anchor "href" url)
|
|
|
- (.setAttribute anchor "download" opml-path)
|
|
|
- (.click anchor)))))))
|
|
|
-
|
|
|
(defn convert-page-markdown-unordered-list-or-heading!
|
|
|
[page-name]
|
|
|
(when-let [repo (state/get-current-repo)]
|