Browse Source

Cleanup remaining clj(s) resources

* Move template files into a more organized resources templates dir
  except for zotero-items.edn which isn't a template
* Remove unused favorites templates
* Move grammar file which should be in a resource path and not a
  standard source path
Gabriel Horner 2 years ago
parent
commit
5f44d9bdf2

+ 1 - 1
deps.edn

@@ -1,4 +1,4 @@
-{:paths ["src/main" "src/electron" "templates" "src/resources"]
+{:paths ["src/main" "src/electron" "src/resources"]
  :deps
  {org.clojure/clojure                   {:mvn/version "1.11.1"}
   rum/rum                               {:mvn/version "0.12.9"}

+ 1 - 1
src/main/frontend/config.cljs

@@ -339,7 +339,7 @@
 (def custom-css-file "custom.css")
 (def export-css-file "export.css")
 (def custom-js-file "custom.js")
-(def config-default-content (rc/inline "config.edn"))
+(def config-default-content (rc/inline "templates/config.edn"))
 (def config-default-content-md5 (let [md5 (new crypt/Md5)]
                                   (.update md5 (crypt/stringToUtf8ByteArray config-default-content))
                                   (crypt/byteArrayToHex (.digest md5))))

+ 1 - 1
src/main/frontend/handler/global_config.cljs

@@ -41,7 +41,7 @@
     (state/set-global-config! config)
     config))
 
-(def default-content (rc/inline "global-config.edn"))
+(def default-content (rc/inline "templates/global-config.edn"))
 
 (defn- create-global-config-file-if-not-exists
   [repo-url]

+ 2 - 2
src/main/frontend/handler/repo.cljs

@@ -48,8 +48,8 @@
       (let [format (state/get-preferred-format)
             file-rpath (str "pages/" "contents." (config/get-file-extension format))
             default-content (case (name format)
-                              "org" (rc/inline "contents.org")
-                              "markdown" (rc/inline "contents.md")
+                              "org" (rc/inline "templates/contents.org")
+                              "markdown" (rc/inline "templates/contents.md")
                               "")]
         (p/let [_ (fs/mkdir-if-not-exists (path/path-join repo-dir pages-dir))
                 file-exists? (fs/create-if-not-exists repo-url repo-dir file-rpath default-content)]

+ 0 - 0
src/main/grammar/calc.bnf → src/resources/grammar/calc.bnf


+ 0 - 0
templates/config.edn → src/resources/templates/config.edn


+ 0 - 0
templates/contents.md → src/resources/templates/contents.md


+ 0 - 0
templates/contents.org → src/resources/templates/contents.org


+ 0 - 0
templates/global-config.edn → src/resources/templates/global-config.edn


+ 0 - 0
templates/zotero-items.edn → src/resources/zotero-items.edn


+ 0 - 1
templates/favorites.md

@@ -1 +0,0 @@
--

+ 0 - 1
templates/favorites.org

@@ -1 +0,0 @@
-*

+ 1 - 1
typos.toml

@@ -13,4 +13,4 @@ fo = "fo"
 aks = "aks"
 Mannor = "Mannor"
 [files]
-extend-exclude = ["resources/*", "templates/*", "src/resources/*"]
+extend-exclude = ["resources/*", "src/resources/*"]