mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
Finish migrating extract to nbb
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
[frontend.fs :as fs]
|
||||
[frontend.fs.nfs :as nfs]
|
||||
[frontend.handler.common :as common-handler]
|
||||
[frontend.handler.extract :as extract-handler]
|
||||
[logseq.graph-parser.extract :as extract]
|
||||
[frontend.handler.ui :as ui-handler]
|
||||
[frontend.state :as state]
|
||||
[frontend.util :as util]
|
||||
@@ -123,11 +123,15 @@
|
||||
file-content [{:file/path file}]
|
||||
tx (if (contains? gp-config/mldoc-support-formats format)
|
||||
(let [[pages blocks]
|
||||
(extract-handler/extract-blocks-pages
|
||||
repo-url file content
|
||||
(extract/extract-blocks-pages
|
||||
file
|
||||
content
|
||||
{:user-config (state/get-config)
|
||||
:date-formatter (state/get-date-formatter)
|
||||
:page-name-order (state/page-name-order)})
|
||||
:page-name-order (state/page-name-order)
|
||||
:block-pattern (config/get-block-pattern format)
|
||||
:supported-formats (config/supported-formats)
|
||||
:db (db/get-db (state/get-current-repo))})
|
||||
first-page (first pages)
|
||||
delete-blocks (->
|
||||
(concat
|
||||
@@ -149,7 +153,7 @@
|
||||
(seq))
|
||||
;; To prevent "unique constraint" on datascript
|
||||
block-ids (set/union (set block-ids) (set block-refs-ids))
|
||||
pages (extract-handler/with-ref-pages pages blocks)
|
||||
pages (extract/with-ref-pages pages blocks)
|
||||
pages-index (map #(select-keys % [:block/name]) pages)]
|
||||
;; does order matter?
|
||||
(concat file-content pages-index delete-blocks pages block-ids blocks))
|
||||
|
||||
Reference in New Issue
Block a user