refactor: move DSA notes to org/study_deck_02/

Restructure NeetCode study materials into a dedicated Anki-exportable
deck directory. Separates DSA problem notes from C++ flashcards.

- Move roadmap.org from leetcode/out/ to org/study_deck_02/
- Move 200 note files from org/cpp/dsa/ to org/study_deck_02/dsa/
- Add #+PROPERTY: STUDY_DECK_02 to all org files for org-anki export
- Simplify roadmap format: properties drawer replaces nested headings
- Update NEETCODE backlinks in all note files
- Update extract.mjs and scaffold-notes.mjs for new paths
- Create org/study_deck_02/AGENTS.md with study workflow docs
- Update root and leetcode AGENTS.md
This commit is contained in:
2026-06-01 16:12:21 +08:00
parent 1d88296bf6
commit dfadc1ca48
211 changed files with 2240 additions and 1908 deletions
+15 -12
View File
@@ -197,6 +197,7 @@ function buildOrg(sortedNodes, problemsByTopic) {
const now = new Date().toISOString().slice(0, 10);
lines.push("#+TITLE: NeetCode Roadmap");
lines.push("#+PROPERTY: STUDY_DECK_02");
lines.push(`#+DATE: ${now}`);
lines.push("#+TODO: TODO DONE");
lines.push("#+STARTUP: overview");
@@ -213,7 +214,7 @@ function buildOrg(sortedNodes, problemsByTopic) {
.replace(/[^a-z0-9]+/g, "-")
.replace(/(^-|-$)/g, "");
const notesRoot = "../../org/cpp/dsa";
const notesRoot = "dsa";
for (const node of sortedNodes) {
const topicProblems = (problemsByTopic[node.name] || []).filter(
@@ -234,17 +235,17 @@ function buildOrg(sortedNodes, problemsByTopic) {
const lcUrl = `${LEETCODE_BASE}${p.link}`;
const num = p.code.split("-")[0];
const notesFile = `${notesRoot}/${slug}/${p.code}.org`;
lines.push(`** TODO ${num}. ${p.name} :${tag}: [/]`);
lines.push(`*** TODO Python`);
lines.push(`- [[${GITHUB_SOLUTIONS}python/${p.code}.py][${p.code}.py]]`);
lines.push(`*** TODO C++`);
lines.push(`- [[${GITHUB_SOLUTIONS}cpp/${p.code}.cpp][${p.code}.cpp]]`);
lines.push(`- LeetCode: [[${lcUrl}][${p.link}]]`);
lines.push(`** TODO ${num}. ${p.name} :${tag}:`);
lines.push(`:PROPERTIES:`);
lines.push(`:LEETCODE: [[${lcUrl}][Problem]]`);
lines.push(`:CPP: [[${GITHUB_SOLUTIONS}cpp/${p.code}.cpp][Solution]]`);
lines.push(`:PYTHON: [[${GITHUB_SOLUTIONS}python/${p.code}.py][Solution]]`);
if (p.video)
lines.push(
`- Video: [[https://youtube.com/watch?v=${p.video}][explanation]]`
`:VIDEO: [[https://youtube.com/watch?v=${p.video}][Watch]]`
);
lines.push(`- Notes: [[${notesFile}][My Solution]]`);
lines.push(`:END:`);
lines.push(`Notes: [[${notesFile}][My Solution]]`);
}
lines.push("");
}
@@ -343,9 +344,11 @@ async function main() {
// DOT
writeFileSync(join(outDir, "roadmap.dot"), buildDot(nodes), "utf8");
// Org-mode
// Org-mode — write to org/study_deck_02/roadmap.org
const orgDir = join(__dirname, "../org/study_deck_02");
mkdirSync(orgDir, { recursive: true });
writeFileSync(
join(outDir, "roadmap.org"),
join(orgDir, "roadmap.org"),
buildOrg(sorted, problemsByTopic),
"utf8"
);
@@ -353,7 +356,7 @@ async function main() {
console.log(`Wrote ${outDir}/roadmap.json (${result.stats.totalProblems} problems total)`);
console.log(`Wrote ${outDir}/roadmap-neetcode150.json (${result.stats.neetcode150} problems)`);
console.log(`Wrote ${outDir}/roadmap.dot`);
console.log(`Wrote ${outDir}/roadmap.org`);
console.log(`Wrote ${join(orgDir, "roadmap.org")}`);
console.log(
` ${result.stats.topics} topics, ${result.stats.edges} edges`
);