mirror of
https://github.com/prdlk/leetcode.git
synced 2026-09-16 23:16:26 +00:00
docs(sync): update sync command to target docs/solutions and rename section to Answer
This commit is contained in:
@@ -1,18 +1,18 @@
|
|||||||
---
|
---
|
||||||
description: Sync work/ leetcode solutions into docs/reference/ pages (gold standard format)
|
description: Sync work/ leetcode solutions into docs/solutions/ pages (gold standard format)
|
||||||
---
|
---
|
||||||
|
|
||||||
Sync every leetcode solution under `work/` into a docs page under `docs/reference/`, formatted exactly like the gold standard `docs/reference/01-reverse-string.mdx`. Extra focus (optional): $@
|
Sync every leetcode solution under `work/` into a docs page under `docs/reference/`, formatted exactly like the gold standard `docs/solutions/01-reverse-string.mdx`. Extra focus (optional): $@
|
||||||
|
|
||||||
## Inventory
|
## Inventory
|
||||||
|
|
||||||
1. Glob `work/**/*.js`. Each filename is `<number>.<kebab-slug>.js`; the directory path is `work/<Difficulty>/<Category>/`.
|
1. Glob `work/**/*.js`. Each filename is `<number>.<kebab-slug>.js`; the directory path is `work/<Difficulty>/<Category>/`.
|
||||||
2. Glob `docs/reference/*.mdx`. A solution is already ported when a page's frontmatter title starts with the same leetcode number (`title: '<number>. …'`). Numeric filename prefixes (`01-`, `02-`, …) define sidebar order — never renumber existing pages.
|
2. Glob `docs/solutions/*.mdx`. A solution is already ported when a page's frontmatter title starts with the same leetcode number (`title: '<number>. …'`). Numeric filename prefixes (`01-`, `02-`, …) define sidebar order — never renumber existing pages.
|
||||||
3. Build the todo list: one task per unported solution, plus one task per already-ported page whose `## Solution` code block no longer matches its `work/` source verbatim (update just the code block in that case).
|
3. Build the todo list: one task per unported solution, plus one task per already-ported page whose `## Answer` code block no longer matches its `work/` source verbatim (update just the code block in that case).
|
||||||
|
|
||||||
## Target path
|
## Target path
|
||||||
|
|
||||||
`docs/reference/<NN>-<kebab-slug>.mdx` where `<NN>` is the next unused two-digit prefix (continue from the highest existing one, in ascending leetcode-number order for the new batch) and `<kebab-slug>` is the slug from the work filename.
|
`docs/solutions/<NN>-<kebab-slug>.mdx` where `<NN>` is the next unused two-digit prefix (continue from the highest existing one, in ascending leetcode-number order for the new batch) and `<kebab-slug>` is the slug from the work filename.
|
||||||
|
|
||||||
## Page format — copy the gold standard exactly
|
## Page format — copy the gold standard exactly
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ sidebar:
|
|||||||
|
|
||||||
- `<constraint>` (inline code; keep plain prose like "nums is sorted…" with only identifiers in backticks)
|
- `<constraint>` (inline code; keep plain prose like "nums is sorted…" with only identifiers in backticks)
|
||||||
|
|
||||||
## Solution
|
## Answer
|
||||||
|
|
||||||
```js
|
```js
|
||||||
<the JSDoc comment and function from the work file, byte-for-byte verbatim — do not reformat, rename, or "improve" the code>
|
<the JSDoc comment and function from the work file, byte-for-byte verbatim — do not reformat, rename, or "improve" the code>
|
||||||
@@ -58,7 +58,7 @@ Rules:
|
|||||||
|
|
||||||
## Verify
|
## Verify
|
||||||
|
|
||||||
1. `bunx blume build --isolated` must succeed with no new warnings; confirm each new route generated (`/reference/<slug>`).
|
1. `bunx blume build --isolated` must succeed with no new warnings; confirm each new route generated (`/solutions/<slug>`).
|
||||||
2. Spot-check one new page's built HTML for the badge, callout (when present), and solution code.
|
2. Spot-check one new page's built HTML for the badge, callout (when present), and solution code.
|
||||||
3. `rm -rf .blume-verify` when done.
|
3. `rm -rf .blume-verify` when done.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user