Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2fb6aa9

Browse filesBrowse files
committed
Merge branch '4.4' into 5.4
* 4.4: Fix the local doc build
2 parents 7756b2e + 1b0cd02 commit 2fb6aa9
Copy full SHA for 2fb6aa9

File tree

Expand file treeCollapse file tree

2 files changed

+13
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-1
lines changed

‎README.markdown

Copy file name to clipboardExpand all lines: README.markdown
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,10 @@ $ composer install
4242
$ php build.php
4343
```
4444

45-
Now you can browse the docs at `_build/output/index.html`
45+
After generating docs, serve them with the internal PHP server:
46+
47+
```bash
48+
$ php -S localhost:8000 -t output/
49+
```
50+
51+
Browse `http://localhost:8000` to read the docs.

‎_build/build.php

Copy file name to clipboardExpand all lines: _build/build.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
$result = (new DocBuilder())->build($buildConfig);
4747

4848
if ($result->isSuccessful()) {
49+
// fix assets URLs to make them absolute (otherwise, they don't work in subdirectories)
50+
foreach (glob($outputDir.'/**/*.html') as $htmlFilePath) {
51+
$htmlContents = file_get_contents($htmlFilePath);
52+
file_put_contents($htmlFilePath, str_replace('href="assets/', 'href="/assets/', $htmlContents));
53+
}
54+
4955
$io->success(sprintf("The Symfony Docs were successfully built at %s", realpath($outputDir)));
5056
} else {
5157
$io->error(sprintf("There were some errors while building the docs:\n\n%s\n", $result->getErrorTrace()));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.