|
1 | 1 | /* eslint-disable no-use-before-define */ |
| 2 | + |
| 3 | +// This file is used only for development, so we disable the following check. |
| 4 | +/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */ |
| 5 | + |
2 | 6 | // https://auth0.com/docs/api/management/v2#!/Clients/post_clients |
3 | 7 | // https://terminusdb.eu.auth0.com/api/v2/ |
4 | 8 |
|
5 | | -// eslint-disable-next-line import/no-extraneous-dependencies |
6 | 9 | const jsdoc2md = require('jsdoc-to-markdown'); |
7 | 10 | const fs = require('fs'); |
8 | 11 | const path = require('path'); |
| 12 | +const eol = require('eol'); |
| 13 | + |
9 | 14 | const { woqlClientMenu } = require('./navigationModel'); |
10 | 15 |
|
11 | 16 | /* input and output paths */ |
@@ -69,7 +74,10 @@ function createFile(filePath, options, outputDir) { |
69 | 74 | // const template = `{{#class name="${className}"}}{{>docs}}{{/class}}` |
70 | 75 | // eslint-disable-next-line no-console |
71 | 76 | console.log(`rendering ${filePath}`); |
72 | | - const output = jsdoc2md.renderSync(options); |
| 77 | + // Use `eol.lf` to guarantee the string always has Unix (LF) line endings, |
| 78 | + // `jsdoc-to-markdown` may use different line endings depending on the OS, and |
| 79 | + // this can cause problems with rendering the Markdown. |
| 80 | + const output = eol.lf(jsdoc2md.renderSync(options)); |
73 | 81 | fs.writeFileSync(path.resolve(outputDir, `${fileName}.md`), setHeadings(fileName, output)); |
74 | 82 | } |
75 | 83 | /// /([\w-]+)(.js)/ |
|
0 commit comments