|
1 |
| -# docs |
2 |
| -Ultralytics Docs at https://docs.ultralytics.com/ |
| 1 | +# Ultralytics Docs |
| 2 | + |
| 3 | +Ultralytics Docs are deployed to [https://docs.ultralytics.com](https://docs.ultralytics.com). |
| 4 | + |
| 5 | +### Install Ultralytics package |
| 6 | + |
| 7 | +To install the ultralytics package in developer mode, you will need to have Git and Python 3 installed on your system. |
| 8 | +Then, follow these steps: |
| 9 | + |
| 10 | +1. Clone the ultralytics repository to your local machine using Git: |
| 11 | + |
| 12 | +```bash |
| 13 | +git clone https://github.com/ultralytics/ultralytics.git |
| 14 | +``` |
| 15 | + |
| 16 | +2. Navigate to the root directory of the repository: |
| 17 | + |
| 18 | +```bash |
| 19 | +cd ultralytics |
| 20 | +``` |
| 21 | + |
| 22 | +3. Install the package in developer mode using pip: |
| 23 | + |
| 24 | +```bash |
| 25 | +pip install -e '.[dev]' |
| 26 | +``` |
| 27 | + |
| 28 | +This will install the ultralytics package and its dependencies in developer mode, allowing you to make changes to the |
| 29 | +package code and have them reflected immediately in your Python environment. |
| 30 | + |
| 31 | +Note that you may need to use the pip3 command instead of pip if you have multiple versions of Python installed on your |
| 32 | +system. |
| 33 | + |
| 34 | +### Building and Serving Locally |
| 35 | + |
| 36 | +The `mkdocs serve` command is used to build and serve a local version of the MkDocs documentation site. It is typically |
| 37 | +used during the development and testing phase of a documentation project. |
| 38 | + |
| 39 | +```bash |
| 40 | +mkdocs serve |
| 41 | +``` |
| 42 | + |
| 43 | +Here is a breakdown of what this command does: |
| 44 | + |
| 45 | +- `mkdocs`: This is the command-line interface (CLI) for the MkDocs static site generator. It is used to build and serve |
| 46 | + MkDocs sites. |
| 47 | +- `serve`: This is a subcommand of the `mkdocs` CLI that tells it to build and serve the documentation site locally. |
| 48 | +- `-a`: This flag specifies the hostname and port number to bind the server to. The default value is `localhost:8000`. |
| 49 | +- `-t`: This flag specifies the theme to use for the documentation site. The default value is `mkdocs`. |
| 50 | +- `-s`: This flag tells the `serve` command to serve the site in silent mode, which means it will not display any log |
| 51 | + messages or progress updates. |
| 52 | + When you run the `mkdocs serve` command, it will build the documentation site using the files in the `docs/` directory |
| 53 | + and serve it at the specified hostname and port number. You can then view the site by going to the URL in your web |
| 54 | + browser. |
| 55 | + |
| 56 | +While the site is being served, you can make changes to the documentation files and see them reflected in the live site |
| 57 | +immediately. This is useful for testing and debugging your documentation before deploying it to a live server. |
| 58 | + |
| 59 | +To stop the serve command and terminate the local server, you can use the `CTRL+C` keyboard shortcut. |
| 60 | + |
| 61 | +### Deploying Your Documentation Site |
| 62 | + |
| 63 | +To deploy your MkDocs documentation site, you will need to choose a hosting provider and a deployment method. Some |
| 64 | +popular options include GitHub Pages, GitLab Pages, and Amazon S3. |
| 65 | + |
| 66 | +Before you can deploy your site, you will need to configure your `mkdocs.yml` file to specify the remote host and any |
| 67 | +other necessary deployment settings. |
| 68 | + |
| 69 | +Once you have configured your `mkdocs.yml` file, you can use the `mkdocs deploy` command to build and deploy your site. |
| 70 | +This command will build the documentation site using the files in the `docs/` directory and the specified configuration |
| 71 | +file and theme, and then deploy the site to the specified remote host. |
| 72 | + |
| 73 | +For example, to deploy your site to GitHub Pages using the gh-deploy plugin, you can use the following command: |
| 74 | + |
| 75 | +```bash |
| 76 | +mkdocs gh-deploy |
| 77 | +``` |
| 78 | + |
| 79 | +If you are using GitHub Pages, you can set a custom domain for your documentation site by going to the "Settings" page |
| 80 | +for your repository and updating the "Custom domain" field in the "GitHub Pages" section. |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +For more information on deploying your MkDocs documentation site, see |
| 85 | +the [MkDocs documentation](https://www.mkdocs.org/user-guide/deploying-your-docs/). |
0 commit comments