Skip to content

Commit

Permalink
fix: generate doc case (#133)
Browse files Browse the repository at this point in the history
Co-authored-by: rhyd42 <rhydian.roberts@chinasearch.co.uk>
  • Loading branch information
Jean-Beru and rhyd42 authored Jan 7, 2025
1 parent ee33766 commit 884eb43
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: 'Check documentation'
run: |
DIFF=$(git diff --name-only)
DIFF=$(git status --short --renames)
if [[ $DIFF != '' ]]; then
echo "::warning::Builders API documentation is not up to date. Please run \"php ./docs/generate.php\""
echo "::warning::$DIFF"
Expand Down
18 changes: 9 additions & 9 deletions docs/builders_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Pdf

* [HtmlPdfBuilder](./Pdf/builders_api/HtmlPdfBuilder.md)
* [UrlPdfBuilder](./Pdf/builders_api/UrlPdfBuilder.md)
* [MarkdownPdfBuilder](./Pdf/builders_api/MarkdownPdfBuilder.md)
* [LibreOfficePdfBuilder](./Pdf/builders_api/LibreOfficePdfBuilder.md)
* [MergePdfBuilder](./Pdf/builders_api/MergePdfBuilder.md)
* [ConvertPdfBuilder](./Pdf/builders_api/ConvertPdfBuilder.md)
* [HtmlPdfBuilder](./pdf/builders_api/HtmlPdfBuilder.md)
* [UrlPdfBuilder](./pdf/builders_api/UrlPdfBuilder.md)
* [MarkdownPdfBuilder](./pdf/builders_api/MarkdownPdfBuilder.md)
* [LibreOfficePdfBuilder](./pdf/builders_api/LibreOfficePdfBuilder.md)
* [MergePdfBuilder](./pdf/builders_api/MergePdfBuilder.md)
* [ConvertPdfBuilder](./pdf/builders_api/ConvertPdfBuilder.md)

## Screenshot

* [HtmlScreenshotBuilder](./Screenshot/builders_api/HtmlScreenshotBuilder.md)
* [UrlScreenshotBuilder](./Screenshot/builders_api/UrlScreenshotBuilder.md)
* [MarkdownScreenshotBuilder](./Screenshot/builders_api/MarkdownScreenshotBuilder.md)
* [HtmlScreenshotBuilder](./screenshot/builders_api/HtmlScreenshotBuilder.md)
* [UrlScreenshotBuilder](./screenshot/builders_api/UrlScreenshotBuilder.md)
* [MarkdownScreenshotBuilder](./screenshot/builders_api/MarkdownScreenshotBuilder.md)

6 changes: 3 additions & 3 deletions docs/generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
* @var array<string, non-empty-list<class-string>>
*/
const BUILDERS = [
'Pdf' => [
'pdf' => [
HtmlPdfBuilder::class,
UrlPdfBuilder::class,
MarkdownPdfBuilder::class,
LibreOfficePdfBuilder::class,
MergePdfBuilder::class,
ConvertPdfBuilder::class,
],
'Screenshot' => [
'screenshot' => [
HtmlScreenshotBuilder::class,
UrlScreenshotBuilder::class,
MarkdownScreenshotBuilder::class,
Expand Down Expand Up @@ -147,7 +147,7 @@ function saveFile(InputInterface $input, string $filename, string $contents): vo
throw new RuntimeException(\sprintf('Directory "%s" was not created', $directory));
}

$summary .= "## {$type}\n\n";
$summary .= '## '.ucfirst($type)."\n\n";

foreach ($builderClasses as $pdfBuilder) {
$reflectionClass = new ReflectionClass($pdfBuilder);
Expand Down
3 changes: 3 additions & 0 deletions docs/pdf/builders_api/HtmlPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Overrides the default margins (e.g., 0.39), in inches.
* `preferCssPageSize(bool $bool)`:
Define whether to prefer page size as defined by CSS. (Default false).

* `generateDocumentOutline(bool $bool)`:
Define whether the document outline should be embedded into the PDF. (Default false).

* `printBackground(bool $bool)`:
Prints the background graphics. (Default false).

Expand Down
3 changes: 3 additions & 0 deletions docs/pdf/builders_api/MarkdownPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Overrides the default margins (e.g., 0.39), in inches.
* `preferCssPageSize(bool $bool)`:
Define whether to prefer page size as defined by CSS. (Default false).

* `generateDocumentOutline(bool $bool)`:
Define whether the document outline should be embedded into the PDF. (Default false).

* `printBackground(bool $bool)`:
Prints the background graphics. (Default false).

Expand Down
3 changes: 3 additions & 0 deletions docs/pdf/builders_api/UrlPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Overrides the default margins (e.g., 0.39), in inches.
* `preferCssPageSize(bool $bool)`:
Define whether to prefer page size as defined by CSS. (Default false).

* `generateDocumentOutline(bool $bool)`:
Define whether the document outline should be embedded into the PDF. (Default false).

* `printBackground(bool $bool)`:
Prints the background graphics. (Default false).

Expand Down

0 comments on commit 884eb43

Please sign in to comment.