releasehx 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +366 -331
  3. data/build/docs/_config.yml +18 -1
  4. data/build/docs/_release_index.adoc +10 -0
  5. data/build/docs/config-reference.adoc +203 -16
  6. data/build/docs/config-reference.json +60 -10
  7. data/build/docs/index.adoc +316 -59
  8. data/build/docs/landing.adoc +11 -4
  9. data/build/docs/manpage.adoc +2 -2
  10. data/build/docs/release-procedure.adoc +365 -0
  11. data/build/docs/release-procedure.html +87 -0
  12. data/build/docs/releasehx.1 +17 -5
  13. data/build/docs/releases.adoc +28 -0
  14. data/build/docs/sample-config.adoc +2 -0
  15. data/build/docs/sample-config.yml +16 -9
  16. data/lib/releasehx/cli.rb +21 -9
  17. data/lib/releasehx/configuration.rb +0 -1
  18. data/lib/releasehx/generated.rb +1 -1
  19. data/lib/releasehx/mcp/assets/agent-config-guide.md +1 -1
  20. data/lib/releasehx/mcp/assets/config-def.yml +126 -8
  21. data/lib/releasehx/mcp/assets/config-reference.adoc +203 -16
  22. data/lib/releasehx/mcp/assets/config-reference.json +60 -10
  23. data/lib/releasehx/mcp/assets/sample-config.yml +16 -9
  24. data/lib/releasehx/mcp/server.rb +0 -1
  25. data/lib/releasehx/ops/enrich_ops.rb +161 -55
  26. data/lib/releasehx/ops/template_ops.rb +1 -1
  27. data/lib/releasehx/rhyml/adapter.rb +13 -9
  28. data/lib/releasehx/rhyml/mappings/github.yaml +3 -1
  29. data/lib/releasehx/rhyml/templates/bootstrap-overrides.css +15 -0
  30. data/lib/releasehx/rhyml/templates/changelog.adoc.liquid +2 -0
  31. data/lib/releasehx/rhyml/templates/changelog.html.liquid +6 -4
  32. data/lib/releasehx/rhyml/templates/changelog.md.liquid +1 -0
  33. data/lib/releasehx/rhyml/templates/embedded.css.liquid +263 -0
  34. data/lib/releasehx/rhyml/templates/entry.adoc.liquid +4 -7
  35. data/lib/releasehx/rhyml/templates/entry.html.liquid +21 -20
  36. data/lib/releasehx/rhyml/templates/entry.md.liquid +14 -21
  37. data/lib/releasehx/rhyml/templates/head-parser.liquid +6 -2
  38. data/lib/releasehx/rhyml/templates/header.liquid +13 -4
  39. data/lib/releasehx/rhyml/templates/history.html.liquid +152 -33
  40. data/lib/releasehx/rhyml/templates/metadata-entry.adoc.liquid +83 -49
  41. data/lib/releasehx/rhyml/templates/metadata-entry.html.liquid +60 -1
  42. data/lib/releasehx/rhyml/templates/metadata-entry.md.liquid +65 -113
  43. data/lib/releasehx/rhyml/templates/metadata-note.adoc.liquid +83 -49
  44. data/lib/releasehx/rhyml/templates/metadata-note.html.liquid +59 -22
  45. data/lib/releasehx/rhyml/templates/metadata-note.md.liquid +68 -23
  46. data/lib/releasehx/rhyml/templates/note.adoc.liquid +2 -40
  47. data/lib/releasehx/rhyml/templates/note.html.liquid +25 -19
  48. data/lib/releasehx/rhyml/templates/note.md.liquid +43 -29
  49. data/lib/releasehx/rhyml/templates/parts-listing.liquid +6 -6
  50. data/lib/releasehx/rhyml/templates/release-notes.adoc.liquid +2 -0
  51. data/lib/releasehx/rhyml/templates/release-notes.html.liquid +6 -4
  52. data/lib/releasehx/rhyml/templates/release-notes.md.liquid +1 -0
  53. data/lib/releasehx/rhyml/templates/release.adoc.liquid +2 -0
  54. data/lib/releasehx/rhyml/templates/release.md.liquid +8 -7
  55. data/lib/releasehx/rhyml/templates/rhyml-change.yaml.liquid +36 -35
  56. data/lib/releasehx/rhyml/templates/wrapper.html.liquid +103 -0
  57. data/lib/releasehx/sgyml/helpers.rb +0 -2
  58. data/lib/releasehx/transforms/adf_to_markdown.rb +1 -1
  59. data/lib/releasehx/version.rb +0 -2
  60. data/lib/releasehx.rb +2 -2
  61. data/specs/data/config-def.yml +126 -8
  62. metadata +50 -26
  63. data/build/docs/Gemfile.lock +0 -95
  64. data/build/docs/schemagraphy_readme.html +0 -0
  65. data/build/docs/sourcerer_readme.html +0 -46
  66. data/lib/schemagraphy/attribute_resolver.rb +0 -48
  67. data/lib/schemagraphy/cfgyml/definition.rb +0 -90
  68. data/lib/schemagraphy/cfgyml/doc_builder.rb +0 -52
  69. data/lib/schemagraphy/cfgyml/path_reference.rb +0 -24
  70. data/lib/schemagraphy/data_query/json_pointer.rb +0 -42
  71. data/lib/schemagraphy/loader.rb +0 -59
  72. data/lib/schemagraphy/regexp_utils.rb +0 -215
  73. data/lib/schemagraphy/safe_expression.rb +0 -189
  74. data/lib/schemagraphy/schema_utils.rb +0 -124
  75. data/lib/schemagraphy/tag_utils.rb +0 -32
  76. data/lib/schemagraphy/templating.rb +0 -104
  77. data/lib/schemagraphy.rb +0 -17
  78. data/lib/sourcerer/builder.rb +0 -120
  79. data/lib/sourcerer/jekyll/bootstrapper.rb +0 -78
  80. data/lib/sourcerer/jekyll/liquid/file_system.rb +0 -74
  81. data/lib/sourcerer/jekyll/liquid/filters.rb +0 -215
  82. data/lib/sourcerer/jekyll/liquid/tags.rb +0 -44
  83. data/lib/sourcerer/jekyll/monkeypatches.rb +0 -73
  84. data/lib/sourcerer/jekyll.rb +0 -26
  85. data/lib/sourcerer/plaintext_converter.rb +0 -75
  86. data/lib/sourcerer/templating.rb +0 -190
  87. data/lib/sourcerer.rb +0 -322
data/README.adoc CHANGED
@@ -1,27 +1,60 @@
1
1
  :page-layout: default
2
- :page-permalink: /docs
2
+ :page-permalink: /docs/
3
+ :page-title: ReleaseHx Docs
4
+ :page-permalink: /docs/
5
+ :page-title: ReleaseHx Docs
3
6
  :page-nav_order: 1
4
- [[releasehx]]
5
7
  = ReleaseHx
6
8
  // tag::ai-prompt[]
7
9
  // Collects AsciiDoc content for presenting to a generative AI prompt
8
10
  // Other AI-only prompt matter could go here
9
- // tag::globals[]
10
- :docopslab_git_www: https://github.com/DocOps
11
- :this_prod_slug: releasehx
12
- :releasehx_prod_repo: {docopslab_git_www}/{this_prod_slug}
13
- :releasehx_demo_repo: {docopslab_git_www}/releasehx-demo
14
- :this_prod_repo: {releasehx_prod_repo}
11
+ // tag::global-settings[]
12
+ :this_proj_slug: releasehx
13
+ :this_proj_name: ReleaseHx
14
+ // tag::universal-settings[]
15
+ :docopslab_src_www_url: https://github.com/DocOps
16
+ :docopslab_domain: docopslab.org
17
+ :docopslab_www_url: https://{docopslab_domain}
18
+ :docopslab_io_www_url: https://docopslab.github.io
19
+ :docopslab_ruby_version: 3.2.7
20
+ :docopslab_src_www_url: https://raw.githubusercontent.com/DocOps
21
+ :docopslab_git_src_uri: git@github.com:DocOps
22
+ :this_proj_src_www_url: {docopslab_src_www_url}/{this_proj_slug}
23
+ :this_proj_src_raw_url: https://raw.githubusercontent.com/DocOps/{this_proj_slug}/main
24
+ :this_proj_src_main_files_url: {this_proj_src_www_url}/blob/main
25
+ :this_proj_src_main_edit_url: {this_proj_src_www_url}/edit/main
26
+ :this_proj_src_git_uri: {docopslab_git_src_uri}/{this_proj_slug}.git
27
+ :this_proj_ruby_version: {docopslab_ruby_version}
28
+ // tag::env-settings[]
29
+ :extn:
30
+ ifdef::env-github[]
31
+ :extn: .adoc
32
+ :icons: font
33
+ :caution-caption: :fire:
34
+ :important-caption: :exclamation:
35
+ :note-caption: :paperclip:
36
+ :tip-caption: :bulb:
37
+ :warning-caption: :warning:
38
+ endif::[]
39
+ // end::env-settings[]
40
+ // end::universal-settings[]
41
+ :releasehx_demo_repo: {docopslab_src_www_url}/releasehx-demo
42
+ // tag::product-settings[]
43
+ :this_prod_slug: {this_proj_slug}
44
+ // tag::version-settings[]
15
45
  :this_prod_vrsn_major: 0
16
- :this_prod_vrsn_minor: 1
17
- :this_prod_vrsn_major-minor: {this_prod_vrsn_major}.{this_prod_vrsn_minor}
18
- :this_prod_vrsn_patch: 1
19
- :this_prod_vrsn: {this_prod_vrsn_major-minor}.{this_prod_vrsn_patch}
20
- :next_prod_vrsn: 0.2.0
46
+ :this_prod_vrsn_minor: 2
47
+ :this_prod_vrsn_majmin: {this_prod_vrsn_major}.{this_prod_vrsn_minor}
48
+ :this_prod_vrsn_patch: 0
49
+ :this_prod_vrsn: {this_prod_vrsn_majmin}.{this_prod_vrsn_patch}
50
+ :next_prod_vrsn: 0.3.0
51
+ :next_prod_vrsn_majmin: 0.3
52
+ // end::version-settings[]
21
53
  :tagline: Generate formatted release histories from Jira, GitHub, GitLab, YAML, or JSON sources.
22
54
  :description: pass:q[CLI utility and Ruby API for generating structured release notes and changelog documents from various issue-tracking platforms or YAML definitions into plaintext drafts (*AsciiDoc*, *Markdown*, *YAML*) and rich-text output (*HTML* and *PDF*).]
23
55
  :gem_config_definition_path: ./specs/data/config-def.yml
24
56
  :app_default_config_path: ./.releasehx.yml
57
+ :docker_run_command: docker run -it --rm --user $(id -u):$(id -g) -v $(pwd):/workdir docopslab/{this_prod_slug} rhx
25
58
  // Default configuration values - single source of truth for config-def.yml
26
59
  :default_markup: markdown
27
60
  :default_slug_type: kebab
@@ -45,19 +78,10 @@
45
78
  :draft_source_extensions: {markdown_extensions}, {asciidoc_extensions}, {yaml_extensions}
46
79
  :enrich_file_types: HTML, PDF
47
80
  :enrich_extensions: .html, .pdf
48
- :docker_base_command: docker run -it --rm --user $(id -u):$(id -g) -v $(pwd):/workdir docopslab/releasehx rhx
49
- :this_prod_repo_branch: {this_prod_repo}/tree/release/{this_prod_vrsn_major-minor}
50
- ifdef::env-github[]
51
- :docs_extn: .adoc
52
- :releasehx_www: https://releasehx.docopslab.org
53
- :releasehx_docs_www: {releasehx_www}/docs
54
- :default-config_www: {releasehx_docs_www}/sample-config.html
55
- :this_prod_docs_www: {releasehx_docs_www}
56
- endif::[]
57
- ifndef::env-github[]
58
- :docs_extn:
59
- endif::[]
60
- // end::globals[]
81
+ // end::product-settings[]
82
+ :asciisourcerer_www_url: {docopslab_src_www_url}/asciisourcerer
83
+ :schemagraphy_www_url: {docopslab_src_www_url}/schemagraphy
84
+ // end::global-settings[]
61
85
  :toc: macro
62
86
  :toclevels: 3
63
87
 
@@ -209,7 +233,7 @@ With Docker installed and running...
209
233
  . Run the `rhx` command.
210
234
  +
211
235
  [.prompt,subs=+attributes]
212
- {docker_base_command}
236
+ {docker_run_command}
213
237
  +
214
238
  This mounts your local directory to be writeable by the Docker container.
215
239
  Everything after `rhx` accepts the standard <<rhx,arguments and options>> of the ReleaseHx utility.
@@ -219,7 +243,7 @@ Everything after `rhx` accepts the standard <<rhx,arguments and options>> of the
219
243
  Optionally alias the base Docker command.
220
244
 
221
245
  [.prompt,subs=+attributes]
222
- alias rhx='{docker_base_command}'
246
+ alias rhx='{docker_run_command}'
223
247
  ====
224
248
 
225
249
  Try the <<demo-setup,demo configs and data>> to get a feel for how ReleaseHx works.
@@ -265,6 +289,7 @@ It does not provide assistance for command-line actions or other configurations
265
289
  For your LLM client (such as Copilot, Claude Code, Codex, Cursor, etc) to interact with this service, it must be configured using a general MCP syntax.
266
290
  This data is usually added to a `mcp.json` file or another object.
267
291
 
292
+ // 1. This block is totally fine
268
293
  Generic MCP config (global gem install)::
269
294
  [source,json]
270
295
  ----
@@ -277,12 +302,12 @@ Generic MCP config (global gem install)::
277
302
  }
278
303
  ----
279
304
 
305
+ // 2. This block looks totally fine
280
306
  Generic MCP config (Docker)::
281
307
  +
282
- --
283
308
  Use the Docker image for maximum compatibility across environments.
284
- This is the **recommended approach** for most users.
285
-
309
+ This is the *recommended approach* for most users.
310
+ +
286
311
  [source,json]
287
312
  ----
288
313
  {
@@ -294,13 +319,11 @@ This is the **recommended approach** for most users.
294
319
  }
295
320
  }
296
321
  ----
297
- --
298
322
 
323
+ // 3. The first line on this block is white instead of blue like a DL term designator should be
299
324
  VS Code MCP configuration (Docker)::
300
- +
301
- --
302
325
  Create or update `~/.config/Code/User/mcp.json` (Linux/Mac) or `%APPDATA%\Code\User\mcp.json` (Windows).
303
-
326
+ +
304
327
  [source,json]
305
328
  ----
306
329
  {
@@ -312,13 +335,11 @@ Create or update `~/.config/Code/User/mcp.json` (Linux/Mac) or `%APPDATA%\Code\U
312
335
  }
313
336
  }
314
337
  ----
315
- --
316
338
 
339
+ // 4.This and all the following blocks are improperly highlighted
317
340
  VS Code MCP configuration (global gem install)::
318
- +
319
- --
320
341
  If you have ReleaseHx installed globally (`gem install releasehx`), you can use this simpler configuration:
321
-
342
+ +
322
343
  [source,json]
323
344
  ----
324
345
  {
@@ -329,7 +350,6 @@ If you have ReleaseHx installed globally (`gem install releasehx`), you can use
329
350
  }
330
351
  }
331
352
  ----
332
- --
333
353
 
334
354
  Local repo MCP config (Bundler + cwd)::
335
355
  [source,json]
@@ -410,9 +430,11 @@ Global gem::
410
430
 
411
431
  If your MCP server isn't working in VS Code or Copilot:
412
432
 
413
- . **Verify Docker image exists**: Run `docker images | grep releasehx` to confirm the image is available.
433
+ . *Verify Docker image exists.*
434
+ Run `docker images | grep releasehx` to confirm the image is available.
414
435
 
415
- . **Test MCP server manually**: Run the following to verify the server responds:
436
+ . *Test MCP server manually.*
437
+ Run the following to verify the server responds:
416
438
  +
417
439
  [.prompt]
418
440
  ----
@@ -421,11 +443,14 @@ echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":
421
443
  +
422
444
  You should see a JSON response with `"serverInfo":{"name":"releasehx-mcp"}`
423
445
 
424
- . **Check VS Code MCP config**: Ensure `~/.config/Code/User/mcp.json` exists and uses the correct command format (see examples above).
446
+ . *Check VS Code MCP config.*
447
+ Ensure `~/.config/Code/User/mcp.json` exists and uses the correct command format (see examples above).
425
448
 
426
- . **Restart VS Code**: After changing `mcp.json`, restart VS Code completely for changes to take effect.
449
+ . *Restart VS Code.*
450
+ After changing `mcp.json`, restart VS Code completely for changes to take effect.
427
451
 
428
- . **Check VS Code logs**: Open Output panel (Ctrl+Shift+U) and look for errors related to MCP or the releasehx server.
452
+ *Check VS Code logs.*
453
+ Open Output panel (kbd:[Ctrl+Shift+U]) and look for errors related to MCP or the releasehx server.
429
454
 
430
455
  [TIP]
431
456
  ====
@@ -1140,6 +1165,203 @@ Templates replace their namesakes built into the ReleaseHx application or API.
1140
1165
  By default, ReleaseHx expects templates to be formatted in link:https://shopify.github.io[Liquid], but it uses the Jekyll-enhanced Liquid 4.
1141
1166
  See <<templating>> for details.
1142
1167
 
1168
+ [[styling-customization]]
1169
+ ==== HTML Styling and CSS Integration
1170
+
1171
+ ReleaseHx provides multiple approaches for customizing the appearance of HTML output through the `history.styling` configuration section.
1172
+
1173
+ [[styling-modes]]
1174
+ ===== Styling Modes
1175
+
1176
+ The `history.styling.mode` property controls how CSS is applied to HTML output:
1177
+
1178
+ `framework` (default)::
1179
+ Uses only the configured CSS framework (Bootstrap, etc.) via CDN links.
1180
+ No additional custom CSS is included.
1181
+ Best for standard, professional appearance with minimal configuration.
1182
+
1183
+ `embedded`::
1184
+ Includes comprehensive CSS directly in the HTML `<style>` block.
1185
+ Generates standalone HTML files that display correctly without external dependencies.
1186
+ Automatically includes framework CSS plus custom theming.
1187
+ Best for distribution and email-friendly HTML.
1188
+
1189
+ `external`::
1190
+ References an external stylesheet via `<link>` tag.
1191
+ Requires `history.styling.css_url` to specify the stylesheet location.
1192
+ Framework CSS is disabled when using external stylesheets.
1193
+ Best for custom branding and when CSS needs to be shared across multiple pages.
1194
+
1195
+ `minimal`::
1196
+ Provides basic semantic styling with minimal inline CSS.
1197
+ No framework dependencies or complex styling.
1198
+ Best for simple, lightweight output or when CSS will be applied by a static site generator.
1199
+
1200
+ [[theme-variants]]
1201
+ ===== Theme Variants
1202
+
1203
+ When using `embedded` or `framework` modes, the `history.styling.theme` property controls spacing and typography:
1204
+
1205
+ `default`::
1206
+ Balanced spacing and typography for general use.
1207
+
1208
+ `compact`::
1209
+ Reduced spacing and condensed layout for information-dense displays.
1210
+ Ideal for internal documentation or when screen space is limited.
1211
+
1212
+ `detailed`::
1213
+ Expanded spacing and enhanced typography for presentation contexts.
1214
+ Includes larger headings and more prominent metadata display.
1215
+
1216
+ [[configuration-examples]]
1217
+ ===== Configuration Examples
1218
+
1219
+ .Framework Mode with Default Theme
1220
+ [source,yaml]
1221
+ ----
1222
+ history:
1223
+ html_framework: bootstrap5
1224
+ styling:
1225
+ mode: framework
1226
+ theme: default
1227
+ ----
1228
+
1229
+ .Embedded CSS with Compact Theme
1230
+ [source,yaml]
1231
+ ----
1232
+ history:
1233
+ html_framework: bootstrap5
1234
+ styling:
1235
+ mode: embedded
1236
+ theme: compact
1237
+ embed_css: true
1238
+ ----
1239
+
1240
+ .External Stylesheet
1241
+ [source,yaml]
1242
+ ----
1243
+ history:
1244
+ styling:
1245
+ mode: external
1246
+ css_url: "assets/custom-releasehx.css"
1247
+ ----
1248
+
1249
+ .Minimal Styling
1250
+ [source,yaml]
1251
+ ----
1252
+ history:
1253
+ styling:
1254
+ mode: minimal
1255
+ ----
1256
+
1257
+ [[custom-css-development]]
1258
+ ===== Custom CSS Development
1259
+
1260
+ When using `external` mode, create a CSS file that targets ReleaseHx's semantic HTML structure:
1261
+
1262
+ .Key CSS Classes and Elements
1263
+ [source,css]
1264
+ ----
1265
+ /* Main containers */
1266
+ .release-history { /* Overall wrapper */ }
1267
+ .release-section { /* Individual release container */ }
1268
+
1269
+ /* Content sections */
1270
+ .changelog-section { /* Changelog entries container */ }
1271
+ .notes-section { /* Release notes container */ }
1272
+
1273
+ /* Individual items */
1274
+ .release-note { /* Individual release note */ }
1275
+ .change-entry { /* Individual changelog entry */ }
1276
+
1277
+ /* Components */
1278
+ .card-header, .card-body, .card-footer { /* Note structure */ }
1279
+ .change-metadata { /* Metadata display container */ }
1280
+ .badge { /* Type/status badges */ }
1281
+ ----
1282
+
1283
+ For a complete example, see the `releasehx-custom.css` file in the https://github.com/DocOps/releasehx-demo[releasehx-demo repository].
1284
+
1285
+ [[css-variables]]
1286
+ ===== CSS Variables for Easy Customization
1287
+
1288
+ ReleaseHx's embedded CSS uses CSS custom properties for easy theming:
1289
+
1290
+ [source,css]
1291
+ ----
1292
+ :root {
1293
+ --release-spacing: 3rem; /* Space between releases */
1294
+ --section-spacing: 2.5rem; /* Space between sections */
1295
+ --item-spacing: 1rem; /* Space between items */
1296
+ --primary-color: #0d6efd; /* Brand primary color */
1297
+ --success-color: #198754; /* Success/changelog color */
1298
+ --info-color: #0dcaf0; /* Info/notes color */
1299
+ }
1300
+ ----
1301
+
1302
+ Override these variables in your external CSS to customize the appearance without rewriting the entire stylesheet.
1303
+
1304
+ [[dark-theme]]
1305
+ ===== Dark Theme Support
1306
+
1307
+ ReleaseHx's embedded CSS includes comprehensive dark theme support that automatically adapts to user preferences:
1308
+
1309
+ Automatic detection::
1310
+ When using `framework: bootstrap5` mode, ReleaseHx includes a detection script that automatically applies dark theme based on system preferences.
1311
+ The script listens for system theme changes and updates the display in real-time.
1312
+
1313
+ CSS custom properties::
1314
+ Dark theme colors are defined using CSS custom properties within a `@media (prefers-color-scheme: dark)` query.
1315
+ All color values automatically invert for dark mode while maintaining proper contrast ratios.
1316
+
1317
+ Manual override::
1318
+ Users can manually toggle dark mode using the `.dark-theme` class on the `<html>` element.
1319
+ This overrides system preferences for explicit theme control.
1320
+
1321
+ .Dark Theme Configuration Example
1322
+ [source,yaml]
1323
+ ----
1324
+ history:
1325
+ html_framework: bootstrap5
1326
+ styling:
1327
+ mode: embedded
1328
+ theme: default
1329
+ ----
1330
+
1331
+ When rendered, the HTML will include:
1332
+
1333
+ * Bootstrap 5 with `data-bs-theme` attribute management
1334
+ * CSS custom properties for both light and dark color schemes
1335
+ * JavaScript to detect and respond to system preference changes
1336
+ * Manual theme toggle capability (if you add UI controls)
1337
+
1338
+ .Dark Theme CSS Variables
1339
+ [source,css]
1340
+ ----
1341
+ @media (prefers-color-scheme: dark) {
1342
+ :root {
1343
+ --bg-color: #1a1a1a;
1344
+ --text-color: #e0e0e0;
1345
+ --border-color: #444;
1346
+ --card-bg: #2d2d2d;
1347
+ --note-bg: #252525;
1348
+ /* Additional dark theme variables */
1349
+ }
1350
+ }
1351
+ ----
1352
+
1353
+ For examples of dark theme in action, see the demo configurations in the {releasehx_demo_repo}[releasehx-demo repository], particularly `github-dark-mode.yml` and `github-bootstrap-dark.yml`.
1354
+
1355
+ [[html-wrapper-control]]
1356
+ ===== HTML Wrapper Control
1357
+
1358
+ To enable HTML wrapper with CSS, use either:
1359
+
1360
+ * Configuration: `modes.html_wrap: true`
1361
+ * CLI flag: `--wrap`
1362
+
1363
+ The wrapper includes proper HTML document structure, meta tags, and CSS framework loading.
1364
+
1143
1365
  [[sourcing-strategy]]
1144
1366
  === Sourcing Strategy
1145
1367
 
@@ -1581,7 +1803,7 @@ Writes to `<output_path>/<file_template>` or `<PATH>`.
1581
1803
  *--wrap, --no-wrap*::
1582
1804
  {cli_option_message_wrap}.
1583
1805
  When enriching to HTML, _include_ (`--wrap`) or _exclude_ (`--no-wrap`) the `<head>` and `<body>` tags and their content.
1584
- For use when the opposite value is set in the config file ([.ppty]*<<conf_ppty_modes_wrapped>>*).
1806
+ For use when the opposite value is set in the config file ([.ppty]*<<conf_ppty_modes_html_wrap>>*).
1585
1807
 
1586
1808
  *--quiet*::
1587
1809
  {cli_option_message_quiet}.
@@ -1723,7 +1945,7 @@ Each item must have a `user` property that matches a username in the Issues syst
1723
1945
  These pertain the to the main configuration file, which is defined specifically for your _application_ of ReleaseHx.
1724
1946
  By default, the application config is found at `{app_default_config_path}.`
1725
1947
 
1726
- The full configuration reference is published at link:{releasehx_docs_www}/config-reference{docs_extn}[].
1948
+ The full configuration reference is published at link:{releasehx_docs_www}/config-reference{extn}[].
1727
1949
 
1728
1950
  [[sample-config]]
1729
1951
  === Sample Application Configurations
@@ -1762,7 +1984,7 @@ If you add a non-standard API, please consider <<contributing,contributing it>>
1762
1984
 
1763
1985
  ReleaseHx connects to all upstream REST APIs via YAML-based client configurations.
1764
1986
 
1765
- For reference, the official configs for the three supported REST APIs are at link:{this_prod_repo}/blob/lib/releasehx/rest/clients/jira.yml[jira.yml], link:{this_prod_repo}/blob/lib/releasehx/rest/clients/github.yml[github.yml], and link:{this_prod_repo}/blob/lib/releasehx/rest/clients/gitlab.yml[gitlab.yml].
1987
+ For reference, the official configs for the three supported REST APIs are at link:{this_proj_src_www_url}/blob/lib/releasehx/rest/clients/jira.yml[jira.yml], link:{this_proj_src_www_url}/blob/lib/releasehx/rest/clients/github.yml[github.yml], and link:{this_proj_src_www_url}/blob/lib/releasehx/rest/clients/gitlab.yml[gitlab.yml].
1766
1988
 
1767
1989
  To override any of these or to add your own, place a file at `.releasehx/rest/clients/<hostslug>.yml`.
1768
1990
  Make sure it conforms to the schema defined in `specs/data/api-client-schema.yaml`.
@@ -1851,9 +2073,9 @@ Most configuration of output (for drafting or enriching), is handled in the main
1851
2073
 
1852
2074
  For reference, the official mapping configs for the three supported REST APIs are at:
1853
2075
 
1854
- * link:{this_prod_repo}/blob/lib/releasehx/rest/mappings/jira.yaml[jira.yaml]
1855
- * link:{this_prod_repo}/blob/lib/releasehx/rest/mappings/github.yaml[github.yaml]
1856
- * link:{this_prod_repo}/blob/lib/releasehx/rest/mappings/gitlab.yaml[gitlab.yaml]
2076
+ * link:{this_proj_src_www_url_files_path}/lib/releasehx/rest/mappings/jira.yaml[jira.yaml]
2077
+ * link:{this_proj_src_www_url_files_path}/lib/releasehx/rest/mappings/github.yaml[github.yaml]
2078
+ * link:{this_proj_src_www_url_files_path}/lib/releasehx/rest/mappings/gitlab.yaml[gitlab.yaml]
1857
2079
 
1858
2080
  To override any of these or to add your own, place a file at `.releasehx/rest/mappings/<hostslug>.yml`.
1859
2081
 
@@ -1879,7 +2101,7 @@ The extracted value is available in the `path` local variable.
1879
2101
  ==== Sandboxed Ruby Transformations
1880
2102
 
1881
2103
  The `ruby` key provides a powerful way to perform complex data transformations using a secure, sandboxed Ruby environment.
1882
- This sandbox is powered by the `SchemaGraphy::SafeTransform` class, which ensures that only an explicit allowlist of safe methods and language features can be used.
2104
+ This sandbox is powered by the `SchemaGraphy::SafeTransform` class (from link:{schemagraphy_www_url}[SchemaGraphy gem]), which ensures that only an explicit allowlist of safe methods and language features can be used.
1883
2105
 
1884
2106
  [[sandboxed-ruby-context]]
1885
2107
  ===== Execution Context
@@ -1966,8 +2188,7 @@ For example, if your GitHub issues use labels like:
1966
2188
  Your ReleaseHx application will need an alternate mapping because the default GitHub mapping expects native `issue_type.name` fields.
1967
2189
 
1968
2190
  An example alternate mapping for label-based GitHub type extraction can be found at:
1969
-
1970
- `link:{releasehx_demo_repo}/blob/main/_mappings_/legacy-labels/github.yaml[releasehx-demo/_mappings_/legacy-labels/github.yaml]`
2191
+ link:{releasehx_demo_repo}/blob/main/_mappings_/legacy-labels/github.yaml[`releasehx-demo/_mappings_/legacy-labels/github.yaml`]
1971
2192
 
1972
2193
  This mapping includes Ruby logic to:
1973
2194
 
@@ -2033,9 +2254,8 @@ The custom mappings path can be set using <<conf_ppty_paths_mappings_dir>> setti
2033
2254
 
2034
2255
  ReleaseHx generally uses enhanced *Liquid 4 templates* to generate new files and content from RHYML and configuration data.
2035
2256
 
2036
- Notably, it employs *link:https://jekyllrb.com/docs/liquid/[Jekyll's extended tags and filters]*, as well as some additional tag and several filters provided by Sourcerer.
2037
-
2038
- Here we document the custom filters added by the Sourcerer module and ReleaseHx itself.
2257
+ Notably, it employs *link:https://jekyllrb.com/docs/liquid/[Jekyll's extended tags and filters]*, as well as some additional tag and several filters provided by AsciiSourcerer.
2258
+ Here we document the custom filters added by the link:{asciisourcerer_www_url}[AsciiSourcerer gem] and ReleaseHx itself.
2039
2259
 
2040
2260
  [[advanced-template-configuration]]
2041
2261
  ==== Advanced Template Configuration
@@ -2060,7 +2280,30 @@ The various sample configurations found in the link:{releasehx_demo_repo}/blob/m
2060
2280
 
2061
2281
  A complete link:{default-config_www}[sample config] displays default values and commented descriptions of all available properties.
2062
2282
 
2063
- [[liquid-extensions]]
2283
+ [[template-support]]
2284
+ ==== Template and Theme Support Policy
2285
+
2286
+ The RHYML templates in link:{this_proj_src_www_url_files_path}/lib/releasehx/rhyml/templates/[`lib/releasehx/rhyml/templates/`] are the default templates used for drafting and enriching content.
2287
+
2288
+ Templates filenames formatted like `*.{html,yaml,md,adoc}.liquid` all contain expressive markup intended for output.
2289
+ We will call these files, such as `changelog.adoc.liquid` and `changelog.html.liquid` _expressive templates_.
2290
+
2291
+ All files that are just `<string>.liquid`, such as `changes-sorter.liquid` and `parts-listing.liquid` merely generate data objects and produce express no output to the rendered output.
2292
+ We'll call these _parsing templates_.
2293
+
2294
+ During pre-1.0 releases, changes made to _parsing templates_ will maintain backward compatibility.
2295
+ Deprecations will be announced as early as possible, but we will not change the output of these files except by addition or in the case of a bug, in which case we will change the output to match the documented/expected processing.
2296
+
2297
+ When it comes to _expressive templates_, DocOps Lab intends to make incremental improvements and fine tuning.
2298
+
2299
+ You will always be able to use the templates from a prior version by dropping them into your local custom-templates directory (`_templates/`) by default, but set using {ppty_conf_paths_templates_dir}.
2300
+
2301
+ _After the 1.0 release_, all templates will be kept backward compatible between major releases; so no breaking changes until 2.0, 3.0, etc.
2302
+
2303
+ [NOTE]
2304
+ This is true of the RHYML domain-specific language, as well.
2305
+ We may modify it during pre-1.0 development, but it will be kept backward compatible thereafter.
2306
+
2064
2307
  [[custom-liquid-tags]]
2065
2308
  ==== Custom Liquid Tags
2066
2309
 
@@ -2160,6 +2403,20 @@ Returns a YAML representation of the input for debugging purposes.
2160
2403
  example:::
2161
2404
  `{{ changes | inspect_yaml }}`
2162
2405
 
2406
+ [[jekyll-asciidoc-liquid-filters]]
2407
+ ==== Jekyll/AsciiDoc Liquid Filters
2408
+
2409
+ ReleaseHx supports all link:https://jekyllrb.com/docs/liquid/filters/[filters provided by Jekyll 4.4].
2410
+
2411
+ It also includes all filters provided by the jekyll-asciidoc plugin.
2412
+
2413
+ asciidocify::
2414
+ Uses Asciidoctor API to convert a string of AsciiDoc content to HTML.
2415
+
2416
+ tocify_asciidoc::
2417
+ Generates a table of contents in HTML from the parsed AsciiDoc document of the current page.
2418
+ For use outside the context of a full AsciiDoc document, such as in a sidebar or drop-down ToC.
2419
+
2163
2420
 
2164
2421
  [[troubleshooting]]
2165
2422
  == Troubleshooting
@@ -2231,18 +2488,6 @@ Solution::
2231
2488
  . Review Jekyll's Liquid documentation for supported tags and filters
2232
2489
 
2233
2490
 
2234
- ifdef::site-gen-jekyll[]
2235
- [[apis]]
2236
- == APIs
2237
-
2238
- Documntation for th ReleaseHx, SchemaGraphy, and Sourcerer APIs is available at:
2239
-
2240
- * link:/api/releasehx[ReleaseHx API]
2241
- * link:/api/schemagraphy[SchemaGraphy API]
2242
- * link:/api/sourcerer[Sourcerer API]
2243
-
2244
- endif::[]
2245
-
2246
2491
 
2247
2492
  ifndef::site-gen-jekyll[]
2248
2493
  // tag::releasehx-api[]
@@ -2304,7 +2549,7 @@ To work with ReleaseHx source, clone both repositories side by side for the most
2304
2549
  . Clone both repositories.
2305
2550
  +
2306
2551
  [.prompt]
2307
- git clone {releasehx_prod_repo}
2552
+ git clone {this_proj_src_www_url}
2308
2553
  git clone {releasehx_demo_repo}
2309
2554
  +
2310
2555
  This will give you `<source_dir>/releasehx` and `<source_dir>/releasehx-demo`, side by side.
@@ -2319,9 +2564,9 @@ From the `releasehx` repository:
2319
2564
  [.prompt]
2320
2565
  cd releasehx
2321
2566
  bundle install
2322
- bundle exec rake build
2567
+ bundle exec rake build:gem
2323
2568
  +
2324
- This creates the gem file in the `pkg/` directory.
2569
+ This operation generates untracked dependencies during a _pre-build_ stage and compiles the gem file in the `pkg/` directory.
2325
2570
 
2326
2571
  . Install the locally built gem for testing.
2327
2572
  +
@@ -2336,7 +2581,7 @@ Alternatively, for development testing without installing:
2336
2581
  . Run the test suite to verify functionality.
2337
2582
  +
2338
2583
  [.prompt]
2339
- bundle exec rake spec
2584
+ bundle exec rake rspec
2340
2585
 
2341
2586
  [[working-with-the-demo-repository]]
2342
2587
  ==== Working with the Demo Repository
@@ -2425,7 +2670,7 @@ Additionally, the help screen itself is sourced here in this README and included
2425
2670
  The application help and manpage documentation is also sourced in this way.
2426
2671
  (Use `rhx --help` or `rhx --man` to reveal.)
2427
2672
 
2428
- This capability is provided by the Sourcerer module introduced in this gem but intended to be spun off into it own gem for use in all my (and any of your) Ruby projects in the future.
2673
+ This capability is provided by the link:{asciisourcerer_www_url}[AsciiSourcerer gem].
2429
2674
 
2430
2675
  [[common-dev-tasks]]
2431
2676
  === Common Dev Tasks
@@ -2456,7 +2701,7 @@ To maintain DRY sourcing, make your changes in the following files:
2456
2701
  To build the documentation locally, run the following command from the project root:
2457
2702
 
2458
2703
  [.prompt]
2459
- bundle exec rake docs
2704
+ bundle exec rake build:docs
2460
2705
 
2461
2706
  This will generate the documentation in the `build/docs` directory.
2462
2707
 
@@ -2475,6 +2720,7 @@ Use `PORT=NNNN` environment argument to specify a different port.
2475
2720
  [.prompt]
2476
2721
  PORT=4000 bundle exec rake serve
2477
2722
 
2723
+ [[docopslab-devtool]]
2478
2724
  ==== DocOps Lab Devtool (`docopslab-dev`)
2479
2725
 
2480
2726
  Special dev Rake tasks and libraries are available via the `docopslab-dev` gem.
@@ -2483,7 +2729,7 @@ Special dev Rake tasks and libraries are available via the `docopslab-dev` gem.
2483
2729
  [.prompt]
2484
2730
  bundle exec rake --tasks | grep labdev:
2485
2731
 
2486
- The link:{docopslab_git_www}/lab/tree/main/gems/docopslab-dev/README.adoc[DocOps Lab Devtool] or see `.agent/docs/topics/docpslab-devtool`.
2732
+ The link:{docopslab_src_www_url}/lab/tree/main/gems/docopslab-dev/README.adoc[DocOps Lab Devtool] or see `.agent/docs/topics/docpslab-devtool`.
2487
2733
 
2488
2734
  // tag::releasehx-api[]
2489
2735
  [[issue-data-mapping]]
@@ -2622,71 +2868,54 @@ Dockerfile # Docker image definition
2622
2868
  build/ # Untracked, ephemeral path for generated assets
2623
2869
  docs/ # Documentation build source (Jekyll, YARD)
2624
2870
  .config/ # Config files for various tools
2625
- ├── sourcerer.yml # Sourcerer prebuild manifest
2626
- └── docopslab-dev.yml # DocOpsLab Devtool config
2871
+ ├── sourcerer.yml # Sourcerer prebuild manifest
2872
+ └── docopslab-dev.yml # DocOpsLab Devtool config
2627
2873
  specs/
2628
- ├── data/ # Schema/definition files
2629
- │ ├── config-def.yml # Configuration definition
2630
- │ ├── rhyml-schema.yaml # RHYML schema definition
2631
- │ ├── api-client-schema.yaml # API client schema definition
2632
- │ ├── rhyml-mapping-schema.yaml # API -> RHYML schema definition
2633
- │ └── mcp-manifest.yml # Asset registry for MCP server
2634
- └── tests/
2635
- ├── README.adoc
2636
- ├── rspec/ # RSpec tests
2637
- └── configs/ # Test configs
2874
+ ├── data/ # Schema/definition files
2875
+ │ ├── config-def.yml # Configuration definition
2876
+ │ ├── rhyml-schema.yaml # RHYML schema definition
2877
+ │ ├── api-client-schema.yaml # API client schema definition
2878
+ │ ├── rhyml-mapping-schema.yaml # API -> RHYML schema definition
2879
+ │ └── mcp-manifest.yml # Asset registry for MCP server
2880
+ └── tests/
2881
+ ├── README.adoc
2882
+ ├── rspec/ # RSpec tests
2883
+ └── configs/ # Test configs
2638
2884
  lib/
2639
- ├── releasehx.rb # Application core
2640
- ├── schemagraphy.rb # Special YAML handling
2641
- ├── sourcerer.rb # Single-sourcing tool
2642
2885
  ├── docopslab/
2643
2886
  │ ├── mcp/ # MCP assets and packaging
2644
2887
  │ └── mcp.rb # DocOpsLab MCP entrypoint
2645
- ├── releasehx/
2646
- │ ├── cli.rb # Thor CLI definition
2647
- ├── configuration.rb # CFGYML parsing
2648
- ├── generated.rb # Generated by prebuild (packaged)
2649
- ├── helpers.rb # Utility helpers
2650
- ├── mcp/ # MCP server assets
2651
- ├── mcp.rb # MCP server entrypoint
2652
- ├── README.adoc # Internal developer notes
2653
- ├── rhyml.rb # RHYML entrypoint
2654
- ├── sgyml/ # SGYML helpers
2655
- │ │ └── helpers.rb # module SgymlHelpers
2656
- ├── transforms/ # Input transformations (ADF, etc)
2657
- ├── version.rb # Version constant
2658
- ├── rest/ # module REST
2659
- │ │ ├── yaml_client.rb # ReleaseHx::REST::YamlClient class
2660
- │ └── clients/ # YAML files for API clients (jira.yaml, etc)
2661
- ├── ops/ # Main ReleaseHx methods
2662
- │ │ ├── check_ops.rb # ReleaseHx::CheckOps module
2663
- ├── draft_ops.rb # ReleaseHx::DraftOps module
2664
- ├── enrich_ops.rb # ReleaseHx::EnrichOps module
2665
- ├── template_ops.rb # ReleaseHx::TemplateOps module
2666
- │ └── write_ops.rb # ReleaseHx::WriteOps module
2667
- ├── rhyml/ # module RHYML
2668
- │ │ ├── adapter.rb # maps from JSON using a mapping file
2669
- │ │ ├── change.rb # Change class
2670
- │ │ ├── liquid.rb # Liquid filters for RHYML
2671
- │ │ ├── release.rb # Release class
2672
- │ │ ├── loaders.rb # loads RHYML YAML or JSON from disk
2673
- │ │ ├── mappings/ # API -> RHYML mappings
2674
- │ │ └── templates/ # RHYML output templates
2675
- ├── schemagraphy/
2676
- │ ├── cfgyml/ # CFGYML (OpenCFGY) parsing
2677
- │ ├── attribute_resolver.rb # Resolves {attribute_name} placeholders
2678
- │ ├── loader.rb # `SchemaGraphy::Loader`
2679
- │ ├── regexp_utils.rb # Regular expression utilities
2680
- │ ├── schema_utils.rb # `get_schema_defaults`, etc
2681
- │ ├── tag_utils.rb # `detag`, `tag_of`, etc
2682
- │ ├── templates/ # CFGYML documentation templates
2683
- │ │ └── cfgyml/ # Config reference templates (+ sample gen)
2684
- │ └── templating.rb # Defines handling of parsable YAML nodes
2685
- └── sourcerer/
2686
- ├── builder.rb # Writes snippets to files at build time
2687
- ├── jekyll.rb # Jekyll and Liquid handling for Sourcerer
2688
- ├── plaintext_converter.rb # Pre-processes AsciiDoc source files
2689
- └── templating.rb # Liquid/ERB template handling
2888
+ ├── releasehx.rb # Application core
2889
+ └── releasehx/
2890
+ ├── cli.rb # Thor CLI definition
2891
+ ├── configuration.rb # CFGYML parsing
2892
+ ├── generated.rb # Generated by prebuild (packaged)
2893
+ ├── helpers.rb # Utility helpers
2894
+ ├── mcp/ # MCP server assets
2895
+ ├── mcp.rb # MCP server entrypoint
2896
+ ├── README.adoc # Internal developer notes
2897
+ ├── rhyml.rb # RHYML entrypoint
2898
+ ├── sgyml/ # SGYML helpers
2899
+ └── helpers.rb # module SgymlHelpers
2900
+ ├── transforms/ # Input transformations (ADF, etc)
2901
+ ├── version.rb # Version constant
2902
+ ├── rest/ # module REST
2903
+ ├── yaml_client.rb # ReleaseHx::REST::YamlClient class
2904
+ └── clients/ # YAML files for API clients (jira.yaml, etc)
2905
+ ├── ops/ # Main ReleaseHx methods
2906
+ │ ├── check_ops.rb # ReleaseHx::CheckOps module
2907
+ │ ├── draft_ops.rb # ReleaseHx::DraftOps module
2908
+ │ ├── enrich_ops.rb # ReleaseHx::EnrichOps module
2909
+ ├── template_ops.rb # ReleaseHx::TemplateOps module
2910
+ └── write_ops.rb # ReleaseHx::WriteOps module
2911
+ └── rhyml/ # module RHYML
2912
+ ├── adapter.rb # maps from JSON using a mapping file
2913
+ ├── change.rb # Change class
2914
+ ├── liquid.rb # Liquid filters for RHYML
2915
+ ├── release.rb # Release class
2916
+ ├── loaders.rb # loads RHYML YAML or JSON from disk
2917
+ ├── mappings/ # API -> RHYML mappings
2918
+ └── templates/ # RHYML output templates
2690
2919
  ----
2691
2920
  // end::ai-prompt[]
2692
2921
 
@@ -2700,200 +2929,6 @@ For now it's easier to test inside the one gem that is making immediate use of t
2700
2929
 
2701
2930
  If the MVP pans out (which is uncertain given how weak MCP tech is and how frustrating it was to get it working with various clients), I will upstream it for use in any Ruby projects.
2702
2931
 
2703
- [[sourcerer]]
2704
- === Sourcerer
2705
- // tag::sourcerer[]
2706
- This gem introduces a module called Sourcerer, by which AsciiDoc files can be parsed and their contents harvested for use in the application build.
2707
- The module also handles Liquid template processing with enhanced attribute resolution capabilities.
2708
-
2709
- [NOTE]
2710
- Sourcerer is intended to be spun off as its own gem once it successfully proves the concept in this gem.
2711
- It will probably be called _AsciiSourcerer_ and may replace an older and unmaintained utility of mine called LiquiDoc.
2712
-
2713
- It is invoked in the Rakefile, establishing global namespaces:
2714
-
2715
- * `ReleaseHx::ATTRIBUTES[:globals]` (derived from this `README.adoc` file)
2716
- * `ReleaseHx.read_built_snippet(:<name>)` (such as `:helpscreen`)
2717
-
2718
- The Sourcerer module also generates files like `build/docs/manpage.adoc`, which generates the formatted terminal manual, using content from `build/docs/config-reference.adoc` and this README (`tags="cli_options"`, for instance).
2719
-
2720
- It also generates an AsciiDoc-formatted configuration reference, a machine-readable JSON reference, and a sample config using the `specs/data/config-def.yml` file.
2721
- The Sourcerer system now supports *attribute resolution* from AsciiDoc source files, enabling templates to access README attributes during rendering, ensuring configuration documentation reflects actual default values.
2722
-
2723
- Sourcerer also performs basic testing of select commands in the ASciiDoc file that have been assigned a `testable` role.
2724
-
2725
- This is mostly just showing off what Sourcerer can do, and hopefully setting into habit some best practices for my more complicated apps.
2726
-
2727
- Sourcerer is also where integration with Jekyll's extensions of Liquid occurs, bringing ReleaseHx's templating powers closely in line with how Jekyll's work, as described in <<custom-liquid>>.
2728
- // end::sourcerer[]
2729
-
2730
- [[schemagraphy]]
2731
- === SchemaGraphy
2732
-
2733
- This gem also introduces a module that derives from an unreleased gem I have been working on for some years: SchemaGraphy.
2734
-
2735
- SchemaGraphy is basically an extension of YAML, enabling Ruby developers and end users more broadly to powerfully interpret and schematize YAML-based data.
2736
- Most relevant to our case, as enabled by the `SchemaGraphy` module in this gem, is its handling of *YAML custom tags*, *attribute resolution*, and what I am calling *"`templated fields`"*, where the value of a YAML node is a String that is intended to be further processed by a templating engine like Liquid or ERB, either immediately upon ingest or later in the runtime stack, when it can be mixed with additional data.
2737
-
2738
- SchemaGraphy facilitates handling these and other quirky power-ups we use with our fully valid YAML files, so low-code users can pass some dynamism along in their YAML configs and so forth.
2739
-
2740
- [[attribute-resolution]]
2741
- ==== Attribute Resolution
2742
-
2743
- SchemaGraphy provides *attribute resolution* capabilities through the `AttributeResolver` component.
2744
- This enables YAML files to reference external attributes using placeholder syntax like `{attribute_name}`.
2745
-
2746
- When loading YAML with `.load_yaml_with_attributes(file_path, attributes)`, SchemaGraphy:
2747
-
2748
- . Loads the YAML file normally
2749
- . Searches for `{attribute_name}` patterns in String values
2750
- . Replaces them with corresponding values from the provided attributes Hash
2751
- . Returns the resolved YAML data structure
2752
-
2753
- This is used extensively in ReleaseHx's configuration system to enable single-sourcing of defaults from README attributes.
2754
-
2755
- [[custom-yaml-tag-handling]]
2756
- ==== Custom YAML Tag Handling
2757
-
2758
- To enable end users to pass meta-instructions along with their data, wherever it will make sense to do so, SchemaGraphy offers a straightforward handling system.
2759
-
2760
- Wherever you parse YAML-formatted data using `.load_yaml_with_tags`, custom-tagged Scalar nodes are converted into Maps like so:
2761
-
2762
- .User's YAML
2763
- [source,yaml]
2764
- ----
2765
- some_property: !liquid "{{ some_value }}"
2766
- ----
2767
-
2768
- .Converted data TagMap
2769
- [source,yaml]
2770
- ----
2771
- some_property:
2772
- __tag__: liquid
2773
- value: "{{ some_value }}"
2774
- ----
2775
-
2776
- Developers may therefore conditionally interpret ingested data based on user-defined classifications, wherever the developer supports such things.
2777
-
2778
- Whether a Scalar has been transformed into a TagMap, you can resolve it using:
2779
-
2780
- [source,ruby]
2781
- ----
2782
- SchemaGraphy::TagUtils.detag(some_property)
2783
- # Or, with a local alias
2784
- detag = ->(val) { SchemaGraphy::TagUtils.detag(val) }
2785
- detag(some_property)
2786
- ----
2787
-
2788
- When tags are used this way, to convey a syntax/engine for processing a template or other dynamic content, SchemaGraphy can even help us handle the content in the manner designated by the tag.
2789
- This will come up again in <<templated-fields,the next section>>.
2790
-
2791
- [NOTE]
2792
- This capability is only available on Scalar node values.
2793
- For now, tags applied to other compound node types (Arrays/sequences, Maps/mappings) will be ignored by SchemaGraphy interpreters.
2794
-
2795
- [WARNING]
2796
- When you use `load_yaml_with_tags`, you will encounter errors downstream if a user places a tag on a node where you do not expect it.
2797
-
2798
- [[templated-fields]]
2799
- ==== Templated Property Values in YAML
2800
-
2801
- We are calling these "`templated fields`" to specify that we are talking about enabling end users to use Liquid, ERB, or eventually other templating syntaxes in YAML node values.
2802
-
2803
- In so doing, developer are able to designate that the value of certain YAML nodes should be handled by a templating engine, as well as when and how.
2804
-
2805
- We'll look at how this is done in <<templated-fields-handling>>.
2806
- For now, the point is that sometimes files like `specs/data/config-def.yml` or an API-mapping file call for a little more runtime dynamism than a low-code solution like pure YAML can support.
2807
-
2808
- Therefore, when the value of a user-configurable or environment-deterimined "`setting`" is a string that must be generated from data defined outside that field, we parse and render the template at runtime, using data from the environment or elsewhere.
2809
- For now, it is up to our calling code to provide the appropriate variables to the template depending on the context.
2810
-
2811
- [[config-def]]
2812
- ==== Configuration Definition (CFGYML)
2813
-
2814
- All user-configurable settings have a definition, if not also a default value.
2815
- For single-sourcing purposes, these are defined in a YAML format called CFGYML -- a configuration-file modeling language.
2816
-
2817
- The file is at `{gem_config_definition_path}`.
2818
- It is used to establish the literal default settings carried by the application, and also to document those settings for the user.
2819
-
2820
- This practice lets developers give end users extremely detailed configurations, always well documented.
2821
-
2822
- [[attribute-resolution-in-cfgyml]]
2823
- ===== Attribute Resolution in CFGYML
2824
-
2825
- CFGYML supports *attribute resolution* from AsciiDoc files (like this README) using placeholder syntax.
2826
- Default values can reference README attributes using `{attribute_name}` syntax:
2827
-
2828
- [source,yaml]
2829
- ----
2830
- properties:
2831
- $meta:
2832
- properties:
2833
- markup:
2834
- dflt: "{default_markup}" # Resolved from README.adoc :default_markup: attribute
2835
- ----
2836
-
2837
- This enables single-sourcing of configuration defaults from README attributes, ensuring that documentation and defaults stay synchronized.
2838
-
2839
- [[cfgyml-schema-structure]]
2840
- ===== CFGYML Schema Structure
2841
-
2842
- The basic schema is somewhat straightforward.
2843
- Essentially, you're nesting Map objects within a YAML key `properties`, and each property (setting) of the defined config file can be described and constrained.
2844
-
2845
- Each setting can have a type, description (`desc`), default (`dflt`), and templated-field instructions (`templating`).
2846
- If the setting is itself a of type `Map` (YAML "`mapping`", JSON "`object`"), its own nested parameters can be established with a `properties:` block.
2847
-
2848
- For now, you can designate the type, which you will have to enforce in your code, as well as a default value.
2849
-
2850
- [[sgyml-schemas]]
2851
- ==== SGYML Schemas
2852
-
2853
- Similar to but more complicated than CFGYML definition files are SchemaGraphy schema files.
2854
- This is a partially specified, partially developed, and as-yet-incomplete syntax for designating and constraining YAML documents.
2855
-
2856
- ReleaseHx at this time makes active use of only minimal aspects of these schemas, all of which are contained in the `specs/` directory at the root of the gem source.
2857
-
2858
- Each of the YAML formats used by ReleaseHx has its own schema in the repo.
2859
- The cfgyml-schema.yaml file will eventually be spun off, but the `specs/data/rhyml-schema.yaml` and `specs/data/rhyml-mapping-schema.yaml` files will stay here, defining valid formats for the types of files they apply to.
2860
-
2861
- Since SchemaGraphy itself is still unreleased, CFGYML as introduced in this gem offers only a subset of what it will enable down the road.
2862
-
2863
- Once SchemaGraphy is generally available, this gem will call it as a dependency.
2864
- At that point, a file like `specs/data/config-def.yml` (CFGYML) will be able to impose a more detailed `$schema` for any property.
2865
-
2866
- [[templated-fields-handling]]
2867
- ==== Dynamic Templated-field Handling
2868
-
2869
- The most powerful function of SchemaGraphy schemas that is now available in ReleaseHx is the ability to instruct how templated fields should be processed at different stages, and also to parse and render them as needed.
2870
-
2871
- Templated-field handling can be established between a combination of (1) CFGYML definition files or SGYML schema files and (2) configuration files to be applied at runtime.
2872
-
2873
- Developers can designate a given property to be `type: Template` in a schema or definition.
2874
- This "`typing`" can be a trigger for downstream parsing/rendering of the template.
2875
-
2876
- [NOTE]
2877
- Liquid uses these two stages.
2878
- The _parse_ operation compiles a template into a `Liquid::Template` object.
2879
- The _render_ operation applies a dataset to the loaded template, generating a String with Liquid tags resolved.
2880
-
2881
- [[nyi]]
2882
- ==== Not Yet Implemented
2883
-
2884
- Most aspects of SchemaGraphy/SGYML are not yet available in ReleaseHx, but some are worth pointing out.
2885
-
2886
- data types::
2887
- As of now, the `type` node of any property in `specs/data/config-def.yml` is not particularly functional.
2888
- I do have a whole table of "`data types`" in SGYML, most of which are extremely self-explanatory and drawn from fairly platonic, cross-language terms.
2889
- +
2890
- However, these are entirely unenforced in ReleaseHx -- for now, data still has to be type checked explicitly in the Ruby code, and user configs are not validated against any kind of typing system.
2891
-
2892
- schema docs::
2893
- The schema files do not yet generate complete reference docs for the subject files that they govern.
2894
- So for instance, you'll have to read files like `specs/data/rhyml-schema.yaml` and `specs/data/rhyml-mapping-schema.yaml` directly to understand the format of RHYML files and how they are mapped to REST response payloads.
2895
- // end::schemagraphy[]
2896
-
2897
2932
  [[docs-deployment]]
2898
2933
  === Documentation Deployment
2899
2934