mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
ZIP Exports: Reorganised files, added page md parsing
This commit is contained in:
@@ -6,7 +6,7 @@ use BookStack\Entities\Queries\PageQueries;
|
|||||||
use BookStack\Entities\Tools\PageContent;
|
use BookStack\Entities\Tools\PageContent;
|
||||||
use BookStack\Exceptions\NotFoundException;
|
use BookStack\Exceptions\NotFoundException;
|
||||||
use BookStack\Exports\ExportFormatter;
|
use BookStack\Exports\ExportFormatter;
|
||||||
use BookStack\Exports\ZipExportBuilder;
|
use BookStack\Exports\ZipExports\ZipExportBuilder;
|
||||||
use BookStack\Http\Controller;
|
use BookStack\Http\Controller;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports\ZipExportModels;
|
namespace BookStack\Exports\ZipExports\Models;
|
||||||
|
|
||||||
use BookStack\Exports\ZipExportFiles;
|
use BookStack\Exports\ZipExports\ZipExportFiles;
|
||||||
use BookStack\Uploads\Attachment;
|
use BookStack\Uploads\Attachment;
|
||||||
|
|
||||||
class ZipExportAttachment extends ZipExportModel
|
class ZipExportAttachment extends ZipExportModel
|
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports\ZipExportModels;
|
namespace BookStack\Exports\ZipExports\Models;
|
||||||
|
|
||||||
use BookStack\Exports\ZipExportFiles;
|
use BookStack\Exports\ZipExports\ZipExportFiles;
|
||||||
use BookStack\Uploads\Image;
|
use BookStack\Uploads\Image;
|
||||||
|
|
||||||
class ZipExportImage extends ZipExportModel
|
class ZipExportImage extends ZipExportModel
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports\ZipExportModels;
|
namespace BookStack\Exports\ZipExports\Models;
|
||||||
|
|
||||||
use JsonSerializable;
|
use JsonSerializable;
|
||||||
|
|
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports\ZipExportModels;
|
namespace BookStack\Exports\ZipExports\Models;
|
||||||
|
|
||||||
use BookStack\Entities\Models\Page;
|
use BookStack\Entities\Models\Page;
|
||||||
use BookStack\Entities\Tools\PageContent;
|
use BookStack\Entities\Tools\PageContent;
|
||||||
use BookStack\Exports\ZipExportFiles;
|
use BookStack\Exports\ZipExports\ZipExportFiles;
|
||||||
|
|
||||||
class ZipExportPage extends ZipExportModel
|
class ZipExportPage extends ZipExportModel
|
||||||
{
|
{
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports\ZipExportModels;
|
namespace BookStack\Exports\ZipExports\Models;
|
||||||
|
|
||||||
use BookStack\Activity\Models\Tag;
|
use BookStack\Activity\Models\Tag;
|
||||||
|
|
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports;
|
namespace BookStack\Exports\ZipExports;
|
||||||
|
|
||||||
use BookStack\Entities\Models\Page;
|
use BookStack\Entities\Models\Page;
|
||||||
use BookStack\Exceptions\ZipExportException;
|
use BookStack\Exceptions\ZipExportException;
|
||||||
use BookStack\Exports\ZipExportModels\ZipExportPage;
|
use BookStack\Exports\ZipExports\Models\ZipExportPage;
|
||||||
use ZipArchive;
|
use ZipArchive;
|
||||||
|
|
||||||
class ZipExportBuilder
|
class ZipExportBuilder
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports;
|
namespace BookStack\Exports\ZipExports;
|
||||||
|
|
||||||
use BookStack\Uploads\Attachment;
|
use BookStack\Uploads\Attachment;
|
||||||
use BookStack\Uploads\AttachmentService;
|
use BookStack\Uploads\AttachmentService;
|
@@ -1,13 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports;
|
namespace BookStack\Exports\ZipExports;
|
||||||
|
|
||||||
use BookStack\App\Model;
|
use BookStack\App\Model;
|
||||||
use BookStack\Entities\Models\Page;
|
use BookStack\Exports\ZipExports\Models\ZipExportAttachment;
|
||||||
use BookStack\Exports\ZipExportModels\ZipExportAttachment;
|
use BookStack\Exports\ZipExports\Models\ZipExportImage;
|
||||||
use BookStack\Exports\ZipExportModels\ZipExportImage;
|
use BookStack\Exports\ZipExports\Models\ZipExportModel;
|
||||||
use BookStack\Exports\ZipExportModels\ZipExportModel;
|
use BookStack\Exports\ZipExports\Models\ZipExportPage;
|
||||||
use BookStack\Exports\ZipExportModels\ZipExportPage;
|
|
||||||
use BookStack\Uploads\Attachment;
|
use BookStack\Uploads\Attachment;
|
||||||
use BookStack\Uploads\Image;
|
use BookStack\Uploads\Image;
|
||||||
|
|
||||||
@@ -44,12 +43,16 @@ class ZipExportReferences
|
|||||||
|
|
||||||
public function buildReferences(ZipExportFiles $files): void
|
public function buildReferences(ZipExportFiles $files): void
|
||||||
{
|
{
|
||||||
// TODO - Parse page MD & HTML
|
// Parse page content first
|
||||||
foreach ($this->pages as $page) {
|
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);
|
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');
|
// dd('end');
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace BookStack\Exports;
|
namespace BookStack\Exports\ZipExports;
|
||||||
|
|
||||||
use BookStack\App\Model;
|
use BookStack\App\Model;
|
||||||
use BookStack\Entities\Queries\EntityQueries;
|
use BookStack\Entities\Queries\EntityQueries;
|
Reference in New Issue
Block a user