-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5a3b02
commit c507630
Showing
4 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Generating the documentation | ||
|
||
To generate the documentation, you have to build it. Several packages are necessary to build the doc. | ||
|
||
First, you need to install the project itself by running the following command at the root of the code repository: | ||
|
||
```bash | ||
pip install -e . | ||
``` | ||
|
||
You also need to install 2 extra packages: | ||
|
||
```bash | ||
# `hf-doc-builder` to build the docs | ||
pip install git+https://github.com/huggingface/doc-builder@main | ||
# `watchdog` for live reloads | ||
pip install watchdog | ||
``` | ||
|
||
--- | ||
**NOTE** | ||
|
||
You only need to generate the documentation to inspect it locally (if you're planning changes and want to | ||
check how they look before committing for instance). You don't have to commit the built documentation. | ||
|
||
--- | ||
|
||
## Building the documentation | ||
|
||
Once you have setup the `doc-builder` and additional packages with the pip install command above, | ||
you can generate the documentation by typing the following command: | ||
|
||
```bash | ||
doc-builder build autotrain docs/source/ --build_dir ~/tmp/test-build | ||
``` | ||
|
||
You can adapt the `--build_dir` to set any temporary folder that you prefer. This command will create it and generate | ||
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, run the following command: | ||
|
||
```bash | ||
doc-builder preview autotrain docs/source/ | ||
``` | ||
|
||
The docs will be viewable at [http://localhost:5173](http://localhost:5173). 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** | ||
|
||
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). | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters