@forsakringskassan/docs-generator 3.1.2 → 3.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.
package/dist/index.mjs CHANGED
@@ -3,12 +3,12 @@ import { createRequire as $createRequire } from "node:module";
3
3
  const require = $createRequire(import.meta.url);
4
4
 
5
5
  import { ApiItemKind, ApiModel } from '@microsoft/api-extractor-model';
6
- import { t as ts, Z as Ze, M as MarkdownIt, d as dedent, g as closest, h as distance, i as fm, j as isCI, m as moduleImporter, k as cliProgress, l as tinylr, w as watch, n as createInstance, o as fse, p as inter } from './vendor-DWCXj2K2.mjs';
6
+ import { t as ts, Z as Ze, M as MarkdownIt, d as dedent, g as closest, h as distance, i as fm, j as isCI, m as moduleImporter, k as cliProgress, l as tinylr, w as watch, n as createInstance, o as fse, p as inter } from './vendor-DR1Vkbzf.mjs';
7
7
  import path__default from 'node:path';
8
8
  import crypto from 'node:crypto';
9
9
  import path from 'node:path/posix';
10
10
  import { exec, execSync } from 'node:child_process';
11
- import { g as generateId, f as formatCode, p as parseInfostring, i as isDocumentPage, n as normalizePath, a as getFingerprint, h as hasTag, b as parseImport, d as findTag, e as getOutputFilePath, j as htmlencode, k as filePath, c as createMarkdownRenderer, l as generateExample } from './create-markdown-renderer-fg4eQJx_.mjs';
11
+ import { g as generateId, f as formatCode, p as parseInfostring, i as isDocumentPage, n as normalizePath, a as getFingerprint, h as hasTag, b as parseImport, d as findTag, e as getOutputFilePath, j as htmlencode, k as filePath, c as createMarkdownRenderer, l as generateExample } from './create-markdown-renderer-p3FAbLe1.mjs';
12
12
  import { DocExcerpt } from '@microsoft/tsdoc';
13
13
  import fs from 'node:fs/promises';
14
14
  import util, { promisify, styleText } from 'node:util';
@@ -3013,7 +3013,8 @@ async function render(doc, docs, options) {
3013
3013
  exampleFileMatcher,
3014
3014
  nav,
3015
3015
  templateFolders,
3016
- vendors
3016
+ vendors,
3017
+ linkResolvers
3017
3018
  } = options;
3018
3019
  if (!haveOutputFile(fileInfo)) {
3019
3020
  return null;
@@ -3110,7 +3111,8 @@ async function render(doc, docs, options) {
3110
3111
  handleSoftError(error) {
3111
3112
  throw error;
3112
3113
  },
3113
- messagebox: options.markdown.messagebox
3114
+ messagebox: options.markdown.messagebox,
3115
+ linkResolvers
3114
3116
  });
3115
3117
  njk.addFilter("marked", (content2) => {
3116
3118
  return markdownRenderer.render(doc, content2);
@@ -3229,6 +3231,7 @@ function nunjucksProcessor(options) {
3229
3231
  templateBlocks: context.getAllTemplateBlocks(),
3230
3232
  templateData: context.getAllTemplateData(),
3231
3233
  vendors: context.vendors,
3234
+ linkResolvers: options.linkResolvers,
3232
3235
  addResource(dst, src) {
3233
3236
  context.addResource(dst, src);
3234
3237
  }
@@ -3787,6 +3790,7 @@ class Generator {
3787
3790
  await i18n.init();
3788
3791
  await this._prepareFolders();
3789
3792
  await this._copyFonts();
3793
+ const linkResolvers = this.processors.map((it) => it.enabled !== false ? it.resolveLink : void 0).filter((it) => Boolean(it));
3790
3794
  const processors = [
3791
3795
  fileReaderProcessor(sourceFiles),
3792
3796
  redirectProcessor(),
@@ -3806,6 +3810,7 @@ class Generator {
3806
3810
  exampleFolders,
3807
3811
  templateFolders,
3808
3812
  setupPath,
3813
+ linkResolvers,
3809
3814
  markdown: markdownOptions ?? {}
3810
3815
  }),
3811
3816
  ...this.processors