Skip to content

Commit 9c0264a

Browse files
williajmclaude
andauthored
Add syntax-highlighted source pages for GitHub Pages (#4)
Raw .java files are served as plain text by GitHub Pages, so the Implementation links rendered without highlighting. Each source file now has a companion <Name>.java.md wrapper that pulls the code into a fenced java block via include_relative, which Rouge highlights in the Cayman theme. README and docs links now target the wrapper pages; jekyll-relative-links converts them to .html on the published site. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent aca83f7 commit 9c0264a

101 files changed

Lines changed: 818 additions & 71 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/anti-patterns.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ business rule is unfindable and unsearchable; when "free shipping over GBP 25" b
3636
the 25.00s get updated (see [copy-paste programming](#3-copy-paste-programming)); `status == 3`
3737
invites off-by-one bugs no compiler can catch. **The counter:** named constants
3838
(`FREE_SHIPPING_THRESHOLD`) and enums --
39-
[`PaymentMethod`](../src/main/java/com/bookshop/creational/factorymethod/PaymentMethod.java) makes
39+
[`PaymentMethod`](../src/main/java/com/bookshop/creational/factorymethod/PaymentMethod.java.md) makes
4040
invalid payment types unrepresentable, and the compiler checks every `switch` over it.
4141

4242
## 3. Copy-paste programming
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: AddressCheck.java
3+
---
4+
5+
```java
6+
{% include_relative AddressCheck.java %}
7+
```
8+
9+
[Raw file](AddressCheck.java)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: FraudCheck.java
3+
---
4+
5+
```java
6+
{% include_relative FraudCheck.java %}
7+
```
8+
9+
[Raw file](FraudCheck.java)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: OrderCheck.java
3+
---
4+
5+
```java
6+
{% include_relative OrderCheck.java %}
7+
```
8+
9+
[Raw file](OrderCheck.java)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: OrderRequest.java
3+
---
4+
5+
```java
6+
{% include_relative OrderRequest.java %}
7+
```
8+
9+
[Raw file](OrderRequest.java)

‎src/main/java/com/bookshop/behavioral/chainofresponsibility/README.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ Servlet `Filter` chains, Spring Security's filter chain, Spring MVC interceptors
3737

3838
## Implementation
3939

40-
- [`OrderCheck`](OrderCheck.java) -- the handler interface, including the chain assembly.
41-
- [`StockCheck`](StockCheck.java), [`AddressCheck`](AddressCheck.java),
42-
[`FraudCheck`](FraudCheck.java) -- the concrete checks.
43-
- [`OrderRequest`](OrderRequest.java), [`ValidationResult`](ValidationResult.java) -- the request
40+
- [`OrderCheck`](OrderCheck.java.md) -- the handler interface, including the chain assembly.
41+
- [`StockCheck`](StockCheck.java.md), [`AddressCheck`](AddressCheck.java.md),
42+
[`FraudCheck`](FraudCheck.java.md) -- the concrete checks.
43+
- [`OrderRequest`](OrderRequest.java.md), [`ValidationResult`](ValidationResult.java.md) -- the request
4444
and result types.
4545

4646
## Example test
4747

48-
[`OrderValidationChainTest`](../../../../../../test/java/com/bookshop/behavioral/chainofresponsibility/OrderValidationChainTest.java)
48+
[`OrderValidationChainTest`](../../../../../../test/java/com/bookshop/behavioral/chainofresponsibility/OrderValidationChainTest.java.md)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: StockCheck.java
3+
---
4+
5+
```java
6+
{% include_relative StockCheck.java %}
7+
```
8+
9+
[Raw file](StockCheck.java)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: ValidationResult.java
3+
---
4+
5+
```java
6+
{% include_relative ValidationResult.java %}
7+
```
8+
9+
[Raw file](ValidationResult.java)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: EmailAlerts.java
3+
---
4+
5+
```java
6+
{% include_relative EmailAlerts.java %}
7+
```
8+
9+
[Raw file](EmailAlerts.java)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Inventory.java
3+
---
4+
5+
```java
6+
{% include_relative Inventory.java %}
7+
```
8+
9+
[Raw file](Inventory.java)

0 commit comments

Comments
 (0)