Skip to content

Commit

Permalink
Merge pull request #39 from bumble-tech/1.x.x
Browse files Browse the repository at this point in the history
1.x.x
  • Loading branch information
shcherbanich authored Oct 6, 2023
2 parents c72b131 + a019131 commit 7fad5c7
Show file tree
Hide file tree
Showing 57 changed files with 532 additions and 757 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ composer.phar
/.phpunit.result.cache
/demo/demo2-templates-generation/templates/
/.bumbleDocGenCache/
/demo/demo5-config-array/docs/
/demo/demo5-config-array/.cache/
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bumble-tech/bumble-doc-gen",
"description": "Documentation generator next to the code for large and small php projects",
"type": "project",
"type": "library",
"license": "Apache-2.0",
"keywords": ["documentation-generator", "phpdoc", "cli-tool", "documentation", "docs", "llms", "chatgpt", "php"],
"homepage": "https://github.com/bumble-tech/bumble-doc-gen",
Expand Down Expand Up @@ -31,7 +31,6 @@
"symfony/cache": "^6.0",
"symfony/event-dispatcher": "^6.0",
"php-di/php-di": "^7.0",
"ocramius/proxy-manager": "~2.0",
"symfony/yaml": "^6.0",
"hassankhan/config": "^3.1",
"tectalic/openai": "^1.5",
Expand Down
366 changes: 80 additions & 286 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions demo/demo1/demoScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
try {
$docGen = (new \BumbleDocGen\DocGeneratorFactory())->create(__DIR__ . '/demo-config.yaml');
$docGen->generate();
} catch (\Exception|\Psr\Cache\InvalidArgumentException $e) {
} catch (\Exception | \Psr\Cache\InvalidArgumentException $e) {
die($e->getMessage());
}
}
4 changes: 2 additions & 2 deletions demo/demo2-templates-generation/demoScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
try {
$docGen = (new \BumbleDocGen\DocGeneratorFactory())->create(__DIR__ . '/demo-config.yaml');
$docGen->generateProjectTemplatesStructure();
} catch (\Exception|\Psr\Cache\InvalidArgumentException $e) {
} catch (\Exception | \Psr\Cache\InvalidArgumentException $e) {
die($e->getMessage());
}
}
4 changes: 2 additions & 2 deletions demo/demo3-add-missing-doc-blocks/demoScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
try {
$docGen = (new \BumbleDocGen\DocGeneratorFactory())->create(__DIR__ . '/demo-config.yaml');
$docGen->addMissingDocBlocks();
} catch (\Exception|\Psr\Cache\InvalidArgumentException $e) {
} catch (\Exception | \Psr\Cache\InvalidArgumentException $e) {
die($e->getMessage());
}
}
4 changes: 2 additions & 2 deletions demo/demo4-generating-readme-file/demoScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
try {
$docGen = (new \BumbleDocGen\DocGeneratorFactory())->create(__DIR__ . '/demo-config.yaml');
$docGen->fillInReadmeMdTemplate();
} catch (\Exception|\Psr\Cache\InvalidArgumentException $e) {
} catch (\Exception | \Psr\Cache\InvalidArgumentException $e) {
die($e->getMessage());
}
}
40 changes: 40 additions & 0 deletions demo/demo5-config-array/demoScript.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env php
<?php

ini_set('memory_limit', '-1');

require_once __DIR__ . '/../../vendor/autoload.php';

try {
$docGen = (new \BumbleDocGen\DocGeneratorFactory())
->createByConfigArray([
'project_root' => '%WORKING_DIR%/vendor/doctrine',
'demo_dir' => '%WORKING_DIR%/demo/demo5-config-array', // <= custom parameter
'cache_dir' => '%demo_dir%/.cache',
'templates_dir' => '%demo_dir%/templates',
'output_dir' => "%demo_dir%/docs",
'output_dir_base_url' => "%demo_dir%/docs",
'check_file_in_git_before_creating_doc' => false,
'language_handlers' => [
'php' => [
'class' => \BumbleDocGen\LanguageHandler\Php\PhpHandler::class,
'settings' => [
'async_source_loading_enabled' => true,
],
]
],
'source_locators' => [
[
'class' => \BumbleDocGen\Core\Parser\SourceLocator\RecursiveDirectoriesSourceLocator::class,
'arguments' => [
'directories' => [
'%project_root%'
]
]
]
],
]);
$docGen->generate();
} catch (\Exception | \Psr\Cache\InvalidArgumentException $e) {
die($e->getMessage());
}
9 changes: 9 additions & 0 deletions demo/demo5-config-array/templates/README.md.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% set title = 'Demo 5' %}

{{ "Demo 5" | textToHeading('H1') }}

{{ printEntityCollectionAsList( phpClassEntityCollection.filterByPaths(['/annotations']) ) }}

To update this documentation, run the following command:

{{ 'php demo/demo5-config-array/demoScript.php' | textToCodeBlock('console') }}
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ $factory = new DocGeneratorFactory();
// Create a DocGenerator instance
$docgen = $factory->create('/path/to/configuration/files');

// or $docgen = $factory->createByConfigArray([...]);

// Now call the desired operation
$docgen->generate();
```
Expand Down Expand Up @@ -93,4 +95,4 @@ To update this documentation, run the following command:

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sun Sep 10 17:47:00 2023 +0300<br><b>Page content update date:</b> Thu Sep 28 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Thu Oct 5 17:42:06 2023 +0300<br><b>Page content update date:</b> Fri Oct 06 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
15 changes: 0 additions & 15 deletions docs/_config.yml

This file was deleted.

82 changes: 0 additions & 82 deletions docs/_layouts/default.html

This file was deleted.

25 changes: 15 additions & 10 deletions docs/classes/DocGenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<embed> <a href="/docs/README.md">BumbleDocGen</a> <b>/</b> DocGenerator<hr> </embed>

<h1>
<a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L33">DocGenerator</a> class:
<a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L34">DocGenerator</a> class:
</h1>


Expand Down Expand Up @@ -55,11 +55,11 @@ final class DocGenerator
<ul>
<li><a name="qlog-file-name"
href="#qlog-file-name">#</a>
<code>LOG_FILE_NAME</code> <b>|</b> <a href="/src/DocGenerator.php#L36">source
<code>LOG_FILE_NAME</code> <b>|</b> <a href="/src/DocGenerator.php#L37">source
code</a> </li>
<li><a name="qversion"
href="#qversion">#</a>
<code>VERSION</code> <b>|</b> <a href="/src/DocGenerator.php#L35">source
<code>VERSION</code> <b>|</b> <a href="/src/DocGenerator.php#L36">source
code</a> </li>
</ul>

Expand All @@ -74,11 +74,11 @@ final class DocGenerator
<ul>
<li><a name="m-construct" href="#m-construct">#</a>
<b>__construct</b>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L38">source code</a></li>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L39">source code</a></li>
</ul>

```php
public function __construct(\Symfony\Component\Filesystem\Filesystem $fs, \Symfony\Component\Console\Style\OutputStyle $io, \BumbleDocGen\Core\Configuration\Configuration $configuration, \BumbleDocGen\Core\Parser\ProjectParser $parser, \BumbleDocGen\LanguageHandler\Php\Parser\ParserHelper $parserHelper, \BumbleDocGen\Core\Renderer\Renderer $renderer, \BumbleDocGen\Core\Parser\Entity\RootEntityCollectionsGroup $rootEntityCollectionsGroup, \Monolog\Logger $logger);
public function __construct(\Symfony\Component\Filesystem\Filesystem $fs, \Symfony\Component\Console\Style\OutputStyle $io, \BumbleDocGen\Core\Configuration\Configuration $configuration, \BumbleDocGen\Core\Plugin\PluginEventDispatcher $pluginEventDispatcher, \BumbleDocGen\Core\Parser\ProjectParser $parser, \BumbleDocGen\LanguageHandler\Php\Parser\ParserHelper $parserHelper, \BumbleDocGen\Core\Renderer\Renderer $renderer, \BumbleDocGen\Core\Parser\Entity\RootEntityCollectionsGroup $rootEntityCollectionsGroup, \Monolog\Logger $logger);
```


Expand Down Expand Up @@ -108,6 +108,11 @@ public function __construct(\Symfony\Component\Filesystem\Filesystem $fs, \Symfo
<td>$configuration</td>
<td><a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/Core/Configuration/Configuration.php'>\BumbleDocGen\Core\Configuration\Configuration</a></td>
<td>-</td>
</tr>
<tr>
<td>$pluginEventDispatcher</td>
<td><a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/Core/Plugin/PluginEventDispatcher.php'>\BumbleDocGen\Core\Plugin\PluginEventDispatcher</a></td>
<td>-</td>
</tr>
<tr>
<td>$parser</td>
Expand Down Expand Up @@ -146,7 +151,7 @@ public function __construct(\Symfony\Component\Filesystem\Filesystem $fs, \Symfo
<ul>
<li><a name="maddmissingdocblocks" href="#maddmissingdocblocks">#</a>
<b>addMissingDocBlocks</b>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L134">source code</a></li>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L140">source code</a></li>
</ul>

```php
Expand Down Expand Up @@ -186,7 +191,7 @@ public function addMissingDocBlocks(): void;
<ul>
<li><a name="mfillinreadmemdtemplate" href="#mfillinreadmemdtemplate">#</a>
<b>fillInReadmeMdTemplate</b>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L223">source code</a></li>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L229">source code</a></li>
</ul>

```php
Expand Down Expand Up @@ -226,7 +231,7 @@ public function fillInReadmeMdTemplate(): void;
<ul>
<li><a name="mgenerate" href="#mgenerate">#</a>
<b>generate</b>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L305">source code</a></li>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L311">source code</a></li>
</ul>

```php
Expand Down Expand Up @@ -254,7 +259,7 @@ public function generate(): void;
<ul>
<li><a name="mgenerateprojecttemplatesstructure" href="#mgenerateprojecttemplatesstructure">#</a>
<b>generateProjectTemplatesStructure</b>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L73">source code</a></li>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L79">source code</a></li>
</ul>

```php
Expand Down Expand Up @@ -294,7 +299,7 @@ public function generateProjectTemplatesStructure(): void;
<ul>
<li><a name="mparseandgetrootentitycollectionsgroup" href="#mparseandgetrootentitycollectionsgroup">#</a>
<b>parseAndGetRootEntityCollectionsGroup</b>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L58">source code</a></li>
<b>|</b> <a href="https://github.com/bumble-tech/bumble-doc-gen/blob/master/src/DocGenerator.php#L64">source code</a></li>
</ul>

```php
Expand Down
Loading

0 comments on commit 7fad5c7

Please sign in to comment.