@forsakringskassan/docs-generator 3.17.0 → 3.19.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.
package/dist/index.d.mts CHANGED
@@ -1019,7 +1019,7 @@ export declare interface SourceUrlProcessorOptions extends ProcessorOptions {
1019
1019
  readonly sourceFiles?: string[];
1020
1020
  readonly urlFormat: string;
1021
1021
  /** File extension used for finding component by name */
1022
- readonly componentFileExtension?: string;
1022
+ readonly componentFileExtension?: string | string[];
1023
1023
  }
1024
1024
 
1025
1025
  /**
package/dist/index.mjs CHANGED
@@ -1505,6 +1505,19 @@ function selectableVersionProcessor(pkg, container, options) {
1505
1505
  };
1506
1506
  }
1507
1507
 
1508
+ function filenamePattern(base, extensions) {
1509
+ if (typeof extensions === "string") {
1510
+ extensions = [extensions];
1511
+ }
1512
+ switch (extensions.length) {
1513
+ case 0:
1514
+ return base;
1515
+ case 1:
1516
+ return `${base}.${extensions[0]}`;
1517
+ default:
1518
+ return `${base}.{${extensions.join(",")}}`;
1519
+ }
1520
+ }
1508
1521
  function sourceUrlProcessor(...args) {
1509
1522
  const pkg = args.length === 2 ? args[0] : {};
1510
1523
  const options = args.length === 2 ? args[1] : args[0];
@@ -1512,7 +1525,7 @@ function sourceUrlProcessor(...args) {
1512
1525
  enabled = true,
1513
1526
  sourceFiles = ["**/*"],
1514
1527
  urlFormat,
1515
- componentFileExtension = "vue"
1528
+ componentFileExtension = ["vue"]
1516
1529
  } = options;
1517
1530
  const repository = getRepositoryUrl(pkg) ?? "";
1518
1531
  return {
@@ -1529,7 +1542,7 @@ function sourceUrlProcessor(...args) {
1529
1542
  const short = await gitCommitHash("short") ?? "";
1530
1543
  function componentSourceUrl(component) {
1531
1544
  const { source, name } = component;
1532
- const filename = source ?? `${name}.${componentFileExtension}`;
1545
+ const filename = source ?? filenamePattern(name, componentFileExtension);
1533
1546
  const path = matcher(filename, "when generating source url");
1534
1547
  return interpolate(urlFormat, {
1535
1548
  path,
@@ -2964,6 +2977,7 @@ function parseFile$1(filePath, basePath, content) {
2964
2977
  visible: attributes.href ? true : false,
2965
2978
  attributes: {
2966
2979
  title,
2980
+ shortTitle: attributes["short-title"],
2967
2981
  href,
2968
2982
  sortorder: attributes.sortorder ?? Infinity,
2969
2983
  redirectFrom: [],
@@ -4461,6 +4475,9 @@ class Generator {
4461
4475
  exampleFileMatcher,
4462
4476
  templateLoader
4463
4477
  });
4478
+ context.addTemplateBlock("header:left", "header:left", {
4479
+ filename: "partials/brand.html"
4480
+ });
4464
4481
  context.addTemplateBlock("footer:left", "footer:left", {
4465
4482
  filename: "partials/footer-left.html"
4466
4483
  });
@@ -4470,6 +4487,9 @@ class Generator {
4470
4487
  context.addTemplateBlock("footer:right", "footer:right", {
4471
4488
  filename: "partials/footer-right.html"
4472
4489
  });
4490
+ context.addTemplateBlock("component:aside", "component:aside", {
4491
+ filename: "partials/component-aside.html"
4492
+ });
4473
4493
  const generatedFiles = [
4474
4494
  await stage("generate-docs", context, processors),
4475
4495
  await stage("generate-nav", context, processors),