From 2997658cb4b29ff1236e2d0d9caf0e59c3a93a3b Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Tue, 25 Jun 2024 21:13:47 +0100 Subject: [PATCH] update readme on how to run doc locally Signed-off-by: Huong Nguyen --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9cfef0..132337b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,74 @@ To run style checks: (.venv) $ pip install pre-commit (.venv) $ pre-commit run -a ``` +### Launch a development server locally +This outlines the steps required to run the Kedro-Sphinx-Theme locally on your machine, either with your kedro, kedro-viz or kedro-dataset. -## Overview +Before launching a development server, you'd need to have [Python](https://www.python.org/)(>=3.9) installed. We strongly recommend setting up [conda](https://docs.conda.io/en/latest/) to manage your Python versions and virtual environments. You can visit Kedro's [guide to installing conda](https://docs.kedro.org/en/latest/get_started/install.html#create-a-virtual-environment-for-your-kedro-project) for more information. -Add a longer description here. +#### Steps + +1. **Clone the Kedro-Sphinx-Theme Repository** +First, you need to get the Kedro-Sphinx-Theme directory on your local machine. Navigate to the directory where you have cloned the repository: + +```bash +cd kedro-sphinx-theme +``` + +Get the location of your local repository and copy the output path for later use: + +```bash +pwd +``` + +2. **Setup the docs build requirement in your repository** +Navigate to the directory where you want to run the documentation locally. This can be within your Kedro, Kedro-Viz, or Kedro-Dataset project: + +```bash +cd path/to/your/kedro/or/kedro-viz/or/kedro-dataset +``` + +Ensure your Python environment is active and ready.Then navigate to the package directory + +```bash +cd package +``` + +Install the documentation dependencies + +```bash +pip install ".[docs]" +``` + +Use the path you copied earlier to install the kedro-sphinx-theme package + +```bash +pip install -e "path/to/kedro-sphinx-theme" +``` + +After installing all the requirements, build the documentation from the root of the repository + +```bash +cd to/your/root +``` + +```bash +sphinx-build -WETa --keep-going -j auto -D language=en -b html -d docs/build/doctrees docs/source docs/build +``` + +3. **Start a Local HTTP Server** +Finally, navigate to the docs/build directory and start a local HTTP server to view the documentation: + +Navigate to the docs/build directory + +```bash +cd docs/build +``` + +Start the server + +```bash +python -m http.server +``` + +Once everything is successfully built and run, you can open the documentation development locally through `http://localhost:your-port` \ No newline at end of file