mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Docs: allow docs to be built on Windows
This commit is contained in:
25
docs/build.js
Normal file
25
docs/build.js
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs').promises;
|
||||
const path = require('path');
|
||||
const documentation = require('documentation');
|
||||
|
||||
[
|
||||
'constructor',
|
||||
'input',
|
||||
'resize',
|
||||
'composite',
|
||||
'operation',
|
||||
'colour',
|
||||
'channel',
|
||||
'output',
|
||||
'utility'
|
||||
].forEach(async (m) => {
|
||||
const input = path.join('lib', `${m}.js`);
|
||||
const output = path.join('docs', `api-${m}.md`);
|
||||
|
||||
const ast = await documentation.build(input, { shallow: true });
|
||||
const markdown = await documentation.formats.md(ast, { markdownToc: false });
|
||||
|
||||
await fs.writeFile(output, markdown);
|
||||
});
|
||||
@@ -4,6 +4,7 @@
|
||||
"public": ".",
|
||||
"ignore": [
|
||||
".*",
|
||||
"build.js",
|
||||
"firebase.json",
|
||||
"*.md",
|
||||
"image/**",
|
||||
|
||||
Reference in New Issue
Block a user