Skip to content

docs(site): add figure visual style guide and contributor docs#302

Open
nitindavegit wants to merge 1 commit into
rohitg00:mainfrom
nitindavegit:docs/figure-style-guide
Open

docs(site): add figure visual style guide and contributor docs#302
nitindavegit wants to merge 1 commit into
rohitg00:mainfrom
nitindavegit:docs/figure-style-guide

Conversation

@nitindavegit

Copy link
Copy Markdown

What this PR does

Adds two new docs — a visual style guide (STYLE.md) and a contributor guide (CONTRIBUTING-FIGURES.md) — that document the existing figure system conventions so contributors can create and embed figures without reverse-engineering 7,000 lines of JS and CSS.

Kind of change

  • New lesson
  • Fix to an existing lesson
  • Translation
  • New output (prompt, skill, agent, MCP server)
  • Docs / website / tooling

Checklist

  • Code runs without errors with the listed dependencies
  • No comments in code files (docs explain, code is self-explanatory)
  • Built from scratch first, then shown with a framework (for new lessons)
  • Lesson folder matches LESSON_TEMPLATE.md structure
  • ROADMAP.md row for the lesson is a markdown link ([Name](phases/...)), not bare text
  • One lesson per commit (atomic per-lesson rule)
  • Tested locally / code output matches what docs/en.md claims

Phase / lesson

N/A — site-wide docs.

Notes for reviewer

  • STYLE.md extracts the blueprint aesthetic (colors, typography, line weights, spacing, animation principles) that already exists in the codebase but was undocumented.
  • CONTRIBUTING-FIGURES.md covers all three figure types: interactive widgets, animated explainers, and static SVGs.
  • Updated INDEX.md to link to both new files and added interactive/animated figure instructions to the "How to add" section.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Three documentation files are added or updated to establish a unified contributor reference for curriculum figures. A new STYLE.md defines the visual and accessibility contract. A new CONTRIBUTING-FIGURES.md provides a full authoring guide for interactive widgets, animated SVG explainers, and static SVGs. INDEX.md is updated to cross-reference both documents.

Changes

Figure Authoring Documentation

Layer / File(s) Summary
Visual style and accessibility contract
site/assets/figures/STYLE.md
New file defining the complete visual contract: CSS-variable color palette, typography sizing tables, line-weight and dash standards, SVG viewBox presets, animation system rules and prefers-reduced-motion contract, DOM structure patterns for all three figure types, window.LF toolkit conventions, accessibility requirements (role="img", aria-label, captions), file organization, and a pre-submission review checklist.
Contributor authoring guide
site/CONTRIBUTING-FIGURES.md
New file covering all three figure types end-to-end: quick-start embedding, interactive widget module selection and full widget template (state contract, _render, controls, LF.register), the loop() API for animated explainers with hover-pause and reduced-motion behavior, static SVG naming and FIG numbering, lesson embedding patterns, a testing checklist, and a convention summary table.
INDEX.md cross-reference updates
site/assets/figures/INDEX.md
Style/aesthetic guidance updated to reference STYLE.md and the figures walkthrough; How-to-add section restructured into subsections for interactive slider-driven figures, animated SVG explainers, and static SVG diagrams.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding two new documentation files (a visual style guide and contributor guide) for the figure system.
Description check ✅ Passed The description clearly explains what the PR does, references the specific files being added, and provides context about addressing an existing gap in documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@site/assets/figures/INDEX.md`:
- Line 5: The relative link path in the INDEX.md file is incorrect and points to
a non-existent location. In the markdown reference that links to the contributor
guide for figures, change the relative path from `../CONTRIBUTING-FIGURES.md` to
`../../CONTRIBUTING-FIGURES.md` to correctly resolve to the actual file
location. Apply this same fix to both occurrences mentioned in the comment (the
one on line 5 and the additional one on line 35).

In `@site/assets/figures/STYLE.md`:
- Around line 106-115: The code fences in the STYLE.md file are missing language
labels, which causes markdownlint to fail and makes the content ambiguous. Add
the `text` language identifier to both code fence blocks: the first fence
containing the CSS class definitions (.lf, .lf-head, .lf-body, etc.) should be
labeled ```text, and the second fence containing the file structure (site/,
figures.js, etc.) at lines 270-290 should also be labeled ```text. This will
satisfy the linter and clarify the content type for users.

In `@site/CONTRIBUTING-FIGURES.md`:
- Around line 34-37: The "Interactive Widgets" section in
CONTRIBUTING-FIGURES.md currently states "140+ existing" but this contradicts
the count of "134+ across 13 modules" mentioned in STYLE.md. Update the widget
count in the Interactive Widgets section header to match the STYLE.md reference,
or remove the specific numeric count entirely and use only a general descriptor
like "Many existing" if the exact count is subject to frequent changes. Ensure
both documentation files maintain consistent widget count information.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 12b9702a-294d-4178-a26f-9d72bf1f9f58

📥 Commits

Reviewing files that changed from the base of the PR and between 574a5d6 and 3c1d755.

📒 Files selected for processing (3)
  • site/CONTRIBUTING-FIGURES.md
  • site/assets/figures/INDEX.md
  • site/assets/figures/STYLE.md

Every figure shipped under `site/assets/figures/` is listed below. FIG numbers are global, monotonically increasing, and never reused.

The aesthetic is documented in the `blueprint-diagram` Claude Code skill, which is distributed separately from this repo (per the project's "no vendor/tooling artifacts in repos" rule). The skill source lives under `~/.claude/skills/blueprint-diagram/` once installed; ask a maintainer for the install path or follow the [How to add](#how-to-add) section below for a manual workflow that does not require the skill.
The visual style is defined in [`STYLE.md`](STYLE.md) — read it before authoring a new figure. For the interactive widget system (slider-driven, theme-aware figures embedded via the ` ```figure ` fence), see [`site/CONTRIBUTING-FIGURES.md`](../CONTRIBUTING-FIGURES.md).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the contributor-guide link target.

From site/assets/figures/INDEX.md, ../CONTRIBUTING-FIGURES.md points at site/assets/CONTRIBUTING-FIGURES.md, which does not exist. Use the repo-local path instead.

Suggested fix
- see [`site/CONTRIBUTING-FIGURES.md`](../CONTRIBUTING-FIGURES.md)
+ see [`site/CONTRIBUTING-FIGURES.md`](../../CONTRIBUTING-FIGURES.md)

Also applies to: 35-35

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/assets/figures/INDEX.md` at line 5, The relative link path in the
INDEX.md file is incorrect and points to a non-existent location. In the
markdown reference that links to the contributor guide for figures, change the
relative path from `../CONTRIBUTING-FIGURES.md` to
`../../CONTRIBUTING-FIGURES.md` to correctly resolve to the actual file
location. Apply this same fix to both occurrences mentioned in the comment (the
one on line 5 and the additional one on line 35).

Comment on lines +106 to +115
```
.lf margin: 28px 0; border: 1px solid var(--rule-soft)
.lf-head padding: 12px 16px; border-bottom: 1px solid var(--rule-soft)
.lf-body padding: 16px
.lf-grid display: grid; 2 columns; gap: 12px 24px
.lf-ctrl flex column; gap: 4px
.lf-out margin-top: 18px; padding-top: 14px; dashed top border
.lf-bar height: 10px; margin-top: 12px
.lf-cap padding: 12px 16px; border-top: 1px solid var(--rule-soft)
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Label the schematic code fences.

Both blocks are illustrative snippets, but the missing fence language trips markdownlint and makes them ambiguous to copy.

Suggested fix
-```
+```text
 .lf                    margin: 28px 0; border: 1px solid var(--rule-soft)
 ...
-```
+```
-```
+```text
 site/
   figures.js                   — 10 core animated SVG explainers
   ...
-```
+```

Also applies to: 270-290

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 106-106: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/assets/figures/STYLE.md` around lines 106 - 115, The code fences in the
STYLE.md file are missing language labels, which causes markdownlint to fail and
makes the content ambiguous. Add the `text` language identifier to both code
fence blocks: the first fence containing the CSS class definitions (.lf,
.lf-head, .lf-body, etc.) should be labeled ```text, and the second fence
containing the file structure (site/, figures.js, etc.) at lines 270-290 should
also be labeled ```text. This will satisfy the linter and clarify the content
type for users.

Source: Linters/SAST tools

Comment on lines +34 to +37
## Interactive Widgets (140+ existing)

These are slider/select-driven tools embedded inside a styled card (`.lf` container). Users drag parameters and see the output update in real time.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reconcile the widget count with the style guide.

This says 140+ existing, but STYLE.md already says 134+ across 13 modules. Please keep the headline in sync or remove the exact count.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/CONTRIBUTING-FIGURES.md` around lines 34 - 37, The "Interactive Widgets"
section in CONTRIBUTING-FIGURES.md currently states "140+ existing" but this
contradicts the count of "134+ across 13 modules" mentioned in STYLE.md. Update
the widget count in the Interactive Widgets section header to match the STYLE.md
reference, or remove the specific numeric count entirely and use only a general
descriptor like "Many existing" if the exact count is subject to frequent
changes. Ensure both documentation files maintain consistent widget count
information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant