| name | contentstack-utils |
|---|---|
| description | Use when changing the public Ruby API, RTE rendering (HTML string or JSON), GQL payloads, Model::Options/Metadata, or integration boundaries with the delivery client. |
- Implementing or fixing HTML output for rich text / JSON RTE
- Extending or subclassing rendering options (
ContentstackUtils::Model::Options) - Parsing GraphQL-shaped RTE (
ContentstackUtils::GQL) - Changing load paths or public entry points under
lib/(gemspec and dependency ranges: see framework)
lib/contentstack_utils.rb— requires version andutilslib/contentstack_utils/utils.rb— main moduleContentstackUtilswith class methods:render_content(content, options)— legacy HTML string RTE (array of strings or single string); uses Nokogiri and_embedded_itemson the entry passed via optionsjson_to_html(content, options)— JSON RTE document tree (Hash/Array) for CDA-style payloads with embedded items on the entry- Internal helpers such as
json_doc_to_html(used by GQL path)
ContentstackUtils::GQL—json_to_html(content, options)for GraphQL responses: expects keys likejsonand optionalembedded_itemsConnection.edges; reusesContentstackUtils.json_doc_to_htmlwith a GQL-specific reference resolver
ContentstackUtils::Model::Options(lib/contentstack_utils/model/options.rb) — defaultrender_option,render_mark,render_node; subclass for custom HTML (see tests underspec/mock/custom_render_option.rb)ContentstackUtils::Model::Metadata— built from DOM nodes (HTML path) or JSON reference nodesContentstackUtils::Interface::Rendarable(lib/contentstack_utils/interface/renderable.rb) — base for options; implementrender_optionin subclasses
- CDA / delivery JSON path: options may carry an
entryhash with_embedded_itemskeyed by field UIDs - GQL path: payload uses
embedded_itemsConnection.edgeswithnodeobjects; reference resolution matchesmetadata.item_uidtonode.system.uid
- HTTP and stack access belong to the separate Contentstack Ruby client; this gem only renders given content + embedded metadata
- Public API and behavior changes should be reflected in
CHANGELOG.mdandlib/contentstack_utils/version.rb
- Product overview: README.md
- Framework & packaging
- Testing
- Ruby style and layout
- Contentstack documentation