diff --git a/docs/README.md b/docs/README.md index c81c12d741..c8399a1ee6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -50,11 +50,32 @@ You can adapt the `--build_dir` to set any temporary folder that you prefer. Thi the MDX files that will be rendered as the documentation on the main website. You can inspect them in your favorite Markdown editor. +## Previewing the documentation + +To preview the docs, first install the `watchdog` module with: + +```bash +pip install watchdog +``` + +Then run the following command: + +```bash +doc-builder preview {package_name} {path_to_docs} +``` + +For example: + +```bash +doc-builder preview transformers docs/source/en/ +``` + +The docs will be viewable at [http://localhost:3000](http://localhost:3000). You can also preview the docs once you have opened a PR. You will see a bot add a comment to a link where the documentation with your changes lives. + --- **NOTE** -It's not possible to see locally how the final documentation will look like for now. Once you have opened a PR, you -will see a bot add a comment to a link where the documentation with your changes lives. +The `preview` command only works with existing doc files. When you add a completely new file, you need to update `_toctree.yml` & restart `preview` command (`ctrl-c` to stop it & call `doc-builder preview ...` again). ---