mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add doc preview command (#141590)
Convenience, when we build pytorch docs 1. Docs for build weren't clear that `make html` is the main command intended to be ran 2. Once you run `make html` you need to visualize the work, opening up a simple http server seems like the simplest solution so adding a `make serve command` Usage ```shell numpy ❯ make serve PORT=8080 # Add port optionally Serving HTTP on :: port 8080 (http://[::]:8080/) ... ::1 - - [26/Nov/2024 10:05:41] "GET / HTTP/1.1" 200 - ::1 - - [26/Nov/2024 10:05:41] "GET /_static/copybutton.css HTTP/1.1" 200 - ::1 - - [26/Nov/2024 10:05:41] "GET /_static/katex-math.css HTTP/1.1" 200 - ```  Pull Request resolved: https://github.com/pytorch/pytorch/pull/141590 Approved by: https://github.com/svekars, https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
65dbd5cc2d
commit
f3d16ec76f
@ -417,9 +417,11 @@ readthedocs theme.
|
||||
```bash
|
||||
cd docs/
|
||||
pip install -r requirements.txt
|
||||
make html
|
||||
make serve
|
||||
```
|
||||
You can then build the documentation by running `make <format>` from the
|
||||
`docs/` folder. Run `make` to get a list of all available output formats.
|
||||
|
||||
Run `make` to get a list of all available output formats.
|
||||
|
||||
If you get a katex error run `npm install katex`. If it persists, try
|
||||
`npm install -g katex`
|
||||
|
Reference in New Issue
Block a user