|
@@ -1,30 +1,31 @@
|
|
(ns frontend.handler.repo
|
|
(ns frontend.handler.repo
|
|
(:refer-clojure :exclude [clone])
|
|
(:refer-clojure :exclude [clone])
|
|
- (:require [frontend.util :as util :refer-macros [profile]]
|
|
|
|
|
|
+ (:require [cljs-bean.core :as bean]
|
|
|
|
+ [clojure.string :as string]
|
|
|
|
+ [frontend.config :as config]
|
|
|
|
+ [frontend.date :as date]
|
|
|
|
+ [frontend.db :as db]
|
|
|
|
+ [frontend.dicts :as dicts]
|
|
|
|
+ [frontend.encrypt :as encrypt]
|
|
|
|
+ [frontend.format :as format]
|
|
[frontend.fs :as fs]
|
|
[frontend.fs :as fs]
|
|
[frontend.fs.nfs :as nfs]
|
|
[frontend.fs.nfs :as nfs]
|
|
- [promesa.core :as p]
|
|
|
|
- [lambdaisland.glogi :as log]
|
|
|
|
- [frontend.state :as state]
|
|
|
|
- [frontend.db :as db]
|
|
|
|
- [frontend.idb :as idb]
|
|
|
|
[frontend.git :as git]
|
|
[frontend.git :as git]
|
|
- [cljs-bean.core :as bean]
|
|
|
|
- [frontend.date :as date]
|
|
|
|
- [frontend.config :as config]
|
|
|
|
- [frontend.format :as format]
|
|
|
|
- [frontend.search :as search]
|
|
|
|
- [frontend.handler.ui :as ui-handler]
|
|
|
|
- [frontend.handler.git :as git-handler]
|
|
|
|
|
|
+ [frontend.handler.common :as common-handler]
|
|
|
|
+ [frontend.handler.extract :as extract-handler]
|
|
[frontend.handler.file :as file-handler]
|
|
[frontend.handler.file :as file-handler]
|
|
|
|
+ [frontend.handler.git :as git-handler]
|
|
[frontend.handler.notification :as notification]
|
|
[frontend.handler.notification :as notification]
|
|
[frontend.handler.route :as route-handler]
|
|
[frontend.handler.route :as route-handler]
|
|
- [frontend.handler.common :as common-handler]
|
|
|
|
- [frontend.handler.extract :as extract-handler]
|
|
|
|
- [clojure.string :as string]
|
|
|
|
- [frontend.dicts :as dicts]
|
|
|
|
|
|
+ [frontend.handler.ui :as ui-handler]
|
|
|
|
+ [frontend.idb :as idb]
|
|
|
|
+ [frontend.search :as search]
|
|
[frontend.spec :as spec]
|
|
[frontend.spec :as spec]
|
|
- [frontend.encrypt :as encrypt]))
|
|
|
|
|
|
+ [frontend.state :as state]
|
|
|
|
+ [frontend.util :as util]
|
|
|
|
+ [lambdaisland.glogi :as log]
|
|
|
|
+ [promesa.core :as p]
|
|
|
|
+ [shadow.resource :as rc]))
|
|
|
|
|
|
;; Project settings should be checked in two situations:
|
|
;; Project settings should be checked in two situations:
|
|
;; 1. User changes the config.edn directly in logseq.com (fn: alter-file)
|
|
;; 1. User changes the config.edn directly in logseq.com (fn: alter-file)
|
|
@@ -54,10 +55,8 @@
|
|
(config/get-file-extension format))
|
|
(config/get-file-extension format))
|
|
file-path (str "/" path)
|
|
file-path (str "/" path)
|
|
default-content (case (name format)
|
|
default-content (case (name format)
|
|
- "org"
|
|
|
|
- "* What's **Contents**?\n** It's a normal page called [[Contents]], you can use it for:\n*** 1. table of content/index/MOC\n*** 2. pinning/bookmarking favorites pages/blocks (e.g. [[Logseq]])\n*** 3. You can also put many different things, depending on your personal workflow."
|
|
|
|
- "markdown"
|
|
|
|
- "- What's **Contents**?\n - It's a normal page called [[Contents]], you can use it for:\n - 1. table of content/index/MOC\n - 2. pinning/bookmarking favorites pages/blocks (e.g. [[Logseq]])\n - 3. You can also put many different things, depending on your personal workflow."
|
|
|
|
|
|
+ "org" (rc/inline "contents.org")
|
|
|
|
+ "markdown" (rc/inline "contents.md")
|
|
"")]
|
|
"")]
|
|
(p/let [_ (fs/mkdir-if-not-exists (str repo-dir "/" (state/get-pages-directory)))
|
|
(p/let [_ (fs/mkdir-if-not-exists (str repo-dir "/" (state/get-pages-directory)))
|
|
file-exists? (fs/create-if-not-exists repo-url repo-dir file-path default-content)]
|
|
file-exists? (fs/create-if-not-exists repo-url repo-dir file-path default-content)]
|