@antora/content-classifier 3.1.10 → 3.1.12

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.
@@ -391,26 +391,48 @@ class ContentCatalog {
391
391
  }
392
392
 
393
393
  /**
394
- * Attempts to resolve a string contextual page ID spec to a file in the catalog.
394
+ * Attempts to resolve a page reference within the given context to a page in the catalog.
395
395
  *
396
- * Parses the specified contextual page ID spec into a page ID object, then attempts to lookup a
397
- * file with this page ID in the catalog. If a component is specified, but not a version, the
398
- * latest version of the component stored in the catalog is used. If a page cannot be resolved,
399
- * the search is attempted again for an "alias". If neither a page or alias can be resolved, the
400
- * function returns undefined. If the spec does not match the page ID syntax, this function throws
401
- * an error.
396
+ * Parses the specified page reference (i.e., page ID spec) into a partial page ID, expands it
397
+ * using the provided context, then attempts to locate a file in the page family with that page ID
398
+ * in this catalog. The family segment is optional.
402
399
  *
403
- * @param {String} spec - The contextual page ID spec (e.g., version@component:module:topic/page.adoc).
404
- * @param {ContentCatalog} catalog - The content catalog in which to resolve the page file.
405
- * @param {Object} [ctx={}] - The context to use to qualified the contextual page ID.
400
+ * If a component is specified, but no version, the latest version of the component stored in the
401
+ * catalog is used. If a page cannot be resolved, the search is attempted again for an "alias". If
402
+ * neither a page or alias can be resolved, the function returns undefined. If the syntax of the
403
+ * reference is invalid, this function throws an error.
406
404
  *
407
- * @returns {File} The virtual file to which the contextual page ID spec refers, or undefined if the
408
- * file cannot be resolved.
405
+ * @param {String} spec - The contextual page reference (e.g., version@component:module:topic/page.adoc).
406
+ * @param {Object} [context={}] - The context to use to qualify the page reference.
407
+ *
408
+ * @returns {File} The virtual file to which the contextual page reference resolves, or undefined
409
+ * if the file cannot be resolved.
409
410
  */
410
411
  resolvePage (spec, context = {}) {
411
412
  return this.resolveResource(spec, context, 'page', ['page'])
412
413
  }
413
414
 
415
+ /**
416
+ * Attempts to resolve a resource reference within the given context to a file in the catalog.
417
+ *
418
+ * Parses the specified resource reference (i.e., resource ID spec) into a partial resource ID,
419
+ * expands it using the provided context, then attempts to locate a file with that resource ID in
420
+ * this catalog.
421
+ *
422
+ * If a component is specified, but no version, the latest version of the component stored in the
423
+ * catalog is used. If a defaultFamily is not specified, the family must be specified either by
424
+ * the reference or the context. If permittedFamilies are stated, the family must resolve to a
425
+ * family in this list. If a file cannot be resolved, the function returns undefined. If the
426
+ * syntax of the reference is invalid, this function throws an error.
427
+ *
428
+ * @param {String} spec - The contextual resource reference (e.g., version@component:module:image$topic/image.png).
429
+ * @param {Object} [context={}] - The context to use to qualify the resource reference.
430
+ * @param {String} [defaultFamily=undefined] - The default family to use if one is not provided.
431
+ * @param {Array<String>} [permittedFamilies=undefined] - A list of families that are permitted.
432
+ *
433
+ * @returns {File} The virtual file to which the contextual resource reference resolves, or
434
+ * undefined if the file cannot be resolved.
435
+ */
414
436
  resolveResource (spec, context = {}, defaultFamily = undefined, permittedFamilies = undefined) {
415
437
  return resolveResource(spec, this, context, defaultFamily, permittedFamilies)
416
438
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/content-classifier",
3
- "version": "3.1.10",
3
+ "version": "3.1.12",
4
4
  "description": "Organizes aggregated content into a virtual file catalog for use in an Antora documentation pipeline.",
5
5
  "license": "MPL-2.0",
6
6
  "author": "OpenDevise Inc. (https://opendevise.com)",
@@ -30,8 +30,8 @@
30
30
  "#constants": "./lib/constants.js"
31
31
  },
32
32
  "dependencies": {
33
- "@antora/asciidoc-loader": "3.1.10",
34
- "@antora/logger": "3.1.10",
33
+ "@antora/asciidoc-loader": "3.1.12",
34
+ "@antora/logger": "3.1.12",
35
35
  "mime-types": "~2.1",
36
36
  "vinyl": "~3.0"
37
37
  },