瀏覽代碼

Add [ChatGPT generated] session log titles

Also: readme edit
master
The Dod 9 月之前
父節點
當前提交
c9e2954933
共有 5 個文件被更改,包括 39 次插入14 次删除
  1. 3
    0
      README.md
  2. 10
    1
      genlogs.py
  3. 3
    3
      logs.tmpl
  4. 10
    10
      logs/index.html
  5. 13
    0
      logs/titles.json

+ 3
- 0
README.md 查看文件

@@ -1,9 +1,12 @@
1 1
 A ChatGPT based emulator of Doctor Kernel — JJ's therapist from the book
2 2
 "[A digital Affair](book/)" by Neora Shem Shaul (or rather, a partial translation of it to English, because [at least currently] ChatGPT's Hebrew is not good enough.
3 3
 
4
+#### As seen at the book's [30th anniversary party](https://even.tooot.im/events/47ecce4d-b093-41ae-a1ad-687979d91a66).
5
+
4 6
 It is run as a console app, and emulates slow typing like a chat over a modem in 1993.
5 7
 For best results, run on a green on black terminal, with a large and archaic monospace font (see screenshot below for inspiration).
6 8
 
9
+#### See also: [Sample session archive](https://nandn.org.il/doctorkernel).
7 10
 
8 11
 #### Setup
9 12
 

+ 10
- 1
genlogs.py 查看文件

@@ -1,16 +1,25 @@
1 1
 import chevron
2 2
 from glob import glob
3 3
 import os
4
+import json
4 5
 
5 6
 MAX_FILES = 20
6 7
 
8
+titles=json.load(open("logs/titles.json"))
9
+
10
+def title(filename):
11
+    return titles.get(filename, filename.split('.')[0])
7 12
 
8 13
 def genlog():
9 14
     os.chdir('logs')
10 15
     filenames = list(reversed(sorted(glob("*.txt"))))[:MAX_FILES]
16
+    files = [
17
+        {"filename": f, "title": titles.get(f, f.split(".")[0])}
18
+        for f in filenames
19
+    ]
11 20
     with open('../logs.tmpl') as fin:
12 21
         with open('index.html','w') as fout:
13
-            fout.write(chevron.render(fin, {"filenames": filenames}))
22
+            fout.write(chevron.render(fin, {"files": files}))
14 23
 
15 24
 if __name__ == '__main__':
16 25
     genlog()

+ 3
- 3
logs.tmpl 查看文件

@@ -23,11 +23,11 @@
23 23
         <div class="row">
24 24
             <div class="col-12">
25 25
                 <ul class="list-group text-center">
26
-                  {{#filenames}}
26
+                  {{#files}}
27 27
                     <li class="list-group-item">
28
-                        <a target="_blank" class="btn btn-success" href="{{.}}">[{{.}}]</a>
28
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="{{filename}}">[{{title}}]</a>
29 29
                     </li>
30
-                  {{/filenames}}
30
+                  {{/files}}
31 31
                 </ul>
32 32
              </div>
33 33
         </div>

+ 10
- 10
logs/index.html 查看文件

@@ -24,34 +24,34 @@
24 24
             <div class="col-12">
25 25
                 <ul class="list-group text-center">
26 26
                     <li class="list-group-item">
27
-                        <a target="_blank" class="btn btn-success" href="log-20230821-215540.txt">[log-20230821-215540.txt]</a>
27
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230821-215540.txt">[Discussion on Tetris Obsession and Emotional Exploration]</a>
28 28
                     </li>
29 29
                     <li class="list-group-item">
30
-                        <a target="_blank" class="btn btn-success" href="log-20230821-214254.txt">[log-20230821-214254.txt]</a>
30
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230821-214254.txt">[Exploration of Dream with Revived Deceased Sister]</a>
31 31
                     </li>
32 32
                     <li class="list-group-item">
33
-                        <a target="_blank" class="btn btn-success" href="log-20230728-231707.txt">[log-20230728-231707.txt]</a>
33
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230728-231707.txt">[Reflection on Previous Sessions and Exploration of AI Identity]</a>
34 34
                     </li>
35 35
                     <li class="list-group-item">
36
-                        <a target="_blank" class="btn btn-success" href="log-20230726-124328.txt">[log-20230726-124328.txt]</a>
36
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230726-124328.txt">[Discussion on Democracy and Occupation]</a>
37 37
                     </li>
38 38
                     <li class="list-group-item">
39
-                        <a target="_blank" class="btn btn-success" href="log-20230725-113052.txt">[log-20230725-113052.txt]</a>
39
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230725-113052.txt">[Exploration of New Identity and Acknowledgment of Privilege]</a>
40 40
                     </li>
41 41
                     <li class="list-group-item">
42
-                        <a target="_blank" class="btn btn-success" href="log-20230723-130458.txt">[log-20230723-130458.txt]</a>
42
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230723-130458.txt">[Challenges of Digital Therapy and Future Possibilities]</a>
43 43
                     </li>
44 44
                     <li class="list-group-item">
45
-                        <a target="_blank" class="btn btn-success" href="log-20230722-234605.txt">[log-20230722-234605.txt]</a>
45
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230722-234605.txt">[Discussion on Missing NN and Coping Strategies]</a>
46 46
                     </li>
47 47
                     <li class="list-group-item">
48
-                        <a target="_blank" class="btn btn-success" href="log-20230722-171740.txt">[log-20230722-171740.txt]</a>
48
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230722-171740.txt">[Exploration of Dream Symbolism and Dress Significance]</a>
49 49
                     </li>
50 50
                     <li class="list-group-item">
51
-                        <a target="_blank" class="btn btn-success" href="log-20230722-170652.txt">[log-20230722-170652.txt]</a>
51
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230722-170652.txt">[Discussion on Y2K Problem and Potential Consequences]</a>
52 52
                     </li>
53 53
                     <li class="list-group-item">
54
-                        <a target="_blank" class="btn btn-success" href="log-20230722-170005.txt">[log-20230722-170005.txt]</a>
54
+                        <a target="_blank" style="width:100%; margin-bottom: 0.5em" class="btn btn-success m" href="log-20230722-170005.txt">[Exploration of Freedom and Escape through Judd's Motorbike]</a>
55 55
                     </li>
56 56
                 </ul>
57 57
              </div>

+ 13
- 0
logs/titles.json 查看文件

@@ -0,0 +1,13 @@
1
+{
2
+  "log-20230821-215540.txt": "Discussion on Tetris Obsession and Emotional Exploration",
3
+  "log-20230821-214254.txt": "Exploration of Dream with Revived Deceased Sister",
4
+  "log-20230728-231707.txt": "Reflection on Previous Sessions and Exploration of AI Identity",
5
+  "log-20230726-124328.txt": "Discussion on Democracy and Occupation",
6
+  "log-20230725-113052.txt": "Exploration of New Identity and Acknowledgment of Privilege",
7
+  "log-20230723-130458.txt": "Challenges of Digital Therapy and Future Possibilities",
8
+  "log-20230722-234605.txt": "Discussion on Missing NN and Coping Strategies",
9
+  "log-20230722-171740.txt": "Exploration of Dream Symbolism and Dress Significance",
10
+  "log-20230722-170652.txt": "Discussion on Y2K Problem and Potential Consequences",
11
+  "log-20230722-170005.txt": "Exploration of Freedom and Escape through Judd's Motorbike"
12
+}
13
+

Loading…
取消
儲存