From 5f44d9bdf20bf0a058156512d54446f1c98aa4da Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 26 May 2023 14:49:40 -0400 Subject: [PATCH] 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 --- deps.edn | 2 +- src/main/frontend/config.cljs | 2 +- src/main/frontend/handler/global_config.cljs | 2 +- src/main/frontend/handler/repo.cljs | 4 ++-- src/{main => resources}/grammar/calc.bnf | 0 {templates => src/resources/templates}/config.edn | 0 {templates => src/resources/templates}/contents.md | 0 {templates => src/resources/templates}/contents.org | 0 {templates => src/resources/templates}/global-config.edn | 0 {templates => src/resources}/zotero-items.edn | 0 templates/favorites.md | 1 - templates/favorites.org | 1 - typos.toml | 2 +- 13 files changed, 6 insertions(+), 8 deletions(-) rename src/{main => resources}/grammar/calc.bnf (100%) rename {templates => src/resources/templates}/config.edn (100%) rename {templates => src/resources/templates}/contents.md (100%) rename {templates => src/resources/templates}/contents.org (100%) rename {templates => src/resources/templates}/global-config.edn (100%) rename {templates => src/resources}/zotero-items.edn (100%) delete mode 100644 templates/favorites.md delete mode 100644 templates/favorites.org diff --git a/deps.edn b/deps.edn index 4e16e63f40..580bb9894d 100644 --- a/deps.edn +++ b/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"} diff --git a/src/main/frontend/config.cljs b/src/main/frontend/config.cljs index 8aff2d4411..c275ec33c5 100644 --- a/src/main/frontend/config.cljs +++ b/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)))) diff --git a/src/main/frontend/handler/global_config.cljs b/src/main/frontend/handler/global_config.cljs index b1f2f6e3a7..e366fa6187 100644 --- a/src/main/frontend/handler/global_config.cljs +++ b/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] diff --git a/src/main/frontend/handler/repo.cljs b/src/main/frontend/handler/repo.cljs index 63ca24150d..6cfcd35a97 100644 --- a/src/main/frontend/handler/repo.cljs +++ b/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)] diff --git a/src/main/grammar/calc.bnf b/src/resources/grammar/calc.bnf similarity index 100% rename from src/main/grammar/calc.bnf rename to src/resources/grammar/calc.bnf diff --git a/templates/config.edn b/src/resources/templates/config.edn similarity index 100% rename from templates/config.edn rename to src/resources/templates/config.edn diff --git a/templates/contents.md b/src/resources/templates/contents.md similarity index 100% rename from templates/contents.md rename to src/resources/templates/contents.md diff --git a/templates/contents.org b/src/resources/templates/contents.org similarity index 100% rename from templates/contents.org rename to src/resources/templates/contents.org diff --git a/templates/global-config.edn b/src/resources/templates/global-config.edn similarity index 100% rename from templates/global-config.edn rename to src/resources/templates/global-config.edn diff --git a/templates/zotero-items.edn b/src/resources/zotero-items.edn similarity index 100% rename from templates/zotero-items.edn rename to src/resources/zotero-items.edn diff --git a/templates/favorites.md b/templates/favorites.md deleted file mode 100644 index 39cdd0ded6..0000000000 --- a/templates/favorites.md +++ /dev/null @@ -1 +0,0 @@ -- diff --git a/templates/favorites.org b/templates/favorites.org deleted file mode 100644 index 72e8ffc0db..0000000000 --- a/templates/favorites.org +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/typos.toml b/typos.toml index d4b51e9537..4ec321e7c2 100644 --- a/typos.toml +++ b/typos.toml @@ -13,4 +13,4 @@ fo = "fo" aks = "aks" Mannor = "Mannor" [files] -extend-exclude = ["resources/*", "templates/*", "src/resources/*"] +extend-exclude = ["resources/*", "src/resources/*"]