@forsakringskassan/docs-generator 2.14.1 → 2.14.3

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/README.md CHANGED
@@ -107,9 +107,9 @@ export function setup(options: SetupOptions): void {
107
107
 
108
108
  Three CSS files are provided:
109
109
 
110
- - `@forsakringskassan/docs-generator/style/index.css` (aliased as `@forsakringskassan/docs-generator/style`)
111
- - `@forsakringskassan/docs-generator/style/core.css`
112
- - `@forsakringskassan/docs-generator/style/site.css`
110
+ - `@forsakringskassan/docs-generator/style/index.css` (aliased as `@forsakringskassan/docs-generator/style`)
111
+ - `@forsakringskassan/docs-generator/style/core.css`
112
+ - `@forsakringskassan/docs-generator/style/site.css`
113
113
 
114
114
  `core` contains the necessary styling for components and elements and `site` contains the layout, typography etc required for a documentation site to work.
115
115
  `index` is a combination of the two and should be used in most cases.
@@ -167,12 +167,12 @@ The link destination will always be relative to the current document.
167
167
  For configured languages (default `html` and `vue`) code fences are run as a live example in the browser with an option to display the source code.
168
168
  The following tags can be used:
169
169
 
170
- - `borderless` - removes the border from the example.
171
- - `fullscreen` - enable support for viewing the example in fullscreen.
172
- - `static` - force code to be rendered without live preview (only syntax highlight).
173
- - `live-example` - mark example as containing the `LiveExample` component.
174
- - `nomarkup` - for live examples this hides the syntax highlighted code and only displays the result of the running code.
175
- - `test-id=STRING` - Sets the `data-test` attribute.
170
+ - `borderless` - removes the border from the example.
171
+ - `fullscreen` - enable support for viewing the example in fullscreen.
172
+ - `static` - force code to be rendered without live preview (only syntax highlight).
173
+ - `live-example` - mark example as containing the `LiveExample` component.
174
+ - `nomarkup` - for live examples this hides the syntax highlighted code and only displays the result of the running code.
175
+ - `test-id=STRING` - Sets the `data-test` attribute.
176
176
 
177
177
  `static` and `live` are used to manually set whenever the code should be run as a live example or not.
178
178
 
@@ -215,12 +215,12 @@ Set a status badge for a component.
215
215
 
216
216
  The following statuses are recognized:
217
217
 
218
- - `Produktionsklar`
219
- - `Deprekerad`
220
- - `Experimentell`
221
- - `Preliminär`
222
- - `Draft` (deprecated alias for `Preliminär`)
223
- - `Beta` (deprecated alias for `Preliminär`)
218
+ - `Produktionsklar`
219
+ - `Deprekerad`
220
+ - `Experimentell`
221
+ - `Preliminär`
222
+ - `Draft` (deprecated alias for `Preliminär`)
223
+ - `Beta` (deprecated alias for `Preliminär`)
224
224
 
225
225
  #### `title`
226
226
 
@@ -507,17 +507,16 @@ function codePreview(options) {
507
507
  };
508
508
  function fence(_md, tokens, idx, _options, env) {
509
509
  const { fileInfo } = env;
510
- const { content: rawSource, info, map } = tokens[idx];
510
+ const { content: source, info, map } = tokens[idx];
511
511
  const { language, tags: rawTags } = parseInfostring(info);
512
512
  if (language === "mermaid") {
513
513
  return (
514
514
  /* HTML */
515
515
  `
516
- <pre class="mermaid">${htmlencode(rawSource)}</pre>
516
+ <pre class="mermaid">${htmlencode(source)}</pre>
517
517
  `
518
518
  );
519
519
  }
520
- const source = transformCode(rawSource, language);
521
520
  const example = generateExample({
522
521
  source,
523
522
  language,
@@ -527,7 +526,10 @@ function codePreview(options) {
527
526
  const { tags } = example;
528
527
  const hashContent = `${map?.[0]}:${map?.[1]}:${info}:${source}`;
529
528
  const fingerprint = getFingerprint(hashContent);
530
- const highlightedCode = replaceAtLink(highlight(example));
529
+ const transformedCode = transformCode(example.source, example.language);
530
+ const highlightedCode = replaceAtLink(
531
+ highlight({ source: transformedCode, language: example.language })
532
+ );
531
533
  const testId = findTestId(tags);
532
534
  const liveExample = tags.includes("live-example");
533
535
  const staticCode = example.runtime === false || tags.includes("static");
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var vendor = require('./vendor-Bb38Rlio.js');
6
6
  var path$1 = require('node:path');
7
7
  var require$$1 = require('crypto');
8
8
  require('node:crypto');
9
- var createMarkdownRenderer = require('./create-markdown-renderer-DVss8WXD.js');
9
+ var createMarkdownRenderer = require('./create-markdown-renderer-KS2pk3bP.js');
10
10
  var node_child_process = require('node:child_process');
11
11
  var util = require('node:util');
12
12
  var vueDocgenApi = require('vue-docgen-api');
package/dist/markdown.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var createMarkdownRenderer = require('./create-markdown-renderer-DVss8WXD.js');
3
+ var createMarkdownRenderer = require('./create-markdown-renderer-KS2pk3bP.js');
4
4
  require('./vendor-Bb38Rlio.js');
5
5
  require('node:url');
6
6
  require('node:path');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/docs-generator",
3
- "version": "2.14.1",
3
+ "version": "2.14.3",
4
4
  "description": "Documentation generator",
5
5
  "keywords": [
6
6
  "documentation"