Skip to content

Commit 8938ab3

Browse files
committed
Update BOOK_ID in compile-quotes.js
1 parent 41ca718 commit 8938ab3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compile-quotes.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const openai = new OpenAIApi(configuration);
2222
dotenv.config();
2323

2424
const CLUSTER_THRESHOLD = 0.8;
25-
const BOOK_ID = "33431849";
25+
const BOOK_ID = "38318378";
2626

2727
const supabaseUrl = process.env.SUPABASE_URL;
2828
const supabaseKey = process.env.SUPABASE_KEY;
@@ -166,16 +166,20 @@ const main = async () => {
166166
// each quote is a bullet point under the heading
167167

168168
let markdown = "";
169+
let tableOfContents = "";
169170
for (let index = 0; index < clusteredQuotes.length; index++) {
170171
const cluster = clusteredQuotes[index];
171172
const topic = await assignTopicToCluster(cluster);
172173
console.log("Cluster " + index + ": " + topic);
174+
tableOfContents += `${index + 1}. [Cluster ${index} - ${topic}](#cluster-${index}---${topic})\n`;
173175
markdown += `## Cluster ${index} - ${topic}\n`;
174176
cluster.forEach((quote) => {
175177
markdown += `- ${quote.text}\n`;
176178
});
177179
}
178180

181+
markdown = `# Table of Contents\n${tableOfContents}\n${markdown}`;
182+
179183

180184
fs.writeFileSync("quotes.md", markdown);
181185
};

0 commit comments

Comments
 (0)