|
| 1 | + |
| 2 | +<!-- generated with openai: standard-12 --> |
| 3 | + |
1 | 4 | ```clojure |
2 | 5 | (ns robertluo.clerk-doc.readme |
3 | 6 | (:require [robertluo.clerk-doc :as doc] |
4 | 7 | [robertluo.clerk-doc.ai :as ai])) |
5 | 8 | ``` |
6 | 9 | # io.github.robertluo/clerk-doc |
| 10 | + |
7 | 11 | [](https://github.com/robertluo/clerk-doc/actions/workflows/main.yml) |
8 | | - Turns your Clojure source files into markdown. [clerk](https://github.com/nextjournal/clerk) notebooks are good |
9 | | - candidates, when you don't want to write README.md file for your Github projects. |
| 12 | + |
| 13 | + Turns Clojure source files into markdown. Usually [clerk](https://github.com/nextjournal/clerk) notebooks are good |
| 14 | + candidates, when you do not feel like write README.md file for your Github projects. |
10 | 15 | ## Usage |
11 | 16 |
|
12 | | - Write a Clojure source file just like this. |
| 17 | + Write a clojure source file just like this. |
13 | 18 | Add an alias in your `deps.edn`: |
14 | 19 | ```clojure |
15 | 20 | (comment |
|
19 | 24 | :eval-code? true :ai-improve? false}}} |
20 | 25 | ) |
21 | 26 | ``` |
22 | | - and call it with `clojure -X:clerk` that's it, by default it converts from `your-source.clj` to `README.md`. |
| 27 | + and call it by `clojure -X:clerk` |
23 | 28 | ## Goodies |
24 | | - - If `:eval-code?` set to true, it will evaluate the Clojure code within the file and append the result to |
25 | | - the generated code blocks. |
26 | | - - Thanks to [openai-clojure](https://github.com/wkok/openai-clojure), with the |
27 | | - `:ai-improve?` flag you can rely on OpenAI to improve your md file. A few other |
28 | | - requirements for this functionality: |
29 | | - - Open a free account on OpenAI, the API rate limit will generate a 400 error for anything longer than one simple sentence. |
30 | | - - Set up an environment variable named `OPENAI_KEY` with your paid API key from OpenAI. |
31 | | - - Turn on the `ai-improve?` flag in your `deps.edn`. |
32 | | - |
| 29 | + - If `:eval-code?` set to true, the clojure code in the file will be evaluated, |
| 30 | + the result will be append to the generated code blocks. |
| 31 | + - Thanks to [openai-clojure](https://github.com/wkok/openai-clojure) the |
| 32 | + `:ai-improve?` flag using OpenAI to improve your result md file. |
| 33 | + You need set up your environment, please refer to the above link. |
| 34 | + > You have to have a paid account of OpenAI, otherwise the OpenAI's rate limit will generate |
| 35 | + > a 400 error for anything longer than one simple sentence. |
33 | 36 | ## [UnLicense](https://unlicense.org/) |
34 | 37 | 2023 Robert Luo |
0 commit comments