feat: import from logseq edn

feat: import edn with provided uuid

feat: overwrite page uuid; use properties in content

feat: error handling for importing

feat: support json import

chore: fix lint by splitting setup ui
This commit is contained in:
Junyi Du
2022-05-10 22:10:12 +08:00
parent 459262cd24
commit 0cdacc35e2
8 changed files with 294 additions and 75 deletions

View File

@@ -90,8 +90,7 @@
namespaces (db/get-all-namespace-relation repo)
tags (set (map second tagged-pages))
full-pages (db/get-all-pages repo)
get-original-name (fn [p] (or (:block/original-name p) (:block/name p)))
all-pages (map get-original-name full-pages)
all-pages (map db/get-original-name full-pages)
page-name->original-name (zipmap (map :block/name full-pages) all-pages)
pages-after-journal-filter (if-not journal?
(remove :block/journal? full-pages)
@@ -164,9 +163,7 @@
(distinct))
nodes (build-nodes dark? page links (set tags) nodes namespaces)
full-pages (db/get-all-pages repo)
get-original-name (fn [p] (or (:block/original-name p)
(:block/name p)))
all-pages (map get-original-name full-pages)
all-pages (map db/get-original-name full-pages)
page-name->original-name (zipmap (map :block/name full-pages) all-pages)]
(normalize-page-name
{:nodes nodes