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.
- checksums.yaml +4 -4
- data/README.adoc +366 -331
- data/build/docs/_config.yml +18 -1
- data/build/docs/_release_index.adoc +10 -0
- data/build/docs/config-reference.adoc +203 -16
- data/build/docs/config-reference.json +60 -10
- data/build/docs/index.adoc +316 -59
- data/build/docs/landing.adoc +11 -4
- 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/releases.adoc +28 -0
- data/build/docs/sample-config.adoc +2 -0
- data/build/docs/sample-config.yml +16 -9
- data/lib/releasehx/cli.rb +21 -9
- 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 +126 -8
- data/lib/releasehx/mcp/assets/config-reference.adoc +203 -16
- data/lib/releasehx/mcp/assets/config-reference.json +60 -10
- data/lib/releasehx/mcp/assets/sample-config.yml +16 -9
- 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 +13 -9
- data/lib/releasehx/rhyml/mappings/github.yaml +3 -1
- 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 +4 -7
- data/lib/releasehx/rhyml/templates/entry.html.liquid +21 -20
- data/lib/releasehx/rhyml/templates/entry.md.liquid +14 -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 -49
- 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 -49
- 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.adoc.liquid +2 -40
- data/lib/releasehx/rhyml/templates/note.html.liquid +25 -19
- data/lib/releasehx/rhyml/templates/note.md.liquid +43 -29
- data/lib/releasehx/rhyml/templates/parts-listing.liquid +6 -6
- 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 -35
- 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 +126 -8
- metadata +50 -26
- data/build/docs/Gemfile.lock +0 -95
- 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 -215
- 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/specs/data/config-def.yml
CHANGED
|
@@ -165,6 +165,7 @@ properties:
|
|
|
165
165
|
Must be `issue_body`, `custom_field`, or `commit_message`.
|
|
166
166
|
|
|
167
167
|
Defaults to `issue_body` for GitHub and GitLab, but to `custom_field` for Jira.
|
|
168
|
+
dflt: issue_body
|
|
168
169
|
note_custom_field:
|
|
169
170
|
type: String
|
|
170
171
|
desc: |
|
|
@@ -182,7 +183,8 @@ properties:
|
|
|
182
183
|
Uses Capture group `note` in the Regular Expression to establish the entire note content.
|
|
183
184
|
|
|
184
185
|
See the `conversions.head_pattern` property for details on extracting a heading (`head` in RHYML) from the `note` content.
|
|
185
|
-
dflt: '/^((#|=)+ (Draft )?Release Note
|
|
186
|
+
dflt: '/^(((#|=)+ (Draft )?Release Note.*?)|(<!-- (draft )?release note -->))\n+(?<note>(.|
|
|
187
|
+
)+)/gmi'
|
|
186
188
|
head_pattern:
|
|
187
189
|
type: RegExp
|
|
188
190
|
desc: |
|
|
@@ -201,12 +203,59 @@ properties:
|
|
|
201
203
|
The origin markup format for notes.
|
|
202
204
|
May be `markdown` or `asciidoc`.
|
|
203
205
|
dflt: markdown
|
|
204
|
-
|
|
205
|
-
type: String
|
|
206
|
+
engines:
|
|
206
207
|
desc: |
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
Specifies the conversion engines to use when enriching to various output formats.
|
|
209
|
+
|
|
210
|
+
These settings determine which tool processes the conversion from draft formats to rich output.
|
|
211
|
+
Intelligent defaults are applied based on source format when engines are not explicitly configured.
|
|
212
|
+
properties:
|
|
213
|
+
html:
|
|
214
|
+
type: String
|
|
215
|
+
desc: |
|
|
216
|
+
Engine for converting to HTML format.
|
|
217
|
+
|
|
218
|
+
Valid engines:
|
|
219
|
+
|
|
220
|
+
[horizontal]
|
|
221
|
+
`asciidoctor-html5`:: Standard Asciidoctor HTML5 backend (nested div structure)
|
|
222
|
+
`asciidoctor-html5s`:: Semantic HTML5 backend (cleaner section-based markup)
|
|
223
|
+
`kramdown`:: Kramdown Markdown converter (for Markdown sources)
|
|
224
|
+
`pandoc`:: Universal document converter (if available)
|
|
225
|
+
|
|
226
|
+
When not specified, intelligent defaults apply:
|
|
227
|
+
|
|
228
|
+
- AsciiDoc → HTML: `asciidoctor-html5s` (semantic HTML5)
|
|
229
|
+
- Markdown → HTML: `kramdown`
|
|
230
|
+
- RHYML → HTML: Liquid templates (no engine needed)
|
|
231
|
+
docs: |
|
|
232
|
+
The html5s backend produces cleaner, more semantic HTML with `<section>` elements
|
|
233
|
+
instead of nested `<div class="sect1"><div class="sectionbody">` structures.
|
|
234
|
+
|
|
235
|
+
This is particularly useful when you want to apply custom CSS or when generating
|
|
236
|
+
HTML that will be further processed or embedded in other systems.
|
|
237
|
+
|
|
238
|
+
For backwards compatibility or when you need the traditional Asciidoctor structure,
|
|
239
|
+
use `asciidoctor-html5`.
|
|
240
|
+
pdf:
|
|
241
|
+
type: String
|
|
242
|
+
desc: |
|
|
243
|
+
Engine for converting to PDF format.
|
|
244
|
+
|
|
245
|
+
Valid engines:
|
|
246
|
+
|
|
247
|
+
[horizontal]
|
|
248
|
+
`asciidoctor-pdf`:: Asciidoctor PDF converter (default for AsciiDoc)
|
|
249
|
+
`asciidoctor-web-pdf`:: Web-based PDF converter using headless Chrome
|
|
250
|
+
`pandoc`:: Universal document converter (if available)
|
|
251
|
+
|
|
252
|
+
When not specified, intelligent defaults apply:
|
|
253
|
+
|
|
254
|
+
- AsciiDoc → PDF: `asciidoctor-pdf`
|
|
255
|
+
- Markdown → PDF: `pandoc` (if available)
|
|
256
|
+
docs: |
|
|
257
|
+
The default `asciidoctor-pdf` engine provides excellent typography and layout
|
|
258
|
+
for technical documentation with support for themes, fonts, and advanced formatting.
|
|
210
259
|
|
|
211
260
|
extensions:
|
|
212
261
|
desc: Default file extensions.
|
|
@@ -835,7 +884,7 @@ properties:
|
|
|
835
884
|
desc: |
|
|
836
885
|
Default settings for `rhx` command executions.
|
|
837
886
|
properties:
|
|
838
|
-
|
|
887
|
+
html_wrap:
|
|
839
888
|
type: Boolean
|
|
840
889
|
desc: |
|
|
841
890
|
Include (or exclude) head, header, and footer elements when enriching to HTML.
|
|
@@ -860,6 +909,7 @@ properties:
|
|
|
860
909
|
Include frontmatter in AsciiDoc drafts.
|
|
861
910
|
|
|
862
911
|
Uses the `templates.asciidoc_frontmatter` template.
|
|
912
|
+
dflt: false
|
|
863
913
|
fetch:
|
|
864
914
|
type: String
|
|
865
915
|
desc: |
|
|
@@ -1041,6 +1091,74 @@ properties:
|
|
|
1041
1091
|
|
|
1042
1092
|
It may include `{{ title }}`, `{{ version }}`, `{{ date }}`, as well as any `vars`-scoped variables as you pass in.
|
|
1043
1093
|
dflt: *markdown_frontmatter_tplt
|
|
1094
|
+
html_framework:
|
|
1095
|
+
type: String
|
|
1096
|
+
desc: |
|
|
1097
|
+
The HTML framework to use when enriching to HTML.
|
|
1098
|
+
|
|
1099
|
+
Valid entries:
|
|
1100
|
+
|
|
1101
|
+
[horizontal]
|
|
1102
|
+
`bare`:: minimal HTML structure
|
|
1103
|
+
`bootstrap4`:: Bootstrap 4 framework
|
|
1104
|
+
`bootstrap5`:: Bootstrap 5 framework
|
|
1105
|
+
dflt: bare
|
|
1106
|
+
styling:
|
|
1107
|
+
desc: |
|
|
1108
|
+
Configuration options for HTML styling and CSS framework integration.
|
|
1109
|
+
properties:
|
|
1110
|
+
mode:
|
|
1111
|
+
type: String
|
|
1112
|
+
desc: |
|
|
1113
|
+
The HTML styling approach to use when generating wrapped HTML output.
|
|
1114
|
+
|
|
1115
|
+
Valid options:
|
|
1116
|
+
|
|
1117
|
+
* `minimal` -- Basic semantic HTML with minimal inline styles
|
|
1118
|
+
* `embedded` -- Include comprehensive CSS in `<style>` block
|
|
1119
|
+
* `external` -- Reference external stylesheet via `<link>` tag
|
|
1120
|
+
* `framework` -- Use configured CSS framework only (Bootstrap, etc.)
|
|
1121
|
+
|
|
1122
|
+
When `mode: framework`, styling relies entirely on the configured CSS framework.
|
|
1123
|
+
When `mode: embedded`, CSS is included inline for standalone HTML files.
|
|
1124
|
+
When `mode: external`, a custom CSS file must be provided via `css_url`.
|
|
1125
|
+
dflt: framework
|
|
1126
|
+
theme:
|
|
1127
|
+
type: String
|
|
1128
|
+
desc: |
|
|
1129
|
+
The visual theme variant to apply to HTML output.
|
|
1130
|
+
|
|
1131
|
+
Built-in themes:
|
|
1132
|
+
|
|
1133
|
+
* `default` -- Standard professional appearance
|
|
1134
|
+
* `compact` -- Reduced spacing and condensed layout
|
|
1135
|
+
* `detailed` -- Enhanced metadata display with expanded information
|
|
1136
|
+
|
|
1137
|
+
Theme selection affects spacing, typography, and metadata prominence.
|
|
1138
|
+
dflt: default
|
|
1139
|
+
embed_css:
|
|
1140
|
+
type: Boolean
|
|
1141
|
+
desc: |
|
|
1142
|
+
Include comprehensive CSS directly in the HTML `<style>` block.
|
|
1143
|
+
|
|
1144
|
+
When enabled, generates standalone HTML files that display correctly
|
|
1145
|
+
without external dependencies. CSS includes framework customizations,
|
|
1146
|
+
responsive design rules, and print optimizations.
|
|
1147
|
+
|
|
1148
|
+
Automatically enabled when `mode: embedded`.
|
|
1149
|
+
dflt: false
|
|
1150
|
+
css_url:
|
|
1151
|
+
type: String
|
|
1152
|
+
desc: |
|
|
1153
|
+
URL or path to external CSS stylesheet for custom styling.
|
|
1154
|
+
|
|
1155
|
+
When `mode: external`, this stylesheet is linked via `<link rel="stylesheet">`.
|
|
1156
|
+
Can be a relative path, absolute URL, or CDN link.
|
|
1157
|
+
|
|
1158
|
+
Example: `assets/custom-releasehx.css` or `https://example.com/styles.css`
|
|
1159
|
+
|
|
1160
|
+
When provided, framework CSS and embedded CSS are disabled.
|
|
1161
|
+
dflt: null
|
|
1044
1162
|
items:
|
|
1045
1163
|
desc: |
|
|
1046
1164
|
Settings pertaining to displayed items across Changelog and Release Notes sections.
|
|
@@ -1162,7 +1280,7 @@ properties:
|
|
|
1162
1280
|
The label to use for the _singular_ part/component affected by the change, when only one part is permitted.
|
|
1163
1281
|
|
|
1164
1282
|
This value will apply either when <<conf_ppty_rhyml_max_parts>> is set to `1` or when the change has only one part _and_ <<conf_ppty_history_labeling_singularize_labels>> is `true`.
|
|
1165
|
-
dflt:
|
|
1283
|
+
dflt: Component
|
|
1166
1284
|
parts_icon:
|
|
1167
1285
|
type: String
|
|
1168
1286
|
desc: |
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: releasehx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- DocOpsLab
|
|
@@ -107,6 +107,20 @@ dependencies:
|
|
|
107
107
|
- - "~>"
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
109
|
version: '0.4'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: asciidoctor-html5s
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "~>"
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0.5'
|
|
117
|
+
type: :runtime
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "~>"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0.5'
|
|
110
124
|
- !ruby/object:Gem::Dependency
|
|
111
125
|
name: asciidoctor-pdf
|
|
112
126
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -121,6 +135,20 @@ dependencies:
|
|
|
121
135
|
- - "~>"
|
|
122
136
|
- !ruby/object:Gem::Version
|
|
123
137
|
version: '2.3'
|
|
138
|
+
- !ruby/object:Gem::Dependency
|
|
139
|
+
name: asciisourcerer
|
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
|
141
|
+
requirements:
|
|
142
|
+
- - "~>"
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: '0.4'
|
|
145
|
+
type: :runtime
|
|
146
|
+
prerelease: false
|
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - "~>"
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: '0.4'
|
|
124
152
|
- !ruby/object:Gem::Dependency
|
|
125
153
|
name: commonmarker
|
|
126
154
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -233,6 +261,20 @@ dependencies:
|
|
|
233
261
|
- - "~>"
|
|
234
262
|
- !ruby/object:Gem::Version
|
|
235
263
|
version: '1.5'
|
|
264
|
+
- !ruby/object:Gem::Dependency
|
|
265
|
+
name: schemagraphy
|
|
266
|
+
requirement: !ruby/object:Gem::Requirement
|
|
267
|
+
requirements:
|
|
268
|
+
- - "~>"
|
|
269
|
+
- !ruby/object:Gem::Version
|
|
270
|
+
version: '0.1'
|
|
271
|
+
type: :runtime
|
|
272
|
+
prerelease: false
|
|
273
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
274
|
+
requirements:
|
|
275
|
+
- - "~>"
|
|
276
|
+
- !ruby/object:Gem::Version
|
|
277
|
+
version: '0.1'
|
|
236
278
|
- !ruby/object:Gem::Dependency
|
|
237
279
|
name: to_regexp
|
|
238
280
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -266,19 +308,20 @@ files:
|
|
|
266
308
|
- bin/rhx-mcp
|
|
267
309
|
- bin/sourcerer
|
|
268
310
|
- build/docs/CNAME
|
|
269
|
-
- build/docs/Gemfile.lock
|
|
270
311
|
- build/docs/_config.yml
|
|
312
|
+
- build/docs/_release_index.adoc
|
|
271
313
|
- build/docs/config-reference.adoc
|
|
272
314
|
- build/docs/config-reference.json
|
|
273
315
|
- build/docs/index.adoc
|
|
274
316
|
- build/docs/landing.adoc
|
|
275
317
|
- build/docs/manpage.adoc
|
|
318
|
+
- build/docs/release-procedure.adoc
|
|
319
|
+
- build/docs/release-procedure.html
|
|
276
320
|
- build/docs/releasehx.1
|
|
277
321
|
- build/docs/releasehx_readme.html
|
|
322
|
+
- build/docs/releases.adoc
|
|
278
323
|
- build/docs/sample-config.adoc
|
|
279
324
|
- build/docs/sample-config.yml
|
|
280
|
-
- build/docs/schemagraphy_readme.html
|
|
281
|
-
- build/docs/sourcerer_readme.html
|
|
282
325
|
- build/snippets/helpscreen.txt
|
|
283
326
|
- lib/docopslab/mcp.rb
|
|
284
327
|
- lib/docopslab/mcp/asset_packager.rb
|
|
@@ -319,11 +362,13 @@ files:
|
|
|
319
362
|
- lib/releasehx/rhyml/mappings/jira.yaml
|
|
320
363
|
- lib/releasehx/rhyml/mappings/verb_past_tenses.yml
|
|
321
364
|
- lib/releasehx/rhyml/release.rb
|
|
365
|
+
- lib/releasehx/rhyml/templates/bootstrap-overrides.css
|
|
322
366
|
- lib/releasehx/rhyml/templates/changelog.adoc.liquid
|
|
323
367
|
- lib/releasehx/rhyml/templates/changelog.html.liquid
|
|
324
368
|
- lib/releasehx/rhyml/templates/changelog.md.liquid
|
|
325
369
|
- lib/releasehx/rhyml/templates/changes-sorter.liquid
|
|
326
370
|
- lib/releasehx/rhyml/templates/config-cascade.liquid
|
|
371
|
+
- lib/releasehx/rhyml/templates/embedded.css.liquid
|
|
327
372
|
- lib/releasehx/rhyml/templates/entry.adoc.liquid
|
|
328
373
|
- lib/releasehx/rhyml/templates/entry.html.liquid
|
|
329
374
|
- lib/releasehx/rhyml/templates/entry.md.liquid
|
|
@@ -358,31 +403,10 @@ files:
|
|
|
358
403
|
- lib/releasehx/rhyml/templates/section-text.liquid
|
|
359
404
|
- lib/releasehx/rhyml/templates/sections.liquid
|
|
360
405
|
- lib/releasehx/rhyml/templates/tags-listing.liquid
|
|
406
|
+
- lib/releasehx/rhyml/templates/wrapper.html.liquid
|
|
361
407
|
- lib/releasehx/sgyml/helpers.rb
|
|
362
408
|
- lib/releasehx/transforms/adf_to_markdown.rb
|
|
363
409
|
- lib/releasehx/version.rb
|
|
364
|
-
- lib/schemagraphy.rb
|
|
365
|
-
- lib/schemagraphy/attribute_resolver.rb
|
|
366
|
-
- lib/schemagraphy/cfgyml/definition.rb
|
|
367
|
-
- lib/schemagraphy/cfgyml/doc_builder.rb
|
|
368
|
-
- lib/schemagraphy/cfgyml/path_reference.rb
|
|
369
|
-
- lib/schemagraphy/data_query/json_pointer.rb
|
|
370
|
-
- lib/schemagraphy/loader.rb
|
|
371
|
-
- lib/schemagraphy/regexp_utils.rb
|
|
372
|
-
- lib/schemagraphy/safe_expression.rb
|
|
373
|
-
- lib/schemagraphy/schema_utils.rb
|
|
374
|
-
- lib/schemagraphy/tag_utils.rb
|
|
375
|
-
- lib/schemagraphy/templating.rb
|
|
376
|
-
- lib/sourcerer.rb
|
|
377
|
-
- lib/sourcerer/builder.rb
|
|
378
|
-
- lib/sourcerer/jekyll.rb
|
|
379
|
-
- lib/sourcerer/jekyll/bootstrapper.rb
|
|
380
|
-
- lib/sourcerer/jekyll/liquid/file_system.rb
|
|
381
|
-
- lib/sourcerer/jekyll/liquid/filters.rb
|
|
382
|
-
- lib/sourcerer/jekyll/liquid/tags.rb
|
|
383
|
-
- lib/sourcerer/jekyll/monkeypatches.rb
|
|
384
|
-
- lib/sourcerer/plaintext_converter.rb
|
|
385
|
-
- lib/sourcerer/templating.rb
|
|
386
410
|
- specs/data/api-client-schema.yaml
|
|
387
411
|
- specs/data/config-def.yml
|
|
388
412
|
- specs/data/mcp-manifest.yml
|
data/build/docs/Gemfile.lock
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
GEM
|
|
2
|
-
remote: https://rubygems.org/
|
|
3
|
-
specs:
|
|
4
|
-
addressable (2.8.7)
|
|
5
|
-
public_suffix (>= 2.0.2, < 7.0)
|
|
6
|
-
asciidoctor (2.0.23)
|
|
7
|
-
base64 (0.3.0)
|
|
8
|
-
bigdecimal (3.2.3)
|
|
9
|
-
colorator (1.1.0)
|
|
10
|
-
concurrent-ruby (1.3.5)
|
|
11
|
-
csv (3.3.5)
|
|
12
|
-
em-websocket (0.5.3)
|
|
13
|
-
eventmachine (>= 0.12.9)
|
|
14
|
-
http_parser.rb (~> 0)
|
|
15
|
-
eventmachine (1.2.7)
|
|
16
|
-
ffi (1.17.2-x86_64-linux-gnu)
|
|
17
|
-
forwardable-extended (2.6.0)
|
|
18
|
-
google-protobuf (4.32.1-x86_64-linux-gnu)
|
|
19
|
-
bigdecimal
|
|
20
|
-
rake (>= 13)
|
|
21
|
-
http_parser.rb (0.8.0)
|
|
22
|
-
i18n (1.14.7)
|
|
23
|
-
concurrent-ruby (~> 1.0)
|
|
24
|
-
jekyll (4.4.1)
|
|
25
|
-
addressable (~> 2.4)
|
|
26
|
-
base64 (~> 0.2)
|
|
27
|
-
colorator (~> 1.0)
|
|
28
|
-
csv (~> 3.0)
|
|
29
|
-
em-websocket (~> 0.5)
|
|
30
|
-
i18n (~> 1.0)
|
|
31
|
-
jekyll-sass-converter (>= 2.0, < 4.0)
|
|
32
|
-
jekyll-watch (~> 2.0)
|
|
33
|
-
json (~> 2.6)
|
|
34
|
-
kramdown (~> 2.3, >= 2.3.1)
|
|
35
|
-
kramdown-parser-gfm (~> 1.0)
|
|
36
|
-
liquid (~> 4.0)
|
|
37
|
-
mercenary (~> 0.3, >= 0.3.6)
|
|
38
|
-
pathutil (~> 0.9)
|
|
39
|
-
rouge (>= 3.0, < 5.0)
|
|
40
|
-
safe_yaml (~> 1.0)
|
|
41
|
-
terminal-table (>= 1.8, < 4.0)
|
|
42
|
-
webrick (~> 1.7)
|
|
43
|
-
jekyll-asciidoc (3.0.1)
|
|
44
|
-
asciidoctor (>= 1.5.0, < 3.0.0)
|
|
45
|
-
jekyll (>= 3.0.0)
|
|
46
|
-
jekyll-include-cache (0.2.1)
|
|
47
|
-
jekyll (>= 3.7, < 5.0)
|
|
48
|
-
jekyll-sass-converter (3.1.0)
|
|
49
|
-
sass-embedded (~> 1.75)
|
|
50
|
-
jekyll-seo-tag (2.8.0)
|
|
51
|
-
jekyll (>= 3.8, < 5.0)
|
|
52
|
-
jekyll-watch (2.2.1)
|
|
53
|
-
listen (~> 3.0)
|
|
54
|
-
json (2.15.0)
|
|
55
|
-
just-the-docs (0.10.1)
|
|
56
|
-
jekyll (>= 3.8.5)
|
|
57
|
-
jekyll-include-cache
|
|
58
|
-
jekyll-seo-tag (>= 2.0)
|
|
59
|
-
rake (>= 12.3.1)
|
|
60
|
-
kramdown (2.5.1)
|
|
61
|
-
rexml (>= 3.3.9)
|
|
62
|
-
kramdown-parser-gfm (1.1.0)
|
|
63
|
-
kramdown (~> 2.0)
|
|
64
|
-
liquid (4.0.4)
|
|
65
|
-
listen (3.9.0)
|
|
66
|
-
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
67
|
-
rb-inotify (~> 0.9, >= 0.9.10)
|
|
68
|
-
mercenary (0.4.0)
|
|
69
|
-
pathutil (0.16.2)
|
|
70
|
-
forwardable-extended (~> 2.6)
|
|
71
|
-
public_suffix (6.0.2)
|
|
72
|
-
rake (13.3.0)
|
|
73
|
-
rb-fsevent (0.11.2)
|
|
74
|
-
rb-inotify (0.11.1)
|
|
75
|
-
ffi (~> 1.0)
|
|
76
|
-
rexml (3.4.4)
|
|
77
|
-
rouge (4.6.1)
|
|
78
|
-
safe_yaml (1.0.5)
|
|
79
|
-
sass-embedded (1.93.2-x86_64-linux-gnu)
|
|
80
|
-
google-protobuf (~> 4.31)
|
|
81
|
-
terminal-table (3.0.2)
|
|
82
|
-
unicode-display_width (>= 1.1.1, < 3)
|
|
83
|
-
unicode-display_width (2.6.0)
|
|
84
|
-
webrick (1.9.1)
|
|
85
|
-
|
|
86
|
-
PLATFORMS
|
|
87
|
-
x86_64-linux
|
|
88
|
-
|
|
89
|
-
DEPENDENCIES
|
|
90
|
-
jekyll
|
|
91
|
-
jekyll-asciidoc
|
|
92
|
-
just-the-docs
|
|
93
|
-
|
|
94
|
-
BUNDLED WITH
|
|
95
|
-
2.4.19
|
|
File without changes
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<div class="paragraph">
|
|
2
|
-
<p>This gem introduces a module called Sourcerer, by which AsciiDoc files can be parsed and their contents harvested for use in the application build.
|
|
3
|
-
The module also handles Liquid template processing with enhanced attribute resolution capabilities.</p>
|
|
4
|
-
</div>
|
|
5
|
-
<div class="admonitionblock note">
|
|
6
|
-
<table>
|
|
7
|
-
<tr>
|
|
8
|
-
<td class="icon">
|
|
9
|
-
<div class="title">Note</div>
|
|
10
|
-
</td>
|
|
11
|
-
<td class="content">
|
|
12
|
-
Sourcerer is intended to be spun off as its own gem once it successfully proves the concept in this gem.
|
|
13
|
-
It will probably be called <em>AsciiSourcerer</em> and may replace an older and unmaintained utility of mine called LiquiDoc.
|
|
14
|
-
</td>
|
|
15
|
-
</tr>
|
|
16
|
-
</table>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="paragraph">
|
|
19
|
-
<p>It is invoked in the Rakefile, establishing global namespaces:</p>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="ulist">
|
|
22
|
-
<ul>
|
|
23
|
-
<li>
|
|
24
|
-
<p><code>ReleaseHx::ATTRIBUTES[:globals]</code> (derived from this <code>README.adoc</code> file)</p>
|
|
25
|
-
</li>
|
|
26
|
-
<li>
|
|
27
|
-
<p><code>ReleaseHx.read_built_snippet(:<name>)</code> (such as <code>:helpscreen</code>)</p>
|
|
28
|
-
</li>
|
|
29
|
-
</ul>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="paragraph">
|
|
32
|
-
<p>The Sourcerer module also generates files like <code>build/docs/manpage.adoc</code>, which generates the formatted terminal manual, using content from <code>build/docs/config-reference.adoc</code> and this README (<code>tags="cli_options"</code>, for instance).</p>
|
|
33
|
-
</div>
|
|
34
|
-
<div class="paragraph">
|
|
35
|
-
<p>It also generates an AsciiDoc-formatted configuration reference, a machine-readable JSON reference, and a sample config using the <code>specs/data/config-def.yml</code> file.
|
|
36
|
-
The Sourcerer system now supports <strong>attribute resolution</strong> from AsciiDoc source files, enabling templates to access README attributes during rendering, ensuring configuration documentation reflects actual default values.</p>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="paragraph">
|
|
39
|
-
<p>Sourcerer also performs basic testing of select commands in the ASciiDoc file that have been assigned a <code>testable</code> role.</p>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="paragraph">
|
|
42
|
-
<p>This is mostly just showing off what Sourcerer can do, and hopefully setting into habit some best practices for my more complicated apps.</p>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="paragraph">
|
|
45
|
-
<p>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 <a href="#custom-liquid">[custom-liquid]</a>.</p>
|
|
46
|
-
</div>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module SchemaGraphy
|
|
4
|
-
# The AttributeResolver module provides methods for resolving AsciiDoc attribute references
|
|
5
|
-
# within a schema hash. It is used to substitute placeholders like `\{attribute_name}`
|
|
6
|
-
# with actual values.
|
|
7
|
-
module AttributeResolver
|
|
8
|
-
# Recursively walk a schema Hash and resolve `\{attribute_name}` references
|
|
9
|
-
# in 'dflt' values.
|
|
10
|
-
#
|
|
11
|
-
# @param schema [Hash] The schema or definition hash to process.
|
|
12
|
-
# @param attrs [Hash] The key-value pairs from AsciiDoc attributes to use for resolution.
|
|
13
|
-
# @return [Hash] The schema with resolved attributes.
|
|
14
|
-
def self.resolve_attributes! schema, attrs
|
|
15
|
-
case schema
|
|
16
|
-
when Hash
|
|
17
|
-
schema.transform_values! do |value|
|
|
18
|
-
if value.is_a?(Hash)
|
|
19
|
-
if value.key?('dflt') && value['dflt'].is_a?(String)
|
|
20
|
-
value['dflt'] = resolve_attribute_reference(value['dflt'], attrs)
|
|
21
|
-
end
|
|
22
|
-
resolve_attributes!(value, attrs)
|
|
23
|
-
else
|
|
24
|
-
value
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
schema
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# Replace `\{attribute_name}` patterns with corresponding values from the attrs hash.
|
|
32
|
-
#
|
|
33
|
-
# @param value [String] The string to process.
|
|
34
|
-
# @param attrs [Hash] The attributes to use for resolution.
|
|
35
|
-
# @return [String] The processed string with attribute references replaced.
|
|
36
|
-
def self.resolve_attribute_reference value, attrs
|
|
37
|
-
# Handle \{attribute_name} references
|
|
38
|
-
if value.match?(/\{[^}]+\}/)
|
|
39
|
-
value.gsub(/\{([^}]+)\}/) do |match|
|
|
40
|
-
attr_name = ::Regexp.last_match(1)
|
|
41
|
-
attrs[attr_name] || match # Keep original if no matching attribute
|
|
42
|
-
end
|
|
43
|
-
else
|
|
44
|
-
value
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative '../loader'
|
|
4
|
-
require_relative '../schema_utils'
|
|
5
|
-
|
|
6
|
-
module SchemaGraphy
|
|
7
|
-
# A module for handling CFGYML, a schema-driven configuration system.
|
|
8
|
-
module CFGYML
|
|
9
|
-
# Represents a configuration definition loaded from a schema file.
|
|
10
|
-
# It provides methods for accessing defaults and rendering documentation.
|
|
11
|
-
class Definition
|
|
12
|
-
# @return [Hash] The loaded schema hash.
|
|
13
|
-
attr_reader :schema
|
|
14
|
-
|
|
15
|
-
# @return [Hash] The attributes used for resolving placeholders in the schema.
|
|
16
|
-
attr_reader :attributes
|
|
17
|
-
|
|
18
|
-
# @param schema_path [String] The path to the schema YAML file.
|
|
19
|
-
# @param attrs [Hash] A hash of attributes for placeholder resolution.
|
|
20
|
-
def initialize schema_path, attrs = {}
|
|
21
|
-
@schema = Loader.load_yaml_with_attributes(schema_path, attrs)
|
|
22
|
-
@attributes = attrs
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# Extract default values from the loaded schema.
|
|
26
|
-
# @return [Hash] A hash of default values.
|
|
27
|
-
def defaults
|
|
28
|
-
SchemaUtils.crawl_defaults(@schema)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# Get the search paths for templates.
|
|
32
|
-
# @return [Array<String>] An array of template paths.
|
|
33
|
-
def template_paths
|
|
34
|
-
@template_paths ||= [
|
|
35
|
-
File.join(File.dirname(__FILE__), '..', 'templates', 'cfgyml'),
|
|
36
|
-
*additional_template_paths
|
|
37
|
-
]
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# Render a configuration reference or sample in the specified format.
|
|
41
|
-
#
|
|
42
|
-
# @param format [Symbol] The output format (`:adoc` or `:yaml`).
|
|
43
|
-
# @return [String] The rendered output.
|
|
44
|
-
# @raise [ArgumentError] if the format is unsupported.
|
|
45
|
-
def render_reference format = :adoc
|
|
46
|
-
template = case format
|
|
47
|
-
when :adoc
|
|
48
|
-
'config-reference.adoc.liquid'
|
|
49
|
-
when :yaml
|
|
50
|
-
'sample-config.yaml.liquid'
|
|
51
|
-
else
|
|
52
|
-
raise ArgumentError, "Unsupported format: #{format}"
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
render_template(template)
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
private
|
|
59
|
-
|
|
60
|
-
# Render a template using the Liquid engine.
|
|
61
|
-
def render_template template_name
|
|
62
|
-
template_path = find_template(template_name)
|
|
63
|
-
raise "Template not found: #{template_name}" unless template_path
|
|
64
|
-
|
|
65
|
-
require 'liquid'
|
|
66
|
-
template_content = File.read(template_path)
|
|
67
|
-
template = Liquid::Template.parse(template_content)
|
|
68
|
-
|
|
69
|
-
template.render(
|
|
70
|
-
'config_def' => @schema,
|
|
71
|
-
'attrs' => @attributes)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
# Find a template file in the configured template paths.
|
|
75
|
-
def find_template name
|
|
76
|
-
template_paths.each do |path|
|
|
77
|
-
file = File.join(path, name)
|
|
78
|
-
return file if File.exist?(file)
|
|
79
|
-
end
|
|
80
|
-
nil
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
# Provides an extension point for subclasses to add more template paths.
|
|
84
|
-
def additional_template_paths
|
|
85
|
-
# Can be overridden by subclasses
|
|
86
|
-
[]
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'json'
|
|
4
|
-
|
|
5
|
-
module SchemaGraphy
|
|
6
|
-
module CFGYML
|
|
7
|
-
# Builds documentation-friendly CFGYML references for machine consumption.
|
|
8
|
-
module DocBuilder
|
|
9
|
-
module_function
|
|
10
|
-
|
|
11
|
-
def call schema, options = {}
|
|
12
|
-
pretty = options.fetch(:pretty, true)
|
|
13
|
-
data = reference_hash(schema)
|
|
14
|
-
pretty ? JSON.pretty_generate(data) : JSON.generate(data)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def reference_hash schema
|
|
18
|
-
{
|
|
19
|
-
'format' => 'releasehx-config-reference',
|
|
20
|
-
'version' => 1,
|
|
21
|
-
'properties' => build_properties(schema['properties'], [])
|
|
22
|
-
}
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def build_properties properties, path
|
|
26
|
-
return {} unless properties.is_a?(Hash)
|
|
27
|
-
|
|
28
|
-
properties.each_with_object({}) do |(key, definition), acc|
|
|
29
|
-
next unless definition.is_a?(Hash)
|
|
30
|
-
|
|
31
|
-
current_path = path + [key]
|
|
32
|
-
entry = build_entry(current_path, definition)
|
|
33
|
-
children = build_properties(definition['properties'], current_path)
|
|
34
|
-
entry['properties'] = children unless children.empty?
|
|
35
|
-
acc[key] = entry
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def build_entry path, definition
|
|
40
|
-
entry = {
|
|
41
|
-
'path' => path.join('.'),
|
|
42
|
-
'desc' => definition['desc'],
|
|
43
|
-
'docs' => definition['docs'],
|
|
44
|
-
'type' => definition['type'],
|
|
45
|
-
'templating' => definition['templating'],
|
|
46
|
-
'default' => definition.key?('dflt') ? definition['dflt'] : nil
|
|
47
|
-
}
|
|
48
|
-
entry.compact
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'json'
|
|
4
|
-
|
|
5
|
-
module SchemaGraphy
|
|
6
|
-
module CFGYML
|
|
7
|
-
# Loads and queries a JSON config reference using JSON Pointer.
|
|
8
|
-
class PathReference
|
|
9
|
-
def initialize data
|
|
10
|
-
@data = data
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def self.load path
|
|
14
|
-
new(JSON.parse(File.read(path)))
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def get pointer
|
|
18
|
-
SchemaGraphy::DataQuery::JSONPointer.resolve(@data, pointer)
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
Reference = PathReference
|
|
23
|
-
end
|
|
24
|
-
end
|