diff --git a/docs/contributions/index.rst b/docs/contributions/index.rst index 15b8d86ba..bd39ace49 100644 --- a/docs/contributions/index.rst +++ b/docs/contributions/index.rst @@ -10,5 +10,13 @@ Clone the mono repository Run the tests ============= +The project comes with a Makefile that will run the tests and other +checks for you. +It relies on ``docker``, but you can run any make target natively by +using the ``PHP_BIN`` make variable. +For instance, to run the pre-commit checks, you can run:: + + make PHP_BIN=php pre-commit-test + Submit a Pull Request ===================== diff --git a/packages/guides/src/ReferenceResolvers/DocReferenceResolver.php b/packages/guides/src/ReferenceResolvers/DocReferenceResolver.php index 7a2abc4fb..0cd2633b1 100644 --- a/packages/guides/src/ReferenceResolvers/DocReferenceResolver.php +++ b/packages/guides/src/ReferenceResolvers/DocReferenceResolver.php @@ -18,7 +18,9 @@ public function resolve(LinkInlineNode $node, RenderContext $renderContext): boo return false; } - $document = $renderContext->getProjectNode()->findDocumentEntry($node->getTargetReference()); + $document = $renderContext->getProjectNode()->findDocumentEntry( + $renderContext->canonicalUrl($node->getTargetReference()), + ); if ($document === null) { return false; } diff --git a/packages/guides/src/RenderContext.php b/packages/guides/src/RenderContext.php index a0bb31d8e..46c2ab0c5 100644 --- a/packages/guides/src/RenderContext.php +++ b/packages/guides/src/RenderContext.php @@ -94,7 +94,7 @@ public function getLink(string $name, bool $relative = true): string return ''; } - public function canonicalUrl(string $url): string|null + public function canonicalUrl(string $url): string { return $this->urlGenerator->canonicalUrl($this->getDirName(), $url); } diff --git a/tests/Integration/tests/docref/expected/index.html b/tests/Integration/tests/docref/expected/index.html new file mode 100644 index 000000000..77d0dbdf1 --- /dev/null +++ b/tests/Integration/tests/docref/expected/index.html @@ -0,0 +1,14 @@ + + +
+