File tree 6 files changed +2
-68
lines changed
6 files changed +2
-68
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- getclojure.algolia/algolia-app-id #config/env " ALGOLIA_APP_ID"
3
- getclojure.algolia/algolia-admin-api-key #config/env " ALGOLIA_ADMIN_API_KEY"
4
- getclojure.algolia/algolia-index #config/env " ALGOLIA_INDEX"
5
2
getclojure.elastic/elastic-url #config/env " BONSAI_URL"
6
3
getclojure.elastic/index-name #config/env " INDEX_NAME"
7
4
getclojure.config/env #config/env " APP_ENV"
Original file line number Diff line number Diff line change 1
- export DB_URL="jdbc:postgresql://localhost:5432/getclojure?user=postgres&password=postgres"
2
- export ALGOLIA_ADMIN_API_KEY="abc123"
3
- export ALGOLIA_INDEX="index_name"
4
- export ALGOLIA_APP_ID="APPID"
5
1
export APP_ENV="development"
6
2
export BONSAI_URL="https://foo:
[email protected] :123"
7
3
export INDEX_NAME="getclojure"
Original file line number Diff line number Diff line change 5
5
:url " http://www.eclipse.org/legal/epl-v10.html" }
6
6
:dependencies [[org.clojure/clojure " 1.11.1" ]
7
7
[org.babashka/sci " 0.3.5" ]
8
- [cheshire " 5.10.2" ]
9
8
[ring/ring-jetty-adapter " 1.9.5" ]
10
9
[ring/ring-defaults " 0.3.3" ]
11
10
[compojure " 1.6.2" ]
12
11
[hiccup " 1.0.5" ]
13
12
[com.github.seancorfield/next.jdbc " 1.2.780" ]
14
13
[org.postgresql/postgresql " 42.3.4" ]
15
14
[com.outpace/config " 0.13.5" ]
16
- [com.algolia/algoliasearch-core " 3.16.5" ]
17
- [com.algolia/algoliasearch-java-net " 3.16.5" ]
18
15
[enlive " 1.1.6" ]
19
16
[com.taoensso/timbre " 5.2.1" ]
20
17
[prismatic/schema " 1.2.1" ]
39
36
" extract-sexp-input-file" [" trampoline" " run" " -m" " getclojure.extract" " sexps" ]
40
37
; ; Generate files for seed, analysis, and presentation
41
38
" gen-working-sexps" [" trampoline" " run" " -m" " getclojure.sexp" " working" ]
42
- " gen-formatted-sexps" [" trampoline" " run" " -m" " getclojure.sexp" " formatted" ]
43
- " gen-algolia-json" [" trampoline" " run" " -m" " getclojure.sexp" " algolia" ]}
39
+ " gen-formatted-sexps" [" trampoline" " run" " -m" " getclojure.sexp" " formatted" ]}
44
40
:jvm-opts [" --add-modules" " jdk.incubator.foreign"
45
41
" --enable-native-access=ALL-UNNAMED" ]
46
42
:min-lein-version " 2.0.0" )
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
(ns getclojure.sexp
2
2
(:refer-clojure :exclude [eval])
3
3
(:require
4
- [cheshire.core :as json]
5
4
[clojure.java.io :as io]
6
5
[clojure.string :as str]
7
6
[getclojure.format :as fmt]
138
137
format-coll
139
138
(spit " resources/sexps/formatted-sexps.edn" )))
140
139
141
- (s/defn generate-algolia-json-file
142
- " Provided a `filename`, reads a file containing a collection of maps of the
143
- form {:input ... :output ... :value ...} and writes to a file a json-encoded
144
- collection of the form: [{\" input\" ... \" value\" ... \" output\" ...
145
- \" formatted-input\" ... \" formatted-value\" ... \" formatted-output\" ...}] for
146
- uploading to an algolia index."
147
- [filename :- s/Str]
148
- (log/info " Generating algolia output.json" )
149
- (spit " output.json"
150
- (->> (read-resource filename)
151
- format-coll
152
- (json/encode ))))
153
-
154
140
(s/defn generate-working-sexps-file
155
141
[filename :- s/Str]
156
142
(log/info " Generating working-sexps.edn" )
160
146
(let [op (first args)]
161
147
(case op
162
148
" working" (generate-working-sexps-file " sexps/input.edn" )
163
- " algolia" (generate-algolia-json-file " sexps/working-sexps.edn" )
164
149
" formatted" (generate-formatted-collection " sexps/working-sexps.edn" )
165
- (do (println " Valid arguments: working, algolia, or formatted." )
150
+ (do (println " Valid arguments: working, formatted." )
166
151
(println " - `working` produces `sexps/working-sexps.edn` from `sexps/input.edn` which contains all s-expressions which run in SCI" )
167
- (println " - `algolia` produces `output.json` from `sexps/working-sexps.edn` for consumption by Algolia" )
168
152
(println " - `formatted` produces `sexps/formatted-sexps.edn` from `sexps/working-sexps.edn` for ElasticSearch" ))))
169
153
170
154
(shutdown-agents )
You can’t perform that action at this time.
0 commit comments