Skip to content

Commit 4147576

Browse files
authored
Merge pull request #56 from javaevolved/copilot/update-readme-documentation
docs: update README — Enterprise category, correct counts, badges, contributing guide
2 parents 2288377 + e6082cb commit 4147576

File tree

2 files changed

+63
-5
lines changed

2 files changed

+63
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ A collection of side-by-side code comparisons showing old Java patterns next to
66

77
🔗 **[javaevolved.github.io](https://javaevolved.github.io)**
88

9+
[![GitHub Pages](https://img.shields.io/badge/GitHub%20Pages-live-brightgreen)](https://javaevolved.github.io)
10+
[![Snippets](https://img.shields.io/badge/snippets-107-blue)](#categories)
11+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
12+
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange)](#contributing)
13+
14+
> **Note:** Update the snippet count badge above when adding new patterns.
15+
916
---
1017

1118
## What is this?
@@ -31,12 +38,13 @@ Each comparison includes an explanation of *why* the modern approach is better,
3138
| **Date/Time** | `java.time` basics, `Duration`/`Period`, `DateTimeFormatter`, instant precision |
3239
| **Security** | TLS defaults, `SecureRandom`, PEM encoding, key derivation functions |
3340
| **Tooling** | JShell, single-file execution, JFR profiling, compact source files, AOT |
41+
| **Enterprise** | EJB → CDI, JDBC → JPA/Jakarta Data, JNDI → injection, MDB → reactive messaging, REST |
3442

3543
## Architecture
3644

3745
This site uses a **JSON-first** build pipeline:
3846

39-
- **Source of truth**: Individual `content/category/slug.json` files (85 across 10 category folders)
47+
- **Source of truth**: Individual `content/category/slug.json` files (107 across 11 category folders)
4048
- **Templates**: `templates/` — shared HTML templates with `{{placeholder}}` tokens
4149
- **Generator**: `html-generators/generate.jar` — pre-built fat JAR that produces all HTML detail pages and `data/snippets.json`
4250
- **Deploy**: GitHub Actions runs the generator and deploys to GitHub Pages
@@ -69,10 +77,10 @@ For development on the generator itself, you can use JBang or Python — see [ht
6977
Contributions are welcome! Content is managed as JSON files — never edit generated HTML.
7078

7179
1. Fork the repo
72-
2. Create or edit a JSON file in the appropriate content folder (e.g. `content/language/my-feature.json`)
73-
3. Follow the [snippet JSON schema](.github/copilot-instructions.md) for all required fields
74-
4. Run `java -jar html-generators/generate.jar` to verify your changes build correctly
75-
5. Update `site/index.html` with a new preview card if adding a new snippet
80+
2. Create a new JSON file in the appropriate `content/<category>/` folder (e.g. `content/language/my-feature.json`)
81+
3. Copy [`content/template.json`](content/template.json) to the new file as a starting point for all required fields (see the [snippet JSON schema](.github/copilot-instructions.md) for details)
82+
4. Update the `prev`/`next` fields in adjacent pattern JSON files to maintain navigation
83+
5. Run `jbang html-generators/generate.java` to verify your changes build correctly
7684
6. Open a pull request
7785

7886
Please ensure JDK version labels only reference the version where a feature became **final** (non-preview).

content/template.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"id": 0,
3+
"slug": "your-slug-here",
4+
"title": "Your Pattern Title",
5+
"category": "language",
6+
"difficulty": "beginner",
7+
"jdkVersion": "17",
8+
"oldLabel": "Java 8",
9+
"modernLabel": "Java 17+",
10+
"oldApproach": "Old Approach Name",
11+
"modernApproach": "Modern Approach Name",
12+
"oldCode": "// Old way...",
13+
"modernCode": "// Modern way...",
14+
"summary": "One-line description of the pattern.",
15+
"explanation": "A paragraph explaining how the modern approach works and when to use it.",
16+
"whyModernWins": [
17+
{
18+
"icon": "",
19+
"title": "Short benefit title",
20+
"desc": "One sentence describing this benefit."
21+
},
22+
{
23+
"icon": "👁",
24+
"title": "Short benefit title",
25+
"desc": "One sentence describing this benefit."
26+
},
27+
{
28+
"icon": "🔒",
29+
"title": "Short benefit title",
30+
"desc": "One sentence describing this benefit."
31+
}
32+
],
33+
"support": {
34+
"state": "available",
35+
"description": "Widely available since JDK 17 (September 2021)"
36+
},
37+
"prev": "category/previous-slug",
38+
"next": "category/next-slug",
39+
"related": [
40+
"category/related-slug-1",
41+
"category/related-slug-2",
42+
"category/related-slug-3"
43+
],
44+
"docs": [
45+
{
46+
"title": "Javadoc or Guide Title",
47+
"href": "https://docs.oracle.com/..."
48+
}
49+
]
50+
}

0 commit comments

Comments
 (0)