Skip to content

Commit 7677dfa

Browse files
committed
Make Documentation AI-friendly
1 parent 28766b7 commit 7677dfa

File tree

3 files changed

+562
-0
lines changed

3 files changed

+562
-0
lines changed

dashjoin-core/src/test/java/org/dashjoin/util/LLMs.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public static void main(String[] args) throws Exception {
5757
FileUtils.write(new File("../llms.txt"), b, Charset.defaultCharset());
5858

5959
writeInput();
60+
writeWidget();
6061
}
6162

6263
static void writeInput() throws Exception {
@@ -81,4 +82,24 @@ static void writeInput() throws Exception {
8182
FileUtils.write(new File("../dashjoin-docs/docs/appendix-inputs.md"), b,
8283
Charset.defaultCharset());
8384
}
85+
86+
static void writeWidget() throws Exception {
87+
StringBuffer b = new StringBuffer();
88+
b.append("# Appendix: Form Input Types\n");
89+
Map<String, List<Example>> list = om.readValue(new File("../dashjoin-docs/llms/widget.json"),
90+
new TypeReference<Map<String, List<Example>>>() {});
91+
92+
for (Entry<String, List<Example>> entry : list.entrySet())
93+
for (Example e : entry.getValue()) {
94+
if (e.language == null)
95+
e.language = e.code instanceof String ? "jsonata" : "json";
96+
b.append("## " + e.title + "\n");
97+
b.append(e.description + "\n");
98+
b.append("```json\n");
99+
b.append(om.writerWithDefaultPrettyPrinter().writeValueAsString(e.code) + "\n```\n");
100+
}
101+
102+
FileUtils.write(new File("../dashjoin-docs/docs/appendix-widgets.md"), b,
103+
Charset.defaultCharset());
104+
}
84105
}

0 commit comments

Comments
 (0)