forked from gushphp/gush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_docu
43 lines (34 loc) · 973 Bytes
/
generate_docu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env php
<?php
/**
* This file is part of Gush.
*
* (c) Luis Cordova <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\BufferedOutput;
require_once __DIR__.'/vendor/autoload.php';
$app = new Gush\Application();
$app->setAutoExit(false);
foreach ($app->getCommands() as $command) {
$output = new BufferedOutput();
$input = new StringInput(sprintf('%s --help --format md', $command->getName()));
$app->run($input, $output);
$header = <<<EOT
---
layout: docu-page
full_title: "Gush: Rapid workflow for project maintainers and contributors"
---
{% block content %}
EOT;
$footer = <<<EOT
{% endblock content %}
EOT;
file_put_contents(
'web/'.$command->getName().'.md',
sprintf("%s\n%s\n%s", $header, $output->fetch(), $footer)
);
}