Skip to content

Commit de20f73

Browse files
Merge pull request #1 from clj-codes/feat/extract-and-adapt-data
feat: adds extraction and adapters for documents
2 parents bdd0abf + d4f94f1 commit de20f73

File tree

18 files changed

+402
-29
lines changed

18 files changed

+402
-29
lines changed

.clj-kondo/babashka/fs/config.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:lint-as {babashka.fs/with-temp-dir clojure.core/let}}

.clj-kondo/babashka/sci/config.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:hooks {:macroexpand {sci.core/copy-ns sci.core/copy-ns}}}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(ns sci.core)
2+
3+
(defmacro copy-ns
4+
([ns-sym sci-ns]
5+
`(copy-ns ~ns-sym ~sci-ns nil))
6+
([ns-sym sci-ns opts]
7+
`[(quote ~ns-sym)
8+
~sci-ns
9+
(quote ~opts)]))
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{:linters
2+
{:unresolved-symbol
3+
{:exclude [(cljs.test/is [match? thrown-match?])
4+
(clojure.test/is [match? thrown-match?])]}}}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{:lint-as
2+
{rewrite-clj.zip/subedit-> clojure.core/->
3+
rewrite-clj.zip/subedit->> clojure.core/->>
4+
rewrite-clj.zip/edit-> clojure.core/->
5+
rewrite-clj.zip/edit->> clojure.core/->>}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:hooks {:analyze-call {taoensso.encore/defalias taoensso.encore/defalias}}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(ns taoensso.encore
2+
(:require
3+
[clj-kondo.hooks-api :as hooks]))
4+
5+
(defn defalias [{:keys [node]}]
6+
(let [[sym-raw src-raw] (rest (:children node))
7+
src (if src-raw src-raw sym-raw)
8+
sym (if src-raw
9+
sym-raw
10+
(symbol (name (hooks/sexpr src))))]
11+
{:node (with-meta
12+
(hooks/list-node
13+
[(hooks/token-node 'def)
14+
(hooks/token-node (hooks/sexpr sym))
15+
(hooks/token-node (hooks/sexpr src))])
16+
(meta src))}))

.lsp/config.edn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{:clean {:ns-inner-blocks-indentation :same-line}
2+
:cljfmt {:indents {mlet [[:block 1]]
3+
facts [[:block 1]]
4+
fact [[:block 1]]
5+
flow [[:block 1]]
6+
flow-with-defaults [[:block 1]]
7+
flow-as-of [[:block 1]]
8+
flow-without-validation [[:block 1]]}}}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# codes.clj.docs/extractor
22

3-
Tool to extract namespace/functions documentation from Clojure projects into indexed Datalevin file.
3+
Tool to extract namespace/functions documentation from Clojure projects into indexed [datalevin](https://github.com/juji-io/datalevin) file.
44

55
# CLI
66

@@ -9,11 +9,6 @@ Tool to extract namespace/functions documentation from Clojure projects into ind
99
clojure -X:extract
1010
```
1111

12-
## Update version of the configured projects in the config file
13-
```bash
14-
clojure -X:update
15-
```
16-
1712
# Developing
1813

1914
## Repl
@@ -25,3 +20,8 @@ clojure -M:dev:nrepl
2520
```bash
2621
clojure -M:dev:test
2722
```
23+
24+
## Build
25+
```bash
26+
clojure -T:build uberjar
27+
```

build.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
(:require [clojure.tools.build.api :as b]))
44

55
(def default-lib 'codes.clj.docs/extractor)
6-
(def default-main 'codes.clj.docs.extractor)
6+
(def default-main 'codes.clj.docs.core)
77
(def default-version "0.0.1-SNAPSHOT")
88
(def class-dir "target/classes")
99

0 commit comments

Comments
 (0)