You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Content files are YAML (preferred) or JSON under `content/{category}/{slug}.yaml
51
51
|`related`| Exactly **3** entries as `category/slug` paths (cross-category OK) |
52
52
|`tags`| Non-empty list of slugs registered in `html-generators/tags.properties`|
53
53
|`docs`| At least **1** entry with `title` and `href`|
54
-
|`prev` / `next`|`category/slug` path or `null` for first/last in the global chain|
54
+
|`navigationOrder`| Non-negative integer; global order is `(navigationOrder, category/slug)`|
55
55
|`jdkVersion`| The JDK version where the feature became **final** (not preview) |
56
56
|`difficulty`| One of: `beginner`, `intermediate`, `advanced`|
57
57
|`support.state`| One of: `available`, `preview`, `experimental`|
@@ -60,24 +60,24 @@ Content files are YAML (preferred) or JSON under `content/{category}/{slug}.yaml
60
60
61
61
1. Create `content/{category}/new-slug.yaml` with all required fields (use `content/template.json` as reference) and generate its `id` with `uuidgen`.
62
62
2. Add a non-empty `tags` list. Every tag slug must already exist in `html-generators/tags.properties`; add new `slug=Display Name` entries there in the same change.
63
-
3.Update `prev`/`next`in the adjacent patterns to maintain the navigation chain.
63
+
3.Set `navigationOrder` to place the pattern in the global sequence. Values are spaced by 1000; duplicate values are allowed and tie-break by pattern key.
64
64
4. Create `proof/{category}/{PascalCaseSlug}.java` — JBang script wrapping the modern code.
65
65
5. Create a partial translation at `translations/content/{locale}/{category}/{slug}.yaml` for every non-English locale registered in `html-generators/locales.properties`.
66
66
6. Run `jbang html-generators/generate.java` and verify all localized output builds. Generated site files are ignored and must not be committed. The generator rejects missing, malformed, or duplicate UUIDs as well as missing, empty, malformed, and unregistered tags.
67
-
7. Run `jbang html-generators/generatesocialqueue.java` without `--reshuffle`. Commit the appended`social/queue.txt` entry and `social/tweets.yaml` draft; do not change `social/state.yaml`.
68
-
8. Run `jbang html-generators/validatepatternchanges.java --file content/{category}/{slug}.yaml` and the new proof. The validator enforces translations, proof, navigation, related targets, and social artifacts.
67
+
7. Run `jbang html-generators/generatesocialqueue.java --file content/{category}/{slug}.yaml`. Commit the generated`social/tweets/{category}/{slug}.yaml`; do not change`social/queue.txt` or`social/state.yaml`.
68
+
8. Run `jbang html-generators/validatepatternchanges.java --file content/{category}/{slug}.yaml` and the new proof. The validator enforces translations, proof, navigation order, related targets, and the tweet draft.
69
69
70
70
### Removing or reordering a pattern
71
71
72
-
Update `prev`/`next` in adjacent patterns. Search for the slug in other patterns' `related` arrays and replace with an appropriate alternative.
72
+
Update `navigationOrder` when reordering. Search for a removed slug in other patterns' `related` arrays and replace it with an appropriate alternative.
73
73
74
74
## Internationalization
75
75
76
76
Full spec: `specs/i18n/i18n-spec.md`. Key rules:
77
77
78
78
- All locales (including English) go through the same build pipeline.
79
79
- UI strings: `translations/strings/{locale}.yaml`. Missing keys fall back to English with a build-time warning.
80
-
- Content translations contain **only** translatable fields: `title`, `summary`, `explanation`, `oldApproach`, `modernApproach`, `whyModernWins`, `support.description`. Code, slugs, navigation, and docs are never translated.
80
+
- Content translations contain **only** translatable fields: `title`, `summary`, `explanation`, `oldApproach`, `modernApproach`, `whyModernWins`, `support.description`. Code, slugs, navigation order, and docs are never translated.
81
81
-`oldCode`/`modernCode` in translation files are **always overwritten** with English values at build time to prevent hallucinated code.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,10 @@ Contributions are welcome! Content is managed as YAML files — never edit gener
7
7
1. Fork the repo
8
8
2. Create a new YAML file in the appropriate `content/<category>/` folder (e.g. `content/language/my-feature.yaml`)
9
9
3. Copy [`content/template.json`](content/template.json) as a starting point for all required fields (see the [snippet schema](.github/copilot-instructions.md) for details)
10
-
4. Update the `prev`/`next` fields in adjacent pattern files to maintain navigation
11
-
5. Run `jbang html-generators/generate.java` to verify your changes build correctly
12
-
6. Open a pull request
10
+
4. Set `navigationOrder` to place the pattern in the global sequence. Values are spaced by 1000; duplicate values are allowed and are ordered by pattern key.
11
+
5. Generate its tweet draft with `jbang html-generators/generatesocialqueue.java --file content/<category>/<slug>.yaml`
12
+
6. Run `jbang html-generators/generate.java` to verify your changes build correctly
13
+
7. Open a pull request
13
14
14
15
Please ensure JDK version labels only reference the version where a feature became **final** (non-preview).
15
16
@@ -51,6 +52,6 @@ support:
51
52
description: "Ampliamente disponible desde JDK 10 (marzo 2018)"
52
53
```
53
54
54
-
Do **not** include `id`, `slug`, `category`, `difficulty`, `jdkVersion`, `oldCode`, `modernCode`, `prev`, `next`, `related`, or `docs` — these are always taken from the English source.
55
+
Do **not** include `id`, `slug`, `category`, `navigationOrder`, `difficulty`, `jdkVersion`, `oldCode`, `modernCode`, `related`, or `docs` — these are always taken from the English source.
55
56
56
57
**Important:** If your text contains colons (`:`), ensure the value is properly quoted in YAML to avoid parse errors. Always validate with `jbang html-generators/generate.java` before submitting.
0 commit comments