mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-29 23:22:34 +01:00
ZIP Exports: Reorganised files, added page md parsing
This commit is contained in:
parent
4fb4fe0931
commit
f732ef05d5
@ -6,7 +6,7 @@ use BookStack\Entities\Queries\PageQueries;
|
||||
use BookStack\Entities\Tools\PageContent;
|
||||
use BookStack\Exceptions\NotFoundException;
|
||||
use BookStack\Exports\ExportFormatter;
|
||||
use BookStack\Exports\ZipExportBuilder;
|
||||
use BookStack\Exports\ZipExports\ZipExportBuilder;
|
||||
use BookStack\Http\Controller;
|
||||
use Throwable;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports\ZipExportModels;
|
||||
namespace BookStack\Exports\ZipExports\Models;
|
||||
|
||||
use BookStack\Exports\ZipExportFiles;
|
||||
use BookStack\Exports\ZipExports\ZipExportFiles;
|
||||
use BookStack\Uploads\Attachment;
|
||||
|
||||
class ZipExportAttachment extends ZipExportModel
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports\ZipExportModels;
|
||||
namespace BookStack\Exports\ZipExports\Models;
|
||||
|
||||
use BookStack\Exports\ZipExportFiles;
|
||||
use BookStack\Exports\ZipExports\ZipExportFiles;
|
||||
use BookStack\Uploads\Image;
|
||||
|
||||
class ZipExportImage extends ZipExportModel
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports\ZipExportModels;
|
||||
namespace BookStack\Exports\ZipExports\Models;
|
||||
|
||||
use JsonSerializable;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports\ZipExportModels;
|
||||
namespace BookStack\Exports\ZipExports\Models;
|
||||
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Entities\Tools\PageContent;
|
||||
use BookStack\Exports\ZipExportFiles;
|
||||
use BookStack\Exports\ZipExports\ZipExportFiles;
|
||||
|
||||
class ZipExportPage extends ZipExportModel
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports\ZipExportModels;
|
||||
namespace BookStack\Exports\ZipExports\Models;
|
||||
|
||||
use BookStack\Activity\Models\Tag;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports;
|
||||
namespace BookStack\Exports\ZipExports;
|
||||
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Exceptions\ZipExportException;
|
||||
use BookStack\Exports\ZipExportModels\ZipExportPage;
|
||||
use BookStack\Exports\ZipExports\Models\ZipExportPage;
|
||||
use ZipArchive;
|
||||
|
||||
class ZipExportBuilder
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports;
|
||||
namespace BookStack\Exports\ZipExports;
|
||||
|
||||
use BookStack\Uploads\Attachment;
|
||||
use BookStack\Uploads\AttachmentService;
|
@ -1,13 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports;
|
||||
namespace BookStack\Exports\ZipExports;
|
||||
|
||||
use BookStack\App\Model;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Exports\ZipExportModels\ZipExportAttachment;
|
||||
use BookStack\Exports\ZipExportModels\ZipExportImage;
|
||||
use BookStack\Exports\ZipExportModels\ZipExportModel;
|
||||
use BookStack\Exports\ZipExportModels\ZipExportPage;
|
||||
use BookStack\Exports\ZipExports\Models\ZipExportAttachment;
|
||||
use BookStack\Exports\ZipExports\Models\ZipExportImage;
|
||||
use BookStack\Exports\ZipExports\Models\ZipExportModel;
|
||||
use BookStack\Exports\ZipExports\Models\ZipExportPage;
|
||||
use BookStack\Uploads\Attachment;
|
||||
use BookStack\Uploads\Image;
|
||||
|
||||
@ -44,12 +43,16 @@ class ZipExportReferences
|
||||
|
||||
public function buildReferences(ZipExportFiles $files): void
|
||||
{
|
||||
// TODO - Parse page MD & HTML
|
||||
// Parse page content first
|
||||
foreach ($this->pages as $page) {
|
||||
$page->html = $this->parser->parse($page->html ?? '', function (Model $model) use ($files, $page) {
|
||||
$handler = function (Model $model) use ($files, $page) {
|
||||
return $this->handleModelReference($model, $page, $files);
|
||||
});
|
||||
// TODO - markdown
|
||||
};
|
||||
|
||||
$page->html = $this->parser->parse($page->html ?? '', $handler);
|
||||
if ($page->markdown) {
|
||||
$page->markdown = $this->parser->parse($page->markdown, $handler);
|
||||
}
|
||||
}
|
||||
|
||||
// dd('end');
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Exports;
|
||||
namespace BookStack\Exports\ZipExports;
|
||||
|
||||
use BookStack\App\Model;
|
||||
use BookStack\Entities\Queries\EntityQueries;
|
Loading…
Reference in New Issue
Block a user