Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: support images in markdown #251

Merged
merged 6 commits into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ RUN \
--mount=type=cache,target=/root/.composer,id=composer \
composer install

FROM development AS test-output-builder

COPY --link ./test/fixture/templates /docs-src/templates
COPY --link ./test/fixture/docbook /docs-src/book
COPY --link ./test/fixture/feature /docs-src/features
RUN bin/docbook-tool --html --pdf

FROM scratch AS test-output

COPY --from=test-output-builder /docs-package /

FROM development AS tested

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ cs: build ## Run coding standards checks
static-analysis: build ## Run the static analysis checks
docker run --rm --entrypoint=php ghcr.io/roave/docbooktool:test-image vendor/bin/psalm

test-output: ## Write the test fixture outputs to build/ directory - useful for manual visual inspection
rm -Rf build
mkdir -p build
docker buildx build --output=build --target=test-output --tag=ghcr.io/roave/docbooktool:test-image .

production: ## Build and tag a production image
docker buildx build --load --target=production --tag=ghcr.io/roave/docbooktool:latest .
2 changes: 2 additions & 0 deletions bin/docbook-tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Monolog\Logger;
use Roave\DocbookTool\Formatter\AggregatePageFormatter;
use Roave\DocbookTool\Formatter\ExtractFrontMatter;
use Roave\DocbookTool\Formatter\InlineExternalImages;
use Roave\DocbookTool\Formatter\InlineFeatureFile;
use Roave\DocbookTool\Formatter\MarkdownToHtml;
use Roave\DocbookTool\Formatter\RenderPlantUmlDiagramInline;
Expand Down Expand Up @@ -40,6 +41,7 @@

$pageFormatters = [
new ExtractFrontMatter(),
new InlineExternalImages($contentPath),
new RenderPlantUmlDiagramInline(),
new MarkdownToHtml(),
];
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<file>bin</file>
<file>src</file>
<file>test/unit</file>
<file>test/integration</file>

<rule ref="Doctrine">
Expand Down
1 change: 1 addition & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<projectFiles>
<directory name="src" />
<directory name="bin" />
<directory name="test/unit" />
<directory name="test/integration" />
<ignoreFiles>
<directory name="vendor" />
Expand Down
44 changes: 44 additions & 0 deletions src/Formatter/InlineExternalImages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

declare(strict_types=1);

namespace Roave\DocbookTool\Formatter;

use Roave\DocbookTool\DocbookPage;
use RuntimeException;

use function base64_encode;
use function preg_replace_callback;
use function Safe\file_get_contents;
use function sprintf;

final class InlineExternalImages implements PageFormatter
{
public function __construct(private readonly string $docbookPath)
{
}

/** @throws RuntimeException */
public function __invoke(DocbookPage $page): DocbookPage
{
return $page->withReplacedContent(
preg_replace_callback(
'/!\[([\w\W]+)]\(([\w\W]*?)\)/',
function (array $m) {
/** @var array{1: string, 2: string} $m */
$altText = $m[1];
$imagePath = $m[2];

$imageContent = file_get_contents($this->docbookPath . '/' . $imagePath);

return sprintf(
'![%s](data:image/png;base64,%s)',
asgrim marked this conversation as resolved.
Show resolved Hide resolved
$altText,
base64_encode($imageContent),
);
},
$page->content(),
),
);
}
}
Binary file added test/fixture/docbook/smile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions test/fixture/docbook/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ Bob->Alice : hello
hexagon TestingHexagon
@enduml
```

## An image
Ocramius marked this conversation as resolved.
Show resolved Hide resolved

Here is an image:

![A smiley face](./smile.png)

It was hand drawn, that's why it looks rubbish.
8 changes: 8 additions & 0 deletions test/fixture/expectations/out.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ <h2>A diagram</h2>

<p><img src="data:image/png;base64,iVBORw%s" alt="Diagram" /></p>

<h2>An image</h2>

<p>Here is an image:</p>

<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABHNCSVQICAgIfAhkiAAACkFJREFUeJztnU1sG8cZht9d1aYkcpf0WaeoaAEXjdBTnVNICjoEBar40sB2AqOQf+BDgTo9KEFRC0h6kC51ldxUahn7YFJ2fXDFokAKdbnrHir14EPaXFSoLdqbL7ZIyY1ah9ODQIXizuzOzM7+UNID7GW588N59/u+2dnZGY0QQnBCatCTrsAJh0m9INVqFfl8HpqmBR6maaJarSZd5XCQlPH06VPy8OFDcvnyZTI8PEwAhDoMwyCWZSX9t7hJjSCu65J8Ph9agEEXRyMkHUHdMAzs7OzEUpZpmlhdXUWxWIylPBESjSGu68I0TWiaFpsYANBqtVAqlaBpGgqFQrriTlKmads20XWd292MjIyQGzdukCdPnlDzsywrtMszDIM4jhNzSxwmdkEcxyGGYXA30ujoKJmfnyftdlu4LMuyhMoCQDRNI5VKJYJ/zkesgiwsLCTWKJVKRcgiTdNMxFpiEaRer5OhoaHE3YbjOEJuTdd1Ytt2JHVhEakgvO4piT9OyL5Ly+VyqapbZILwBu00BFLHcYhpmr71rNVqsdQlEkFqtVqgEENDQ6Rer0dRvDR+cUbXdbK5uRl5HZQLYtt2oBjz8/Oqi1WGn2WPjY1FLopSQRzH8XVTaXBPPPjdVJlMJtKYolQQPz+cRNAOQ61W83VfUf0fZYL43VVxBUTVbG5ukrGxMaalROG+lAji56oGzTL62dzcJJlMJjb3pUQQlqsyDENF9onjF+hVu6/QgrBcla7rAxHAebFtm2kpKv9rKEH87pxBd1U0/NyXaZ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rrBxw2aGLSJ2FIbS6ruBh8HaG3mOI4n9kq9D6EpG6YbfNRheQ9qR0hlgDqOS8XywFook4b0Xrh+3WCZ5ZuOMiKTraVf4TYaDei6N3mn0wn1wHiUePz4MXI5+kMvc9JDGFMM2lfjOC6u3IvMvipK9g/x2wjMNE3ium7YYgYO1tKxgP8iy0qWaAgSJZvNqihmYPAb1QhaBVzppmBBW+ap2F9jEGBtN5vNZgO9hfJ9DIO2MO2K02jIrySdRoI2PuZdHz+SrVez2WygKJqmkbm5ObK3txdFFWKFZ99f3gWVIxHEdV0uSxl0d8a7G7bI7hGRbt9tWRZXhQdRmEqlQt0Vgdb9F1luPJYN7kWF6R75fD4VAgXFB7/6i679HosgXfb29sjc3BzXnZWk5cgK0LWIMON5sQrSpdFoSFlMlMJYliUtQm/9wm5uk4ggvci6M9qRy+XI7Ows2draOsg7bCPzHKZppmOnT5XE1XgqjygsNjWC9KPSclQdMkFalNQK0iVJYeIQoJ/UC9IlDpeWhm72wAgSxNbWFpmdnSW5XC51jSzC/wEvgKtVO799vwAAAABJRU5ErkJggg==" alt="A smiley face" /></p>

<p>It was hand drawn, that's why it looks rubbish.</p>

<br />
</section>
</div>
Expand Down
2 changes: 2 additions & 0 deletions test/integration/DocbookToolGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Psr\Log\NullLogger;
use Roave\DocbookTool\Formatter\AggregatePageFormatter;
use Roave\DocbookTool\Formatter\ExtractFrontMatter;
use Roave\DocbookTool\Formatter\InlineExternalImages;
use Roave\DocbookTool\Formatter\InlineFeatureFile;
use Roave\DocbookTool\Formatter\MarkdownToHtml;
use Roave\DocbookTool\Formatter\RenderPlantUmlDiagramInline;
Expand Down Expand Up @@ -47,6 +48,7 @@ public function testGeneration(): void
[
new AggregatePageFormatter([
new ExtractFrontMatter(),
new InlineExternalImages(self::CONTENT_PATH),
new RenderPlantUmlDiagramInline(),
new MarkdownToHtml(),
new InlineFeatureFile(self::FEATURES_PATH),
Expand Down
12 changes: 9 additions & 3 deletions test/unit/Formatter/ExtractFrontMatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

namespace Roave\DocbookToolUnitTest\Formatter;

use PHPUnit\Framework\TestCase;
use Roave\DocbookTool\DocbookPage;
use Roave\DocbookTool\Formatter\AggregatePageFormatter;
use Roave\DocbookTool\Formatter\ExtractFrontMatter;
use PHPUnit\Framework\TestCase;
use Roave\DocbookTool\Formatter\MarkdownToHtml;

/** @covers \Roave\DocbookTool\Formatter\ExtractFrontMatter */
final class ExtractFrontMatterTest extends TestCase
{
/** @return array<string,array{content:non-empty-string,expectedTitle:non-empty-string}> */
public function titleProvider(): array
{
return [
Expand Down Expand Up @@ -70,15 +71,20 @@ public function titleProvider(): array
];
}

/** @dataProvider titleProvider */
/**
* @param non-empty-string $content
* @param non-empty-string $expectedTitle
*
* @dataProvider titleProvider
*/
public function testTitleCanBeSetInFrontMatter(string $content, string $expectedTitle): void
{
self::assertSame(
$expectedTitle,
(new AggregatePageFormatter([
new ExtractFrontMatter(),
new MarkdownToHtml(),
]))(DocbookPage::fromSlugAndContent('slug', $content))->title()
]))(DocbookPage::fromSlugAndContent('slug', $content))->title(),
);
}
}
55 changes: 55 additions & 0 deletions test/unit/Formatter/InlineExternalImagesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

declare(strict_types=1);

namespace Roave\DocbookToolUnitTest\Formatter;

use PHPUnit\Framework\TestCase;
use Roave\DocbookTool\DocbookPage;
use Roave\DocbookTool\Formatter\InlineExternalImages;

/** @covers \Roave\DocbookTool\Formatter\InlineExternalImages */
final class InlineExternalImagesTest extends TestCase
{
/** @return list<array{0:non-empty-string,1:non-empty-string}> */
public function contentAndImagePathProvider(): array
{
return [
[__DIR__ . '/../../fixture/docbook', 'smile.png'],
[__DIR__ . '/../../fixture/docbook', './smile.png'],
[__DIR__ . '/../../fixture/docbook/', 'smile.png'],
[__DIR__ . '/../../fixture/docbook/', './smile.png'],
[__DIR__ . '/../../fixture', './docbook/smile.png'],
[__DIR__ . '/../../fixture', 'docbook/smile.png'],
[__DIR__ . '/../../fixture/', './docbook/smile.png'],
[__DIR__ . '/../../fixture/', 'docbook/smile.png'],
];
}

/**
* @param non-empty-string $contentPath
* @param non-empty-string $imagePath
*
* @dataProvider contentAndImagePathProvider
*/
public function testExternalImagesAreInlined(string $contentPath, string $imagePath): void
{
$markdown = <<<MD
Here is some markdown
![the alt text]($imagePath)
More markdown
MD;

$page = DocbookPage::fromSlugAndContent('slug', $markdown);

$formattedPage = (new InlineExternalImages($contentPath))($page);

$expectedOutput = <<<'MD'
Here is some markdown
![the alt text](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABHNCSVQICAgIfAhkiAAACkFJREFUeJztnU1sG8cZht9d1aYkcpf0WaeoaAEXjdBTnVNICjoEBar40sB2AqOQf+BDgTo9KEFRC0h6kC51ldxUahn7YFJ2fXDFokAKdbnrHir14EPaXFSoLdqbL7ZIyY1ah9ODQIXizuzOzM7+UNID7GW588N59/u+2dnZGY0QQnBCatCTrsAJh0m9INVqFfl8HpqmBR6maaJarSZd5XCQlPH06VPy8OFDcvnyZTI8PEwAhDoMwyCWZSX9t7hJjSCu65J8Ph9agEEXRyMkHUHdMAzs7OzEUpZpmlhdXUWxWIylPBESjSGu68I0TWiaFpsYANBqtVAqlaBpGgqFQrriTlKmads20XWd292MjIyQGzdukCdPnlDzsywrtMszDIM4jhNzSxwmdkEcxyGGYXA30ujoKJmfnyftdlu4LMuyhMoCQDRNI5VKJYJ/zkesgiwsLCTWKJVKRcgiTdNMxFpiEaRer5OhoaHE3YbjOEJuTdd1Ytt2JHVhEakgvO4piT9OyL5Ly+VyqapbZILwBu00BFLHcYhpmr71rNVqsdQlEkFqtVqgEENDQ6Rer0dRvDR+cUbXdbK5uRl5HZQLYtt2oBjz8/Oqi1WGn2WPjY1FLopSQRzH8XVTaXBPPPjdVJlMJtKYolQQ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