Skip to content

Commit

Permalink
Merge pull request #49 from bumble-tech/removing_empty_doc_dirs
Browse files Browse the repository at this point in the history
Removing empty doc dirs
  • Loading branch information
shcherbanich authored Oct 16, 2023
2 parents 5196a66 + 7e553bd commit 4c3d161
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,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> Thu Oct 5 17:42:06 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/shared_c.cache

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech/1.configuration/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ The inheritance algorithm is as follows: scalar types can be overwritten by each

<div id='page_committer_info'>
<hr>
<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 13 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> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/2.parser/entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ These classes are a convenient wrapper for accessing data in templates:

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/2.parser/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ In this section, we show how the parser works and what components it consists of

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/2.parser/sourceLocator.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ You can create your own source locators or use any existing ones. All source loc
<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sat Sep 2 21:09:56 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sat Sep 2 21:09:56 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/01_templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ Result after starting the documentation generation process:

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/02_breadcrumbs.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Here is an example of the result of the `generatePageBreadcrumbs` function:

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/03_documentStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ plugins:
<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/04_twigCustomFilters.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,4 @@ Here is a list of filters available by default:
<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/05_twigCustomFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,4 @@ Here is a list of functions available by default:

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Fri Oct 13 18:40:45 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ This process is presented in the form of a diagram below.

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/templatesDynamicBlocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ You can use the built-in functions and filters or add your own, so you can imple

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/templatesLinking.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ You can also implement your own functions for relinking if necessary.

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/3.renderer/templatesVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ There are several variables available in each processed template.

<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/4.pluginSystem/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ plugins:
<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich &lt;[email protected]&gt;<br><b>Last modified date:</b> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Fri Oct 13 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> Sat Sep 2 21:01:47 2023 +0300<br><b>Page content update date:</b> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
2 changes: 1 addition & 1 deletion docs/tech/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ After that, the process of parsing the project code according to the configurati

<div id='page_committer_info'>
<hr>
<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 13 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> Sun Oct 15 2023<br>Made with <a href='https://github.com/bumble-tech/bumble-doc-gen/blob/master/docs/README.md'>Bumble Documentation Generator</a></div>
6 changes: 5 additions & 1 deletion src/Core/Renderer/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ public function run(): void
$this->pluginEventDispatcher->dispatch(new AfterRenderingEntities());

foreach ($this->renderIteratorFactory->getFilesToRemove() as $file) {
if (!$file->isWritable()) {
continue;
}
$type = $file->getType();
$this->fs->remove($file->getPathname());
$this->logger->info("Removing `{$file->getPathname()}` file");
$this->logger->info("Removing `{$file->getPathname()}` {$type}");
}

$this->rootEntityCollectionsGroup->updateAllEntitiesCache();
Expand Down
15 changes: 15 additions & 0 deletions src/Core/Renderer/RendererIteratorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,21 @@ public function getFilesToRemove(): \Generator
}
yield $docFile;
}

// check empty directories
$finder = Finder::create()
->in($outputFolder)
->ignoreDotFiles(true)
->ignoreUnreadableDirs()
->directories();

$dirs = [];
foreach ($finder as $dir) {
if (!Finder::create()->in($dir->getRealPath())->files()->count()) {
$dirs[] = $dir;
}
}
yield from $dirs;
}

private function isInternalCachingVersionChanged(): bool
Expand Down

0 comments on commit 4c3d161

Please sign in to comment.