Skip to content

Commit e8d58bf

Browse files
authored
Merge pull request #16 from solid-process/chore/references
Add back-to-top navigation to REFERENCE.md
2 parents 90e9ed2 + 47b4437 commit e8d58bf

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

.claude/CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
1111
- **[docs/REFERENCE.md](docs/REFERENCE.md)** — Comprehensive guide covering every feature with detailed examples. Point AI coding agents here.
1212
- **[docs/overview/](docs/overview/)** — Quick overview guides (010–100) for each topic.
1313

14+
### Back-to-Top Anchors
15+
16+
Both `README.md` and `docs/REFERENCE.md` use back-to-top navigation after each main section. When adding a new numbered section to `REFERENCE.md`:
17+
18+
1. Add `<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>` before the `---` that closes the section
19+
2. Update the Table of Contents with the new entry
20+
1421
## Common Commands
1522

1623
```bash

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ You can also check the [examples](examples) directory for more simple examples o
9191

9292
> **🤖 AI Agents:** Point your coding assistant to [`docs/REFERENCE.md`](docs/REFERENCE.md) for complete API knowledge and patterns, or explore the [AI-Powered Wiki](https://deepwiki.com/solid-process/solid-process) for visual diagrams and interactive Q&A.
9393
94-
[**Start Learning →**](docs/REFERENCE.md)
94+
**Start Learning →** [Reference Guide](docs/REFERENCE.md) | [Quick Overview](docs/overview/010_KEY_CONCEPTS.md)
9595

9696
<p align="right"><a href="#-table-of-contents-">⬆️ &nbsp;back to top</a></p>
9797

docs/REFERENCE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ require "solid/process"
7676

7777
Solid::Process supports Ruby 2.7+ and Rails 6.0+. See the [README](../README.md) for the full compatibility matrix.
7878

79+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
80+
7981
---
8082

8183
## 2. Your First Process
@@ -165,6 +167,8 @@ result1 = Greeting.call(name: "Alice")
165167
result2 = Greeting.call(name: "Bob")
166168
```
167169

170+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
171+
168172
---
169173

170174
## 3. Input Definition & Validation
@@ -292,6 +296,8 @@ class User::Registration < Solid::Process
292296
end
293297
```
294298

299+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
300+
295301
---
296302

297303
## 4. Input Normalization
@@ -392,6 +398,8 @@ UserRegistration.input.normalize_value_for(:email, " [email protected]\n")
392398
393399
```
394400

401+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
402+
395403
---
396404

397405
## 5. Working with Results
@@ -490,6 +498,8 @@ end
490498
| `Solid::Failure` | Failure results |
491499
| `Solid::Output` | Alias for `Solid::Result` |
492500

501+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
502+
493503
---
494504

495505
## 6. Pattern Matching
@@ -602,6 +612,8 @@ in Solid::Failure[:creation_failed, {errors:}]
602612
end
603613
```
604614

615+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
616+
605617
---
606618

607619
## 7. Steps DSL
@@ -717,6 +729,8 @@ Given(a: 1, b: 2, c: 3)
717729

718730
This keeps your results clean, exposing only what callers need.
719731

732+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
733+
720734
---
721735

722736
## 8. Transactions
@@ -821,6 +835,8 @@ The `.then { |result| ... }` pattern lets you wrap only part of the chain in a t
821835

822836
**Note:** `rollback_on_failure` requires ActiveRecord and an active database connection.
823837

838+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
839+
824840
---
825841

826842
## 9. Dependencies
@@ -928,6 +944,8 @@ end
928944

929945
This allows you to swap `User::Creation` with a mock in tests.
930946

947+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
948+
931949
---
932950

933951
## 10. Process Composition
@@ -1037,6 +1055,8 @@ def create_user_token(user:, **)
10371055
end
10381056
```
10391057

1058+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
1059+
10401060
---
10411061

10421062
## 11. Callbacks
@@ -1186,6 +1206,8 @@ after_success { puts "3" } # Runs first
11861206
# Output: 3, 2, 1
11871207
```
11881208

1209+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
1210+
11891211
---
11901212

11911213
## 12. Error Handling
@@ -1302,6 +1324,8 @@ end
13021324
# => Solid::Process::Error: "`Failure!()` cannot be called because the `MyProcess#output` is already set."
13031325
```
13041326

1327+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
1328+
13051329
---
13061330

13071331
## 13. Instrumentation
@@ -1399,6 +1423,8 @@ cleaner.add_silencer { |line| line.include?("/gems/") }
13991423
- **Production** — Audit process executions and investigate errors
14001424
- **Performance** — See which steps execute and identify bottlenecks
14011425

1426+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
1427+
14021428
---
14031429

14041430
## 14. Validators Reference
@@ -1507,6 +1533,8 @@ validates :email, email: true, allow_nil: true # Skip if nil
15071533
validates :email, email: true, allow_blank: true # Skip if blank (nil or "")
15081534
```
15091535

1536+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
1537+
15101538
---
15111539

15121540
## 15. Internal Libraries
@@ -1610,6 +1638,8 @@ class User::Creation < Solid::Process
16101638
end
16111639
```
16121640

1641+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
1642+
16131643
---
16141644

16151645
## 16. Testing
@@ -1827,6 +1857,8 @@ RSpec.describe User::Creation do
18271857
end
18281858
```
18291859

1860+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>
1861+
18301862
---
18311863

18321864
## What's Next?
@@ -1847,3 +1879,5 @@ For real-world examples, check:
18471879
- [Solid Rails App](https://github.com/solid-process/solid-rails-app) — Complete Rails application
18481880

18491881
For questions or issues, visit the [GitHub repository](https://github.com/solid-process/solid-process).
1882+
1883+
<p align="right"><a href="#table-of-contents">⬆️ &nbsp;back to top</a></p>

0 commit comments

Comments
 (0)