Skip to content

Commit 669fac3

Browse files
committed
docs: update CHANGELOG and syntax docs for accuracy
- Update CHANGELOG.md to include order validation system details - Fix syntax.md to accurately reflect simplified 'Solution' title - Add validation behavior documentation
1 parent f37f2ed commit 669fac3

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
### New ✨
66

77
- Added `exercise_style` configuration option to control solution title styling
8-
- Set to `"solution_follow_exercise"` to remove hyperlinks from solution titles when solutions follow exercises directly
9-
- Default is `""` (empty string) which maintains the original clickable hyperlink behavior
8+
- Set to `"solution_follow_exercise"` to simplify solution titles to just "Solution" (no hyperlinks, no exercise references)
9+
- Default is `""` (empty string) which maintains the original behavior: "Solution to Exercise #.#" with clickable hyperlink
10+
- Added order validation system when `exercise_style = "solution_follow_exercise"`
11+
- Validates that solutions appear after their referenced exercises
12+
- Validates that solutions are in the same document as their exercises
13+
- Provides helpful warnings with file paths and line numbers
14+
- Warnings are prefixed with `[sphinx-exercise]` for clarity
1015

1116
### Improved 👌
1217

1318
- Enhanced solution title styling options for better UX in lecture-style content where solutions follow exercises
1419
- Improved configuration option naming for better clarity when used alongside other Sphinx extensions
20+
- Cleaner code in `post_transforms.py` with removed redundant title building logic
1521

1622
### Changed 🔄
1723

docs/source/syntax.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ sphinx:
415415

416416
By default, solution titles include a hyperlink to the corresponding exercise. This behavior can be modified using the `exercise_style` configuration option.
417417

418-
When solutions follow exercises directly in your content (common in lecture notes), you may want to remove the hyperlink to avoid confusion when using the `dropdown` class. Set `exercise_style` to `"solution_follow_exercise"` to display only text without hyperlinks in solution titles.
418+
When solutions follow exercises directly in your content (common in lecture notes), you may want to simplify the solution title. Set `exercise_style` to `"solution_follow_exercise"` to display a simplified title without hyperlinks or exercise references.
419419

420420
For Sphinx projects, add the configuration key in the `conf.py` file:
421421

@@ -434,7 +434,12 @@ sphinx:
434434
...
435435
```
436436

437-
When `exercise_style` is set to `"solution_follow_exercise"`, the solution title will display plain text like "Solution to Exercise 1 (Title)" instead of a hyperlink. When empty `""` (default), the exercise reference in the solution title remains clickable.
437+
When `exercise_style` is set to `"solution_follow_exercise"`:
438+
- The solution title displays just "Solution" (plain text, no hyperlink)
439+
- The extension validates that solutions follow their referenced exercises and warns if they don't
440+
- Solutions must be in the same document as their exercises (warnings if not)
441+
442+
When empty `""` (default), the solution title shows "Solution to Exercise #.#" with a clickable hyperlink to the exercise.
438443

439444
## Custom CSS or JavaScript
440445

0 commit comments

Comments
 (0)