๐Ÿ“ฆ ljharb / can-merge

๐Ÿ“„ markdown.config.js ยท 21 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21'use strict';

const childProcess = require('child_process');

module.exports = {
	matchWord: 'MD-MAGIC-EXAMPLE',
	transforms: {
		/* Match <!-- MD-MAGIC-EXAMPLE:START (CLI_REFERENCE) --> */
		CLI_REFERENCE() {
			const result = childProcess.execSync('node ./bin/can-merge --help', {
				env: { ...process.env, GH_TOKEN: undefined, GITHUB_TOKEN: undefined },
			});
			return [].concat('```txt', '$ npx can-merge --help', String(result), '```').join('\n');
		},
	},
	callback() {
		console.log('markdown processing done');
	},
};