@forsakringskassan/docs-generator 1.28.0 → 1.29.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/README.md CHANGED
@@ -228,6 +228,11 @@ Document title used for `<title>` and `<nav>`
228
228
  Set to `false` to hide document from navigation menu.
229
229
  Default `true`.
230
230
 
231
+ #### `include`
232
+
233
+ Set to `false` to not write the document to file or include as a page.
234
+ Default `true`.
235
+
231
236
  ### Inline tags
232
237
 
233
238
  #### `{@link ...}`
@@ -559,6 +559,15 @@ function include(docs, env, included, handleSoftError) {
559
559
  /* HTML */
560
560
  ` <div>${content}</div> `
561
561
  );
562
+ },
563
+ alt(tokens, index) {
564
+ const token = tokens[index];
565
+ const needle = token.info.split(" ")[1];
566
+ const doc = findDocument(docs, needle);
567
+ if (doc && doc.format === "markdown") {
568
+ return md.render(doc.body, env);
569
+ }
570
+ return md.render(token.content, env);
562
571
  }
563
572
  });
564
573
  };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var fs = require('node:fs/promises');
4
4
  var path = require('node:path');
5
5
  var vendor = require('./vendor-uab7h6x-.js');
6
- var createMarkdownRenderer = require('./create-markdown-renderer-CPrI2LLQ.js');
6
+ var createMarkdownRenderer = require('./create-markdown-renderer-D1cATjO1.js');
7
7
  var require$$1 = require('crypto');
8
8
  require('node:crypto');
9
9
  var vueDocgenApi = require('vue-docgen-api');
@@ -220,6 +220,7 @@ function parseFile$1(filePath, basePath, content) {
220
220
  const name = attributes.name ? attributes.name : parsed.name;
221
221
  const urlpath = parsed.dir;
222
222
  const outline = getDocumentOutline(blocks.body);
223
+ const include = attributes.include ?? true;
223
224
  return {
224
225
  id: `fs:${filePath.replace(/\\/g, "/")}`,
225
226
  name,
@@ -242,7 +243,7 @@ function parseFile$1(filePath, basePath, content) {
242
243
  path: ["", "."].includes(urlpath) ? "." : `./${createMarkdownRenderer.normalizePath(urlpath)}`,
243
244
  name: filename,
244
245
  fullPath: createMarkdownRenderer.normalizePath(filePath),
245
- outputName: `${filename}.html`
246
+ outputName: include ? `${filename}.html` : false
246
247
  }
247
248
  };
248
249
  }
@@ -1177,6 +1178,9 @@ async function compileExamples(options) {
1177
1178
  const outputFolder = path.posix.join(options.outputFolder, fileInfo.path);
1178
1179
  const cacheMiss = cache(cacheFolder, outputFolder);
1179
1180
  const dirtyTasks = tasks.filter(cacheMiss);
1181
+ if (dirtyTasks.length === 0) {
1182
+ return;
1183
+ }
1180
1184
  const batch = {
1181
1185
  outputFolder,
1182
1186
  external: vendors.map((it) => it.package),
package/dist/markdown.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var createMarkdownRenderer = require('./create-markdown-renderer-CPrI2LLQ.js');
3
+ var createMarkdownRenderer = require('./create-markdown-renderer-D1cATjO1.js');
4
4
  require('./vendor-uab7h6x-.js');
5
5
  require('path');
6
6
  require('url');
@@ -410,21 +410,21 @@ p:not(.code-preview p) {
410
410
  max-width: 680px;
411
411
  }
412
412
 
413
- main h1:not(.code-preview--default h1) {
413
+ main h1:not(.code-preview h1) {
414
414
  font-size: 2.5rem;
415
415
  color: #1b1e23;
416
416
  }
417
417
 
418
- main h2:not(.code-preview--default h2) {
418
+ main h2:not(.code-preview h2) {
419
419
  font-size: 1.5rem;
420
420
  margin-top: 3rem;
421
421
  }
422
422
 
423
- main h3:not(.code-preview--default h3) {
423
+ main h3:not(.code-preview h3) {
424
424
  font-size: 1.2rem;
425
425
  }
426
426
 
427
- main h4:not(.code-preview--default h4) {
427
+ main h4:not(.code-preview h4) {
428
428
  font-size: 1rem;
429
429
  }
430
430
 
@@ -478,6 +478,23 @@ h1 code {
478
478
  font-weight: 400;
479
479
  }
480
480
 
481
+ #content a:not(.code-preview a) {
482
+ color: var(--docs-text-color-default);
483
+ }
484
+
485
+ #content a:not(.code-preview a, h2 a, h3 a, h4 a, h5 a) {
486
+ text-decoration: underline;
487
+ text-decoration-thickness: 1px;
488
+ color: var(--f-text-color-link);
489
+ text-decoration-color: var(--docs-text-color-link);
490
+ text-underline-offset: 0.15rem;
491
+ }
492
+
493
+ #content a:hover:not(.code-preview a, h2 a, h3 a, h4 a, h5 a) {
494
+ color: var(--f-text-color-default);
495
+ text-decoration-color: var(--docs-text-link-hover);
496
+ }
497
+
481
498
  .layout-wrapper {
482
499
  font-family: var(--docs-font-family);
483
500
  background: #fff;
@@ -410,21 +410,21 @@ p:not(.code-preview p) {
410
410
  max-width: 680px;
411
411
  }
412
412
 
413
- main h1:not(.code-preview--default h1) {
413
+ main h1:not(.code-preview h1) {
414
414
  font-size: 2.5rem;
415
415
  color: #1b1e23;
416
416
  }
417
417
 
418
- main h2:not(.code-preview--default h2) {
418
+ main h2:not(.code-preview h2) {
419
419
  font-size: 1.5rem;
420
420
  margin-top: 3rem;
421
421
  }
422
422
 
423
- main h3:not(.code-preview--default h3) {
423
+ main h3:not(.code-preview h3) {
424
424
  font-size: 1.2rem;
425
425
  }
426
426
 
427
- main h4:not(.code-preview--default h4) {
427
+ main h4:not(.code-preview h4) {
428
428
  font-size: 1rem;
429
429
  }
430
430
 
@@ -478,6 +478,23 @@ h1 code {
478
478
  font-weight: 400;
479
479
  }
480
480
 
481
+ #content a:not(.code-preview a) {
482
+ color: var(--docs-text-color-default);
483
+ }
484
+
485
+ #content a:not(.code-preview a, h2 a, h3 a, h4 a, h5 a) {
486
+ text-decoration: underline;
487
+ text-decoration-thickness: 1px;
488
+ color: var(--f-text-color-link);
489
+ text-decoration-color: var(--docs-text-color-link);
490
+ text-underline-offset: 0.15rem;
491
+ }
492
+
493
+ #content a:hover:not(.code-preview a, h2 a, h3 a, h4 a, h5 a) {
494
+ color: var(--f-text-color-default);
495
+ text-decoration-color: var(--docs-text-link-hover);
496
+ }
497
+
481
498
  .layout-wrapper {
482
499
  font-family: var(--docs-font-family);
483
500
  background: #fff;
@@ -841,6 +858,8 @@ kbd {
841
858
  --docs-font-weight: normal;
842
859
  --docs-text-color-default: #1b1e23;
843
860
  --docs-text-color-discrete: #5f6165;
861
+ --docs-text-color-link: #4a52b6;
862
+ --docs-text-color-link-hover: #1b1e23;
844
863
  --docs-heading-font-family: var(--docs-font-family);
845
864
  --docs-heading-font-weight: var(--docs-font-weight);
846
865
  --docs-heading-line-height: 1.4;
@@ -3,6 +3,8 @@
3
3
  --docs-font-weight: normal;
4
4
  --docs-text-color-default: #1b1e23;
5
5
  --docs-text-color-discrete: #5f6165;
6
+ --docs-text-color-link: #4a52b6;
7
+ --docs-text-color-link-hover: #1b1e23;
6
8
  --docs-heading-font-family: var(--docs-font-family);
7
9
  --docs-heading-font-weight: var(--docs-font-weight);
8
10
  --docs-heading-line-height: 1.4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/docs-generator",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "description": "Documentation generator",
5
5
  "keywords": [
6
6
  "documentation"