use BookStack\Entities\Queries\ChapterQueries;
use BookStack\Exports\ExportFormatter;
+use BookStack\Exports\ZipExports\ZipExportBuilder;
use BookStack\Http\ApiController;
use Throwable;
return $this->download()->directly($markdown, $chapter->slug . '.md');
}
+
+ public function exportZip(int $id, ZipExportBuilder $builder)
+ {
+ $chapter = $this->queries->findVisibleByIdOrFail($id);
+ $zip = $builder->buildForChapter($chapter);
+
+ return $this->download()->streamedFileDirectly($zip, $chapter->slug . '.zip', true);
+ }
}