Add repository README with model table and per-model README with parameters and print notes. Add preview generation script and Claude commands for updating READMEs and generating previews. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23 lines
1.4 KiB
Markdown
23 lines
1.4 KiB
Markdown
Update the repository README.md and individual model README files.
|
|
|
|
## Steps
|
|
|
|
1. Find all `.scad` files in the repository using glob.
|
|
2. For each `.scad` file found:
|
|
a. Read the `.scad` file to extract its name and description from the header comments (lines starting with `//` at the top of the file).
|
|
b. Determine the model directory (the parent directory of the `.scad` file, relative to the repo root).
|
|
c. Check if a `README.md` exists in that model directory. If not, create one with:
|
|
- The model name as heading (from the first comment line)
|
|
- The preview image (``)
|
|
- A description section (from the header comments)
|
|
- A "Parameters" section listing the customizer parameters and their defaults extracted from the `.scad` file (variables with comments)
|
|
- A "Print Notes" section if printing tips are found in comments
|
|
d. If the model `README.md` already exists, update it to keep it in sync with the `.scad` file header.
|
|
3. Generate or update the root `README.md` with:
|
|
- A heading: `# 3D Printing Models`
|
|
- A brief intro line
|
|
- A markdown table with columns: **Preview**, **Name**, **Description**
|
|
- **Preview**: `<img src="{dir}/preview.png" width="200">` (use HTML img tag for sizing)
|
|
- **Name**: linked to the model directory README: `[{name}]({dir}/)`
|
|
- **Description**: short one-line description from the `.scad` header
|
|
- Models sorted alphabetically by directory name
|