mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
low dash: Cleanup repo and add submodules. [jddalton]
This commit is contained in:
35
doc/parse.php
Normal file
35
doc/parse.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
// cleanup requested filepath
|
||||
$file = isset($_GET['f']) ? $_GET['f'] : 'lowdash';
|
||||
$file = preg_replace('#(\.*[\/])+#', '', $file);
|
||||
$file .= preg_match('/\.[a-z]+$/', $file) ? '' : '.js';
|
||||
|
||||
// output filename
|
||||
if (isset($_GET['o'])) {
|
||||
$output = $_GET['o'];
|
||||
} else if (isset($_SERVER['argv'][1])) {
|
||||
$output = $_SERVER['argv'][1];
|
||||
} else {
|
||||
$output = basename($file);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
require('../vendor/docdown/docdown.php');
|
||||
|
||||
// generate Markdown
|
||||
$markdown = docdown(array(
|
||||
'path' => '../' . $file,
|
||||
'title' => 'LowDash.js <sup>v0.1.0</sup>',
|
||||
'url' => 'https://github.com/bestiejs/lowdash/blob/master/lowdash.js'
|
||||
));
|
||||
|
||||
// save to a .md file
|
||||
file_put_contents($output . '.md', $markdown);
|
||||
|
||||
// print
|
||||
header('Content-Type: text/plain;charset=utf-8');
|
||||
echo $markdown . PHP_EOL;
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user