mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 01:46:35 +00:00
Finish migration of publishing to deps
* Frontend and cmdline version use the same fns! * Add docstrings and db tests * Fix bug with intermittently failing asset copies * Move publish cli to scripts since publish-spa shouldn't have graph-parser dependency * Fix parse-graph bug noticed while testing publishing
This commit is contained in:
committed by
Tienson Qin
parent
9ac17d485a
commit
5186070248
@@ -4,7 +4,7 @@
|
||||
[frontend.util :as util]
|
||||
["/frontend/extensions/pdf/utils" :as js-utils]
|
||||
[datascript.core :as d]
|
||||
[logseq.graph-parser.config :as gp-config]
|
||||
[logseq.publish-spa.db :as publish-db]
|
||||
[clojure.string :as string]))
|
||||
|
||||
(defonce MAX-SCALE 5.0)
|
||||
@@ -15,21 +15,7 @@
|
||||
[filename]
|
||||
(and filename (string? filename) (string/starts-with? filename "hls__")))
|
||||
|
||||
(defn clean-asset-path-prefix
|
||||
[path]
|
||||
(when (string? path)
|
||||
(string/replace-first path #"^[.\/\\]*(assets)[\/\\]+" "")))
|
||||
|
||||
(defn get-area-block-asset-url
|
||||
[block page]
|
||||
(when-some [props (and block page (:block/properties block))]
|
||||
(when-some [uuid (:block/uuid block)]
|
||||
(when-some [stamp (:hl-stamp props)]
|
||||
(let [group-key (string/replace-first (:block/original-name page) #"^hls__" "")
|
||||
hl-page (:hl-page props)
|
||||
encoded-chars? (boolean (re-find #"(?i)%[0-9a-f]{2}" group-key))
|
||||
group-key (if encoded-chars? (js/encodeURI group-key) group-key)]
|
||||
(str "./" gp-config/local-assets-dir "/" group-key "/" (str hl-page "_" uuid "_" stamp ".png")))))))
|
||||
(def get-area-block-asset-url publish-db/get-area-block-asset-url)
|
||||
|
||||
(defn get-bounding-rect
|
||||
[rects]
|
||||
|
||||
Reference in New Issue
Block a user