()
| 45 | })); |
| 46 | |
| 47 | async function init() { |
| 48 | console.log('Cleaning up output directory ' + outputDir); |
| 49 | await rm(outputDir, { force: true, recursive: true }); |
| 50 | await mkdir(outputDir); |
| 51 | await mkdir(join(outputDir, 'lib')); |
| 52 | console.log(`Copying file ${join(inputDir, 'LICENSE.md')}`); |
| 53 | await copyFile(join(cwd, 'LICENSE'), join(inputDir, 'LICENSE.md')); |
| 54 | console.log(`Copying file ${join(outputDir, 'lib/marked.umd.js')}`); |
| 55 | await copyFile(join(cwd, 'lib/marked.umd.js'), join(outputDir, 'lib/marked.umd.js')); |
| 56 | console.log(`Copying file ${join(outputDir, 'lib/marked.umd.js.map')}`); |
| 57 | await copyFile(join(cwd, 'lib/marked.umd.js.map'), join(outputDir, 'lib/marked.umd.js.map')); |
| 58 | console.log(`Copying file ${join(outputDir, 'lib/marked.esm.js')}`); |
| 59 | await copyFile(join(cwd, 'lib/marked.esm.js'), join(outputDir, 'lib/marked.esm.js')); |
| 60 | console.log(`Copying file ${join(outputDir, 'lib/marked.esm.js.map')}`); |
| 61 | await copyFile(join(cwd, 'lib/marked.esm.js.map'), join(outputDir, 'lib/marked.esm.js.map')); |
| 62 | const tmpl = await readFile(templateFile, 'utf8'); |
| 63 | console.log('Building markdown...'); |
| 64 | const [original, commonmark, gfm] = await getTests([ |
| 65 | join(__dirname, '../test/specs/original'), |
| 66 | join(__dirname, '../test/specs/commonmark'), |
| 67 | join(__dirname, '../test/specs/gfm'), |
| 68 | ]); |
| 69 | const testResultsTable = |
| 70 | convertTestsToTable('Markdown 1.0', original) |
| 71 | + convertTestsToTable('CommonMark 0.31', commonmark) |
| 72 | + convertTestsToTable('GitHub Flavored Markdown 0.29', gfm); |
| 73 | await build(inputDir, tmpl, testResultsTable); |
| 74 | console.log('Build complete!'); |
| 75 | } |
| 76 | |
| 77 | const ignoredFiles = [ |
| 78 | join(cwd, 'docs', 'build.js'), |
no test coverage detected
searching dependent graphs…