releasehx 0.1.2 → 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.
- checksums.yaml +4 -4
- data/README.adoc +363 -330
- data/build/docs/_config.yml +1 -0
- data/build/docs/_release_index.adoc +3 -2
- data/build/docs/config-reference.adoc +197 -10
- data/build/docs/config-reference.json +56 -7
- data/build/docs/index.adoc +315 -59
- data/build/docs/landing.adoc +1 -1
- data/build/docs/manpage.adoc +2 -2
- data/build/docs/release-procedure.adoc +365 -0
- data/build/docs/release-procedure.html +87 -0
- data/build/docs/releasehx.1 +17 -5
- data/build/docs/sample-config.yml +14 -7
- data/lib/releasehx/cli.rb +5 -2
- data/lib/releasehx/configuration.rb +0 -1
- data/lib/releasehx/generated.rb +1 -1
- data/lib/releasehx/mcp/assets/agent-config-guide.md +1 -1
- data/lib/releasehx/mcp/assets/config-def.yml +122 -6
- data/lib/releasehx/mcp/assets/config-reference.adoc +197 -10
- data/lib/releasehx/mcp/assets/config-reference.json +56 -7
- data/lib/releasehx/mcp/assets/sample-config.yml +14 -7
- data/lib/releasehx/mcp/server.rb +0 -1
- data/lib/releasehx/ops/enrich_ops.rb +161 -55
- data/lib/releasehx/ops/template_ops.rb +1 -1
- data/lib/releasehx/rhyml/adapter.rb +0 -3
- data/lib/releasehx/rhyml/templates/bootstrap-overrides.css +15 -0
- data/lib/releasehx/rhyml/templates/changelog.adoc.liquid +2 -0
- data/lib/releasehx/rhyml/templates/changelog.html.liquid +6 -4
- data/lib/releasehx/rhyml/templates/changelog.md.liquid +1 -0
- data/lib/releasehx/rhyml/templates/embedded.css.liquid +263 -0
- data/lib/releasehx/rhyml/templates/entry.adoc.liquid +1 -0
- data/lib/releasehx/rhyml/templates/entry.html.liquid +21 -20
- data/lib/releasehx/rhyml/templates/entry.md.liquid +15 -21
- data/lib/releasehx/rhyml/templates/head-parser.liquid +6 -2
- data/lib/releasehx/rhyml/templates/header.liquid +13 -4
- data/lib/releasehx/rhyml/templates/history.html.liquid +152 -33
- data/lib/releasehx/rhyml/templates/metadata-entry.adoc.liquid +83 -38
- data/lib/releasehx/rhyml/templates/metadata-entry.html.liquid +60 -1
- data/lib/releasehx/rhyml/templates/metadata-entry.md.liquid +65 -113
- data/lib/releasehx/rhyml/templates/metadata-note.adoc.liquid +83 -38
- data/lib/releasehx/rhyml/templates/metadata-note.html.liquid +59 -22
- data/lib/releasehx/rhyml/templates/metadata-note.md.liquid +68 -23
- data/lib/releasehx/rhyml/templates/note.html.liquid +25 -19
- data/lib/releasehx/rhyml/templates/note.md.liquid +44 -26
- data/lib/releasehx/rhyml/templates/release-notes.adoc.liquid +2 -0
- data/lib/releasehx/rhyml/templates/release-notes.html.liquid +6 -4
- data/lib/releasehx/rhyml/templates/release-notes.md.liquid +1 -0
- data/lib/releasehx/rhyml/templates/release.adoc.liquid +2 -0
- data/lib/releasehx/rhyml/templates/release.md.liquid +8 -7
- data/lib/releasehx/rhyml/templates/rhyml-change.yaml.liquid +36 -36
- data/lib/releasehx/rhyml/templates/wrapper.html.liquid +103 -0
- data/lib/releasehx/sgyml/helpers.rb +0 -2
- data/lib/releasehx/transforms/adf_to_markdown.rb +1 -1
- data/lib/releasehx/version.rb +0 -2
- data/lib/releasehx.rb +2 -2
- data/specs/data/config-def.yml +122 -6
- metadata +48 -25
- data/build/docs/schemagraphy_readme.html +0 -0
- data/build/docs/sourcerer_readme.html +0 -46
- data/lib/schemagraphy/attribute_resolver.rb +0 -48
- data/lib/schemagraphy/cfgyml/definition.rb +0 -90
- data/lib/schemagraphy/cfgyml/doc_builder.rb +0 -52
- data/lib/schemagraphy/cfgyml/path_reference.rb +0 -24
- data/lib/schemagraphy/data_query/json_pointer.rb +0 -42
- data/lib/schemagraphy/loader.rb +0 -59
- data/lib/schemagraphy/regexp_utils.rb +0 -235
- data/lib/schemagraphy/safe_expression.rb +0 -189
- data/lib/schemagraphy/schema_utils.rb +0 -124
- data/lib/schemagraphy/tag_utils.rb +0 -32
- data/lib/schemagraphy/templating.rb +0 -104
- data/lib/schemagraphy.rb +0 -17
- data/lib/sourcerer/builder.rb +0 -120
- data/lib/sourcerer/jekyll/bootstrapper.rb +0 -78
- data/lib/sourcerer/jekyll/liquid/file_system.rb +0 -74
- data/lib/sourcerer/jekyll/liquid/filters.rb +0 -215
- data/lib/sourcerer/jekyll/liquid/tags.rb +0 -44
- data/lib/sourcerer/jekyll/monkeypatches.rb +0 -73
- data/lib/sourcerer/jekyll.rb +0 -26
- data/lib/sourcerer/plaintext_converter.rb +0 -75
- data/lib/sourcerer/templating.rb +0 -190
- data/lib/sourcerer.rb +0 -322
data/README.adoc
CHANGED
|
@@ -1,28 +1,60 @@
|
|
|
1
1
|
:page-layout: default
|
|
2
2
|
:page-permalink: /docs/
|
|
3
3
|
:page-title: ReleaseHx Docs
|
|
4
|
+
:page-permalink: /docs/
|
|
5
|
+
:page-title: ReleaseHx Docs
|
|
4
6
|
:page-nav_order: 1
|
|
5
|
-
[[releasehx]]
|
|
6
7
|
= ReleaseHx
|
|
7
8
|
// tag::ai-prompt[]
|
|
8
9
|
// Collects AsciiDoc content for presenting to a generative AI prompt
|
|
9
10
|
// Other AI-only prompt matter could go here
|
|
10
|
-
// tag::
|
|
11
|
-
:
|
|
12
|
-
:
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
:
|
|
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[]
|
|
16
45
|
:this_prod_vrsn_major: 0
|
|
17
|
-
:this_prod_vrsn_minor:
|
|
18
|
-
:
|
|
19
|
-
:this_prod_vrsn_patch:
|
|
20
|
-
:this_prod_vrsn: {
|
|
21
|
-
:next_prod_vrsn: 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[]
|
|
22
53
|
:tagline: Generate formatted release histories from Jira, GitHub, GitLab, YAML, or JSON sources.
|
|
23
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*).]
|
|
24
55
|
:gem_config_definition_path: ./specs/data/config-def.yml
|
|
25
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
|
|
26
58
|
// Default configuration values - single source of truth for config-def.yml
|
|
27
59
|
:default_markup: markdown
|
|
28
60
|
:default_slug_type: kebab
|
|
@@ -46,19 +78,10 @@
|
|
|
46
78
|
:draft_source_extensions: {markdown_extensions}, {asciidoc_extensions}, {yaml_extensions}
|
|
47
79
|
:enrich_file_types: HTML, PDF
|
|
48
80
|
:enrich_extensions: .html, .pdf
|
|
49
|
-
|
|
50
|
-
:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
:releasehx_www: https://releasehx.docopslab.org
|
|
54
|
-
:releasehx_docs_www: {releasehx_www}/docs
|
|
55
|
-
:default-config_www: {releasehx_docs_www}/sample-config.html
|
|
56
|
-
:this_prod_docs_www: {releasehx_docs_www}
|
|
57
|
-
endif::[]
|
|
58
|
-
ifndef::env-github[]
|
|
59
|
-
:docs_extn:
|
|
60
|
-
endif::[]
|
|
61
|
-
// 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[]
|
|
62
85
|
:toc: macro
|
|
63
86
|
:toclevels: 3
|
|
64
87
|
|
|
@@ -210,7 +233,7 @@ With Docker installed and running...
|
|
|
210
233
|
. Run the `rhx` command.
|
|
211
234
|
+
|
|
212
235
|
[.prompt,subs=+attributes]
|
|
213
|
-
{
|
|
236
|
+
{docker_run_command}
|
|
214
237
|
+
|
|
215
238
|
This mounts your local directory to be writeable by the Docker container.
|
|
216
239
|
Everything after `rhx` accepts the standard <<rhx,arguments and options>> of the ReleaseHx utility.
|
|
@@ -220,7 +243,7 @@ Everything after `rhx` accepts the standard <<rhx,arguments and options>> of the
|
|
|
220
243
|
Optionally alias the base Docker command.
|
|
221
244
|
|
|
222
245
|
[.prompt,subs=+attributes]
|
|
223
|
-
alias rhx='{
|
|
246
|
+
alias rhx='{docker_run_command}'
|
|
224
247
|
====
|
|
225
248
|
|
|
226
249
|
Try the <<demo-setup,demo configs and data>> to get a feel for how ReleaseHx works.
|
|
@@ -266,6 +289,7 @@ It does not provide assistance for command-line actions or other configurations
|
|
|
266
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.
|
|
267
290
|
This data is usually added to a `mcp.json` file or another object.
|
|
268
291
|
|
|
292
|
+
// 1. This block is totally fine
|
|
269
293
|
Generic MCP config (global gem install)::
|
|
270
294
|
[source,json]
|
|
271
295
|
----
|
|
@@ -278,12 +302,12 @@ Generic MCP config (global gem install)::
|
|
|
278
302
|
}
|
|
279
303
|
----
|
|
280
304
|
|
|
305
|
+
// 2. This block looks totally fine
|
|
281
306
|
Generic MCP config (Docker)::
|
|
282
307
|
+
|
|
283
|
-
--
|
|
284
308
|
Use the Docker image for maximum compatibility across environments.
|
|
285
|
-
This is the
|
|
286
|
-
|
|
309
|
+
This is the *recommended approach* for most users.
|
|
310
|
+
+
|
|
287
311
|
[source,json]
|
|
288
312
|
----
|
|
289
313
|
{
|
|
@@ -295,13 +319,11 @@ This is the **recommended approach** for most users.
|
|
|
295
319
|
}
|
|
296
320
|
}
|
|
297
321
|
----
|
|
298
|
-
--
|
|
299
322
|
|
|
323
|
+
// 3. The first line on this block is white instead of blue like a DL term designator should be
|
|
300
324
|
VS Code MCP configuration (Docker)::
|
|
301
|
-
+
|
|
302
|
-
--
|
|
303
325
|
Create or update `~/.config/Code/User/mcp.json` (Linux/Mac) or `%APPDATA%\Code\User\mcp.json` (Windows).
|
|
304
|
-
|
|
326
|
+
+
|
|
305
327
|
[source,json]
|
|
306
328
|
----
|
|
307
329
|
{
|
|
@@ -313,13 +335,11 @@ Create or update `~/.config/Code/User/mcp.json` (Linux/Mac) or `%APPDATA%\Code\U
|
|
|
313
335
|
}
|
|
314
336
|
}
|
|
315
337
|
----
|
|
316
|
-
--
|
|
317
338
|
|
|
339
|
+
// 4.This and all the following blocks are improperly highlighted
|
|
318
340
|
VS Code MCP configuration (global gem install)::
|
|
319
|
-
+
|
|
320
|
-
--
|
|
321
341
|
If you have ReleaseHx installed globally (`gem install releasehx`), you can use this simpler configuration:
|
|
322
|
-
|
|
342
|
+
+
|
|
323
343
|
[source,json]
|
|
324
344
|
----
|
|
325
345
|
{
|
|
@@ -330,7 +350,6 @@ If you have ReleaseHx installed globally (`gem install releasehx`), you can use
|
|
|
330
350
|
}
|
|
331
351
|
}
|
|
332
352
|
----
|
|
333
|
-
--
|
|
334
353
|
|
|
335
354
|
Local repo MCP config (Bundler + cwd)::
|
|
336
355
|
[source,json]
|
|
@@ -411,9 +430,11 @@ Global gem::
|
|
|
411
430
|
|
|
412
431
|
If your MCP server isn't working in VS Code or Copilot:
|
|
413
432
|
|
|
414
|
-
.
|
|
433
|
+
. *Verify Docker image exists.*
|
|
434
|
+
Run `docker images | grep releasehx` to confirm the image is available.
|
|
415
435
|
|
|
416
|
-
.
|
|
436
|
+
. *Test MCP server manually.*
|
|
437
|
+
Run the following to verify the server responds:
|
|
417
438
|
+
|
|
418
439
|
[.prompt]
|
|
419
440
|
----
|
|
@@ -422,11 +443,14 @@ echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":
|
|
|
422
443
|
+
|
|
423
444
|
You should see a JSON response with `"serverInfo":{"name":"releasehx-mcp"}`
|
|
424
445
|
|
|
425
|
-
.
|
|
446
|
+
. *Check VS Code MCP config.*
|
|
447
|
+
Ensure `~/.config/Code/User/mcp.json` exists and uses the correct command format (see examples above).
|
|
426
448
|
|
|
427
|
-
.
|
|
449
|
+
. *Restart VS Code.*
|
|
450
|
+
After changing `mcp.json`, restart VS Code completely for changes to take effect.
|
|
428
451
|
|
|
429
|
-
|
|
452
|
+
*Check VS Code logs.*
|
|
453
|
+
Open Output panel (kbd:[Ctrl+Shift+U]) and look for errors related to MCP or the releasehx server.
|
|
430
454
|
|
|
431
455
|
[TIP]
|
|
432
456
|
====
|
|
@@ -1141,6 +1165,203 @@ Templates replace their namesakes built into the ReleaseHx application or API.
|
|
|
1141
1165
|
By default, ReleaseHx expects templates to be formatted in link:https://shopify.github.io[Liquid], but it uses the Jekyll-enhanced Liquid 4.
|
|
1142
1166
|
See <<templating>> for details.
|
|
1143
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
|
+
|
|
1144
1365
|
[[sourcing-strategy]]
|
|
1145
1366
|
=== Sourcing Strategy
|
|
1146
1367
|
|
|
@@ -1582,7 +1803,7 @@ Writes to `<output_path>/<file_template>` or `<PATH>`.
|
|
|
1582
1803
|
*--wrap, --no-wrap*::
|
|
1583
1804
|
{cli_option_message_wrap}.
|
|
1584
1805
|
When enriching to HTML, _include_ (`--wrap`) or _exclude_ (`--no-wrap`) the `<head>` and `<body>` tags and their content.
|
|
1585
|
-
For use when the opposite value is set in the config file ([.ppty]*<<
|
|
1806
|
+
For use when the opposite value is set in the config file ([.ppty]*<<conf_ppty_modes_html_wrap>>*).
|
|
1586
1807
|
|
|
1587
1808
|
*--quiet*::
|
|
1588
1809
|
{cli_option_message_quiet}.
|
|
@@ -1724,7 +1945,7 @@ Each item must have a `user` property that matches a username in the Issues syst
|
|
|
1724
1945
|
These pertain the to the main configuration file, which is defined specifically for your _application_ of ReleaseHx.
|
|
1725
1946
|
By default, the application config is found at `{app_default_config_path}.`
|
|
1726
1947
|
|
|
1727
|
-
The full configuration reference is published at link:{releasehx_docs_www}/config-reference{
|
|
1948
|
+
The full configuration reference is published at link:{releasehx_docs_www}/config-reference{extn}[].
|
|
1728
1949
|
|
|
1729
1950
|
[[sample-config]]
|
|
1730
1951
|
=== Sample Application Configurations
|
|
@@ -1763,7 +1984,7 @@ If you add a non-standard API, please consider <<contributing,contributing it>>
|
|
|
1763
1984
|
|
|
1764
1985
|
ReleaseHx connects to all upstream REST APIs via YAML-based client configurations.
|
|
1765
1986
|
|
|
1766
|
-
For reference, the official configs for the three supported REST APIs are at link:{
|
|
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].
|
|
1767
1988
|
|
|
1768
1989
|
To override any of these or to add your own, place a file at `.releasehx/rest/clients/<hostslug>.yml`.
|
|
1769
1990
|
Make sure it conforms to the schema defined in `specs/data/api-client-schema.yaml`.
|
|
@@ -1852,9 +2073,9 @@ Most configuration of output (for drafting or enriching), is handled in the main
|
|
|
1852
2073
|
|
|
1853
2074
|
For reference, the official mapping configs for the three supported REST APIs are at:
|
|
1854
2075
|
|
|
1855
|
-
* link:{
|
|
1856
|
-
* link:{
|
|
1857
|
-
* link:{
|
|
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]
|
|
1858
2079
|
|
|
1859
2080
|
To override any of these or to add your own, place a file at `.releasehx/rest/mappings/<hostslug>.yml`.
|
|
1860
2081
|
|
|
@@ -1880,7 +2101,7 @@ The extracted value is available in the `path` local variable.
|
|
|
1880
2101
|
==== Sandboxed Ruby Transformations
|
|
1881
2102
|
|
|
1882
2103
|
The `ruby` key provides a powerful way to perform complex data transformations using a secure, sandboxed Ruby environment.
|
|
1883
|
-
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.
|
|
1884
2105
|
|
|
1885
2106
|
[[sandboxed-ruby-context]]
|
|
1886
2107
|
===== Execution Context
|
|
@@ -1967,8 +2188,7 @@ For example, if your GitHub issues use labels like:
|
|
|
1967
2188
|
Your ReleaseHx application will need an alternate mapping because the default GitHub mapping expects native `issue_type.name` fields.
|
|
1968
2189
|
|
|
1969
2190
|
An example alternate mapping for label-based GitHub type extraction can be found at:
|
|
1970
|
-
|
|
1971
|
-
`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`]
|
|
1972
2192
|
|
|
1973
2193
|
This mapping includes Ruby logic to:
|
|
1974
2194
|
|
|
@@ -2034,9 +2254,8 @@ The custom mappings path can be set using <<conf_ppty_paths_mappings_dir>> setti
|
|
|
2034
2254
|
|
|
2035
2255
|
ReleaseHx generally uses enhanced *Liquid 4 templates* to generate new files and content from RHYML and configuration data.
|
|
2036
2256
|
|
|
2037
|
-
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
|
|
2038
|
-
|
|
2039
|
-
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.
|
|
2040
2259
|
|
|
2041
2260
|
[[advanced-template-configuration]]
|
|
2042
2261
|
==== Advanced Template Configuration
|
|
@@ -2061,7 +2280,30 @@ The various sample configurations found in the link:{releasehx_demo_repo}/blob/m
|
|
|
2061
2280
|
|
|
2062
2281
|
A complete link:{default-config_www}[sample config] displays default values and commented descriptions of all available properties.
|
|
2063
2282
|
|
|
2064
|
-
[[
|
|
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
|
+
|
|
2065
2307
|
[[custom-liquid-tags]]
|
|
2066
2308
|
==== Custom Liquid Tags
|
|
2067
2309
|
|
|
@@ -2161,6 +2403,20 @@ Returns a YAML representation of the input for debugging purposes.
|
|
|
2161
2403
|
example:::
|
|
2162
2404
|
`{{ changes | inspect_yaml }}`
|
|
2163
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
|
+
|
|
2164
2420
|
|
|
2165
2421
|
[[troubleshooting]]
|
|
2166
2422
|
== Troubleshooting
|
|
@@ -2232,18 +2488,6 @@ Solution::
|
|
|
2232
2488
|
. Review Jekyll's Liquid documentation for supported tags and filters
|
|
2233
2489
|
|
|
2234
2490
|
|
|
2235
|
-
ifdef::site-gen-jekyll[]
|
|
2236
|
-
[[apis]]
|
|
2237
|
-
== APIs
|
|
2238
|
-
|
|
2239
|
-
Documntation for th ReleaseHx, SchemaGraphy, and Sourcerer APIs is available at:
|
|
2240
|
-
|
|
2241
|
-
* link:/api/releasehx[ReleaseHx API]
|
|
2242
|
-
* link:/api/schemagraphy[SchemaGraphy API]
|
|
2243
|
-
* link:/api/sourcerer[Sourcerer API]
|
|
2244
|
-
|
|
2245
|
-
endif::[]
|
|
2246
|
-
|
|
2247
2491
|
|
|
2248
2492
|
ifndef::site-gen-jekyll[]
|
|
2249
2493
|
// tag::releasehx-api[]
|
|
@@ -2305,7 +2549,7 @@ To work with ReleaseHx source, clone both repositories side by side for the most
|
|
|
2305
2549
|
. Clone both repositories.
|
|
2306
2550
|
+
|
|
2307
2551
|
[.prompt]
|
|
2308
|
-
git clone {
|
|
2552
|
+
git clone {this_proj_src_www_url}
|
|
2309
2553
|
git clone {releasehx_demo_repo}
|
|
2310
2554
|
+
|
|
2311
2555
|
This will give you `<source_dir>/releasehx` and `<source_dir>/releasehx-demo`, side by side.
|
|
@@ -2320,9 +2564,9 @@ From the `releasehx` repository:
|
|
|
2320
2564
|
[.prompt]
|
|
2321
2565
|
cd releasehx
|
|
2322
2566
|
bundle install
|
|
2323
|
-
bundle exec rake build
|
|
2567
|
+
bundle exec rake build:gem
|
|
2324
2568
|
+
|
|
2325
|
-
This
|
|
2569
|
+
This operation generates untracked dependencies during a _pre-build_ stage and compiles the gem file in the `pkg/` directory.
|
|
2326
2570
|
|
|
2327
2571
|
. Install the locally built gem for testing.
|
|
2328
2572
|
+
|
|
@@ -2337,7 +2581,7 @@ Alternatively, for development testing without installing:
|
|
|
2337
2581
|
. Run the test suite to verify functionality.
|
|
2338
2582
|
+
|
|
2339
2583
|
[.prompt]
|
|
2340
|
-
bundle exec rake
|
|
2584
|
+
bundle exec rake rspec
|
|
2341
2585
|
|
|
2342
2586
|
[[working-with-the-demo-repository]]
|
|
2343
2587
|
==== Working with the Demo Repository
|
|
@@ -2426,7 +2670,7 @@ Additionally, the help screen itself is sourced here in this README and included
|
|
|
2426
2670
|
The application help and manpage documentation is also sourced in this way.
|
|
2427
2671
|
(Use `rhx --help` or `rhx --man` to reveal.)
|
|
2428
2672
|
|
|
2429
|
-
This capability is provided by the
|
|
2673
|
+
This capability is provided by the link:{asciisourcerer_www_url}[AsciiSourcerer gem].
|
|
2430
2674
|
|
|
2431
2675
|
[[common-dev-tasks]]
|
|
2432
2676
|
=== Common Dev Tasks
|
|
@@ -2457,7 +2701,7 @@ To maintain DRY sourcing, make your changes in the following files:
|
|
|
2457
2701
|
To build the documentation locally, run the following command from the project root:
|
|
2458
2702
|
|
|
2459
2703
|
[.prompt]
|
|
2460
|
-
bundle exec rake docs
|
|
2704
|
+
bundle exec rake build:docs
|
|
2461
2705
|
|
|
2462
2706
|
This will generate the documentation in the `build/docs` directory.
|
|
2463
2707
|
|
|
@@ -2485,7 +2729,7 @@ Special dev Rake tasks and libraries are available via the `docopslab-dev` gem.
|
|
|
2485
2729
|
[.prompt]
|
|
2486
2730
|
bundle exec rake --tasks | grep labdev:
|
|
2487
2731
|
|
|
2488
|
-
The link:{
|
|
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`.
|
|
2489
2733
|
|
|
2490
2734
|
// tag::releasehx-api[]
|
|
2491
2735
|
[[issue-data-mapping]]
|
|
@@ -2624,71 +2868,54 @@ Dockerfile # Docker image definition
|
|
|
2624
2868
|
build/ # Untracked, ephemeral path for generated assets
|
|
2625
2869
|
docs/ # Documentation build source (Jekyll, YARD)
|
|
2626
2870
|
.config/ # Config files for various tools
|
|
2627
|
-
├── sourcerer.yml
|
|
2628
|
-
└── docopslab-dev.yml
|
|
2871
|
+
├── sourcerer.yml # Sourcerer prebuild manifest
|
|
2872
|
+
└── docopslab-dev.yml # DocOpsLab Devtool config
|
|
2629
2873
|
specs/
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
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
|
|
2640
2884
|
lib/
|
|
2641
|
-
├── releasehx.rb # Application core
|
|
2642
|
-
├── schemagraphy.rb # Special YAML handling
|
|
2643
|
-
├── sourcerer.rb # Single-sourcing tool
|
|
2644
2885
|
├── docopslab/
|
|
2645
2886
|
│ ├── mcp/ # MCP assets and packaging
|
|
2646
2887
|
│ └── mcp.rb # DocOpsLab MCP entrypoint
|
|
2647
|
-
├── releasehx
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
│
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
│
|
|
2663
|
-
│
|
|
2664
|
-
|
|
2665
|
-
│
|
|
2666
|
-
│
|
|
2667
|
-
│
|
|
2668
|
-
│
|
|
2669
|
-
│
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
│ ├── cfgyml/ # CFGYML (OpenCFGY) parsing
|
|
2679
|
-
│ ├── attribute_resolver.rb # Resolves {attribute_name} placeholders
|
|
2680
|
-
│ ├── loader.rb # `SchemaGraphy::Loader`
|
|
2681
|
-
│ ├── regexp_utils.rb # Regular expression utilities
|
|
2682
|
-
│ ├── schema_utils.rb # `get_schema_defaults`, etc
|
|
2683
|
-
│ ├── tag_utils.rb # `detag`, `tag_of`, etc
|
|
2684
|
-
│ ├── templates/ # CFGYML documentation templates
|
|
2685
|
-
│ │ └── cfgyml/ # Config reference templates (+ sample gen)
|
|
2686
|
-
│ └── templating.rb # Defines handling of parsable YAML nodes
|
|
2687
|
-
└── sourcerer/
|
|
2688
|
-
├── builder.rb # Writes snippets to files at build time
|
|
2689
|
-
├── jekyll.rb # Jekyll and Liquid handling for Sourcerer
|
|
2690
|
-
├── plaintext_converter.rb # Pre-processes AsciiDoc source files
|
|
2691
|
-
└── 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
|
|
2692
2919
|
----
|
|
2693
2920
|
// end::ai-prompt[]
|
|
2694
2921
|
|
|
@@ -2702,200 +2929,6 @@ For now it's easier to test inside the one gem that is making immediate use of t
|
|
|
2702
2929
|
|
|
2703
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.
|
|
2704
2931
|
|
|
2705
|
-
[[sourcerer]]
|
|
2706
|
-
=== Sourcerer
|
|
2707
|
-
// tag::sourcerer[]
|
|
2708
|
-
This gem introduces a module called Sourcerer, by which AsciiDoc files can be parsed and their contents harvested for use in the application build.
|
|
2709
|
-
The module also handles Liquid template processing with enhanced attribute resolution capabilities.
|
|
2710
|
-
|
|
2711
|
-
[NOTE]
|
|
2712
|
-
Sourcerer is intended to be spun off as its own gem once it successfully proves the concept in this gem.
|
|
2713
|
-
It will probably be called _AsciiSourcerer_ and may replace an older and unmaintained utility of mine called LiquiDoc.
|
|
2714
|
-
|
|
2715
|
-
It is invoked in the Rakefile, establishing global namespaces:
|
|
2716
|
-
|
|
2717
|
-
* `ReleaseHx::ATTRIBUTES[:globals]` (derived from this `README.adoc` file)
|
|
2718
|
-
* `ReleaseHx.read_built_snippet(:<name>)` (such as `:helpscreen`)
|
|
2719
|
-
|
|
2720
|
-
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).
|
|
2721
|
-
|
|
2722
|
-
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.
|
|
2723
|
-
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.
|
|
2724
|
-
|
|
2725
|
-
Sourcerer also performs basic testing of select commands in the ASciiDoc file that have been assigned a `testable` role.
|
|
2726
|
-
|
|
2727
|
-
This is mostly just showing off what Sourcerer can do, and hopefully setting into habit some best practices for my more complicated apps.
|
|
2728
|
-
|
|
2729
|
-
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>>.
|
|
2730
|
-
// end::sourcerer[]
|
|
2731
|
-
|
|
2732
|
-
[[schemagraphy]]
|
|
2733
|
-
=== SchemaGraphy
|
|
2734
|
-
|
|
2735
|
-
This gem also introduces a module that derives from an unreleased gem I have been working on for some years: SchemaGraphy.
|
|
2736
|
-
|
|
2737
|
-
SchemaGraphy is basically an extension of YAML, enabling Ruby developers and end users more broadly to powerfully interpret and schematize YAML-based data.
|
|
2738
|
-
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.
|
|
2739
|
-
|
|
2740
|
-
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.
|
|
2741
|
-
|
|
2742
|
-
[[attribute-resolution]]
|
|
2743
|
-
==== Attribute Resolution
|
|
2744
|
-
|
|
2745
|
-
SchemaGraphy provides *attribute resolution* capabilities through the `AttributeResolver` component.
|
|
2746
|
-
This enables YAML files to reference external attributes using placeholder syntax like `{attribute_name}`.
|
|
2747
|
-
|
|
2748
|
-
When loading YAML with `.load_yaml_with_attributes(file_path, attributes)`, SchemaGraphy:
|
|
2749
|
-
|
|
2750
|
-
. Loads the YAML file normally
|
|
2751
|
-
. Searches for `{attribute_name}` patterns in String values
|
|
2752
|
-
. Replaces them with corresponding values from the provided attributes Hash
|
|
2753
|
-
. Returns the resolved YAML data structure
|
|
2754
|
-
|
|
2755
|
-
This is used extensively in ReleaseHx's configuration system to enable single-sourcing of defaults from README attributes.
|
|
2756
|
-
|
|
2757
|
-
[[custom-yaml-tag-handling]]
|
|
2758
|
-
==== Custom YAML Tag Handling
|
|
2759
|
-
|
|
2760
|
-
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.
|
|
2761
|
-
|
|
2762
|
-
Wherever you parse YAML-formatted data using `.load_yaml_with_tags`, custom-tagged Scalar nodes are converted into Maps like so:
|
|
2763
|
-
|
|
2764
|
-
.User's YAML
|
|
2765
|
-
[source,yaml]
|
|
2766
|
-
----
|
|
2767
|
-
some_property: !liquid "{{ some_value }}"
|
|
2768
|
-
----
|
|
2769
|
-
|
|
2770
|
-
.Converted data TagMap
|
|
2771
|
-
[source,yaml]
|
|
2772
|
-
----
|
|
2773
|
-
some_property:
|
|
2774
|
-
__tag__: liquid
|
|
2775
|
-
value: "{{ some_value }}"
|
|
2776
|
-
----
|
|
2777
|
-
|
|
2778
|
-
Developers may therefore conditionally interpret ingested data based on user-defined classifications, wherever the developer supports such things.
|
|
2779
|
-
|
|
2780
|
-
Whether a Scalar has been transformed into a TagMap, you can resolve it using:
|
|
2781
|
-
|
|
2782
|
-
[source,ruby]
|
|
2783
|
-
----
|
|
2784
|
-
SchemaGraphy::TagUtils.detag(some_property)
|
|
2785
|
-
# Or, with a local alias
|
|
2786
|
-
detag = ->(val) { SchemaGraphy::TagUtils.detag(val) }
|
|
2787
|
-
detag(some_property)
|
|
2788
|
-
----
|
|
2789
|
-
|
|
2790
|
-
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.
|
|
2791
|
-
This will come up again in <<templated-fields,the next section>>.
|
|
2792
|
-
|
|
2793
|
-
[NOTE]
|
|
2794
|
-
This capability is only available on Scalar node values.
|
|
2795
|
-
For now, tags applied to other compound node types (Arrays/sequences, Maps/mappings) will be ignored by SchemaGraphy interpreters.
|
|
2796
|
-
|
|
2797
|
-
[WARNING]
|
|
2798
|
-
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.
|
|
2799
|
-
|
|
2800
|
-
[[templated-fields]]
|
|
2801
|
-
==== Templated Property Values in YAML
|
|
2802
|
-
|
|
2803
|
-
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.
|
|
2804
|
-
|
|
2805
|
-
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.
|
|
2806
|
-
|
|
2807
|
-
We'll look at how this is done in <<templated-fields-handling>>.
|
|
2808
|
-
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.
|
|
2809
|
-
|
|
2810
|
-
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.
|
|
2811
|
-
For now, it is up to our calling code to provide the appropriate variables to the template depending on the context.
|
|
2812
|
-
|
|
2813
|
-
[[config-def]]
|
|
2814
|
-
==== Configuration Definition (CFGYML)
|
|
2815
|
-
|
|
2816
|
-
All user-configurable settings have a definition, if not also a default value.
|
|
2817
|
-
For single-sourcing purposes, these are defined in a YAML format called CFGYML -- a configuration-file modeling language.
|
|
2818
|
-
|
|
2819
|
-
The file is at `{gem_config_definition_path}`.
|
|
2820
|
-
It is used to establish the literal default settings carried by the application, and also to document those settings for the user.
|
|
2821
|
-
|
|
2822
|
-
This practice lets developers give end users extremely detailed configurations, always well documented.
|
|
2823
|
-
|
|
2824
|
-
[[attribute-resolution-in-cfgyml]]
|
|
2825
|
-
===== Attribute Resolution in CFGYML
|
|
2826
|
-
|
|
2827
|
-
CFGYML supports *attribute resolution* from AsciiDoc files (like this README) using placeholder syntax.
|
|
2828
|
-
Default values can reference README attributes using `{attribute_name}` syntax:
|
|
2829
|
-
|
|
2830
|
-
[source,yaml]
|
|
2831
|
-
----
|
|
2832
|
-
properties:
|
|
2833
|
-
$meta:
|
|
2834
|
-
properties:
|
|
2835
|
-
markup:
|
|
2836
|
-
dflt: "{default_markup}" # Resolved from README.adoc :default_markup: attribute
|
|
2837
|
-
----
|
|
2838
|
-
|
|
2839
|
-
This enables single-sourcing of configuration defaults from README attributes, ensuring that documentation and defaults stay synchronized.
|
|
2840
|
-
|
|
2841
|
-
[[cfgyml-schema-structure]]
|
|
2842
|
-
===== CFGYML Schema Structure
|
|
2843
|
-
|
|
2844
|
-
The basic schema is somewhat straightforward.
|
|
2845
|
-
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.
|
|
2846
|
-
|
|
2847
|
-
Each setting can have a type, description (`desc`), default (`dflt`), and templated-field instructions (`templating`).
|
|
2848
|
-
If the setting is itself a of type `Map` (YAML "`mapping`", JSON "`object`"), its own nested parameters can be established with a `properties:` block.
|
|
2849
|
-
|
|
2850
|
-
For now, you can designate the type, which you will have to enforce in your code, as well as a default value.
|
|
2851
|
-
|
|
2852
|
-
[[sgyml-schemas]]
|
|
2853
|
-
==== SGYML Schemas
|
|
2854
|
-
|
|
2855
|
-
Similar to but more complicated than CFGYML definition files are SchemaGraphy schema files.
|
|
2856
|
-
This is a partially specified, partially developed, and as-yet-incomplete syntax for designating and constraining YAML documents.
|
|
2857
|
-
|
|
2858
|
-
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.
|
|
2859
|
-
|
|
2860
|
-
Each of the YAML formats used by ReleaseHx has its own schema in the repo.
|
|
2861
|
-
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.
|
|
2862
|
-
|
|
2863
|
-
Since SchemaGraphy itself is still unreleased, CFGYML as introduced in this gem offers only a subset of what it will enable down the road.
|
|
2864
|
-
|
|
2865
|
-
Once SchemaGraphy is generally available, this gem will call it as a dependency.
|
|
2866
|
-
At that point, a file like `specs/data/config-def.yml` (CFGYML) will be able to impose a more detailed `$schema` for any property.
|
|
2867
|
-
|
|
2868
|
-
[[templated-fields-handling]]
|
|
2869
|
-
==== Dynamic Templated-field Handling
|
|
2870
|
-
|
|
2871
|
-
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.
|
|
2872
|
-
|
|
2873
|
-
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.
|
|
2874
|
-
|
|
2875
|
-
Developers can designate a given property to be `type: Template` in a schema or definition.
|
|
2876
|
-
This "`typing`" can be a trigger for downstream parsing/rendering of the template.
|
|
2877
|
-
|
|
2878
|
-
[NOTE]
|
|
2879
|
-
Liquid uses these two stages.
|
|
2880
|
-
The _parse_ operation compiles a template into a `Liquid::Template` object.
|
|
2881
|
-
The _render_ operation applies a dataset to the loaded template, generating a String with Liquid tags resolved.
|
|
2882
|
-
|
|
2883
|
-
[[nyi]]
|
|
2884
|
-
==== Not Yet Implemented
|
|
2885
|
-
|
|
2886
|
-
Most aspects of SchemaGraphy/SGYML are not yet available in ReleaseHx, but some are worth pointing out.
|
|
2887
|
-
|
|
2888
|
-
data types::
|
|
2889
|
-
As of now, the `type` node of any property in `specs/data/config-def.yml` is not particularly functional.
|
|
2890
|
-
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.
|
|
2891
|
-
+
|
|
2892
|
-
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.
|
|
2893
|
-
|
|
2894
|
-
schema docs::
|
|
2895
|
-
The schema files do not yet generate complete reference docs for the subject files that they govern.
|
|
2896
|
-
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.
|
|
2897
|
-
// end::schemagraphy[]
|
|
2898
|
-
|
|
2899
2932
|
[[docs-deployment]]
|
|
2900
2933
|
=== Documentation Deployment
|
|
2901
2934
|
|