From 767dc6a8fa64f4ba127eaf3cabbf43b94f47f4a9 Mon Sep 17 00:00:00 2001 From: antoinemeyer5 Date: Fri, 21 Jul 2023 11:27:16 +0200 Subject: [PATCH 1/3] Simple guide to build docs in py-virtualenv --- .gitignore | 2 +- README.md | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e7013a99f..d38ae03e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Python Virtual Environment -/venv +/env # PyCharm files /.idea # Rendered html files diff --git a/README.md b/README.md index 39370f6d0..4a4782d03 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is needed just for local render of documentation, so it can be checked befo Requirements are in `build_requirements.txt` Could be installed with: `pip install -r build_requirements.txt` -## Build +### Build ``` cd docs @@ -20,7 +20,7 @@ cd docs make clean ``` -## Displaying the site locally +### Displaying the site locally `docs/generated_docs/index.html` can be opened in a web browser, or alternatively you can use python's built-in http server: @@ -32,3 +32,38 @@ python3 -m http.server Then, navigate to http://localhost:8000 Alternatively, if you would like to auto refresh every time you run make, the documentation works with [httpwatcher](https://pypi.org/project/httpwatcher/). + +## Requirements to build html page in virtual environments + +```bash +# 1. install virtualenv (if needed) +python3 -m pip install --user virtualenv + +# 2. clone this repository +git clone git@github.com:kokkos/kokkos-core-wiki.git +cd kokkos-core-wiki + +# 3. create virtual environment +python3 -m venv env + +# 4. activate virtual environment +source env/bin/activate + +# 5. install doc requirements +python3 -m pip install -r build_requirements.txt + +# 6. build +cd docs +make html + +# 7. display +cd docs/generated_docs +python3 -m http.server +``` + +```bash +# leave virtual environment +deactivate +``` + +Source: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/ From 9fd8d1d602231d83873af1723dde267b5918d0e0 Mon Sep 17 00:00:00 2001 From: antoinemeyer5 Date: Fri, 21 Jul 2023 11:30:43 +0200 Subject: [PATCH 2/3] other usefull commands --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4a4782d03..d3e28d78b 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,9 @@ python3 -m http.server ``` ```bash +# list installed packages +python3 -m pip list + # leave virtual environment deactivate ``` From bc200ef19047900549e51900604fec232a026274 Mon Sep 17 00:00:00 2001 From: antoinemeyer5 Date: Fri, 21 Jul 2023 11:31:04 +0200 Subject: [PATCH 3/3] up --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d3e28d78b..beb61d4b0 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ cd docs/generated_docs python3 -m http.server ``` +Usefull commands: ```bash # list installed packages python3 -m pip list