| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/gavin/workspace/happymandarin/node_modules/kareem/ |
Upload File : |
var acquit = require('acquit');
var content = require('fs').readFileSync('./test/examples.test.js').toString();
var blocks = acquit.parse(content);
var mdOutput =
'# kareem\n\n' +
' [](https://travis-ci.org/vkarpov15/kareem)\n' +
' [](https://coveralls.io/r/vkarpov15/kareem)\n\n' +
'Re-imagined take on the [hooks](http://npmjs.org/package/hooks) module, ' +
'meant to offer additional flexibility in allowing you to execute hooks ' +
'whenever necessary, as opposed to simply wrapping a single function.\n\n' +
'Named for the NBA\'s all-time leading scorer Kareem Abdul-Jabbar, known ' +
'for his mastery of the [hook shot](http://en.wikipedia.org/wiki/Kareem_Abdul-Jabbar#Skyhook)\n\n' +
'<img src="http://upload.wikimedia.org/wikipedia/commons/0/00/Kareem-Abdul-Jabbar_Lipofsky.jpg" width="220">\n\n' +
'# API\n\n';
for (var i = 0; i < blocks.length; ++i) {
var describe = blocks[i];
mdOutput += '## ' + describe.contents + '\n\n';
mdOutput += describe.comments[0] ?
acquit.trimEachLine(describe.comments[0]) + '\n\n' :
'';
for (var j = 0; j < describe.blocks.length; ++j) {
var it = describe.blocks[j];
mdOutput += '#### It ' + it.contents + '\n\n';
mdOutput += it.comments[0] ?
acquit.trimEachLine(it.comments[0]) + '\n\n' :
'';
mdOutput += '```javascript\n';
mdOutput += ' ' + it.code + '\n';
mdOutput += '```\n\n';
}
}
require('fs').writeFileSync('README.md', mdOutput);