File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Original file line number Diff line number Diff line change @@ -42,4 +42,10 @@ $ composer install
42
42
$ php build.php
43
43
```
44
44
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.
Original file line number Diff line number Diff line change 46
46
$ result = (new DocBuilder ())->build ($ buildConfig );
47
47
48
48
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
+
49
55
$ io ->success (sprintf ("The Symfony Docs were successfully built at %s " , realpath ($ outputDir )));
50
56
} else {
51
57
$ io ->error (sprintf ("There were some errors while building the docs: \n\n%s \n" , $ result ->getErrorTrace ()));
You can’t perform that action at this time.
0 commit comments