Skip to content

Commit 4456760

Browse files
committed
add local docs
Signed-off-by: sirutBuasai <sirutbuasai27@outlook.com>
1 parent 081f542 commit 4456760

File tree

3 files changed

+49
-4
lines changed

3 files changed

+49
-4
lines changed

docs/DEVELOPMENT.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,46 @@ cd docs && mkdocs serve
239239

240240
______________________________________________________________________
241241

242+
## Local Documentation Development
243+
244+
### Generation Only (No Server)
245+
246+
Run `main.py` to generate documentation without serving:
247+
248+
```bash
249+
cd docs/src && python main.py --verbose
250+
```
251+
252+
This automatically clones `tutorials/` repository and generates markdown files in `reference/` and `releasenotes/` directories without starting a web server.
253+
254+
### Serving Locally
255+
256+
Use `mkdocs serve` to automatically clone `tutorials/` generate documentation in `reference/` and `releasenotes/` and serve the website:
257+
258+
```bash
259+
cd docs && mkdocs serve
260+
```
261+
262+
The site is typically available at `http://127.0.0.1:8000/deep-learning-containers/` - check the command output for the actual URL.
263+
264+
### Live Reload
265+
266+
Enable automatic reload on content changes:
267+
268+
```bash
269+
mkdocs serve --livereload
270+
```
271+
272+
**Note:** Live reload only detects changes to:
273+
274+
- Markdown file content
275+
- `.nav.yml` content
276+
- `mkdocs.yml` content
277+
278+
Live reload does **not** detect changes requiring documentation regeneration (e.g., image config YAML files, templates). To regenerate documentation, stop the server (`Ctrl+C`) and rerun `mkdocs serve`.
279+
280+
______________________________________________________________________
281+
242282
## Troubleshooting
243283

244284
| Error | Solution |

docs/src/data/template/image-template.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# =============================================================================
77

88
# -----------------------------------------------------------------------------
9-
# Required Fields
9+
# Common Fields
1010
# -----------------------------------------------------------------------------
1111

1212
# Framework display name (e.g., "PyTorch", "TensorFlow")
@@ -18,9 +18,6 @@ version: "2.9"
1818
# Accelerator type: gpu, cpu, or neuronx
1919
accelerator: gpu
2020

21-
# Python version identifier (e.g., py310, py311, py312)
22-
python: py312
23-
2421
# Target platform: ec2 or sagemaker
2522
platform: ec2
2623

@@ -37,6 +34,9 @@ tags:
3734
# For example, if you require a column called "foo",
3835
# add foo field here and in your desired table YAML file.
3936

37+
# Python version identifier (e.g., py310, py311, py312)
38+
python: py312
39+
4040
# CUDA version identifier (for GPU images)
4141
cuda: cu130
4242

docs/src/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ def parse_version(version_str: str | None) -> Version:
8585
def clone_git_repository(git_repository: str, target_dir: str | Path) -> None:
8686
"""Clone a git repository to target directory if it doesn't exist."""
8787
if os.path.exists(target_dir):
88+
LOGGER.info(
89+
f"{git_repository} already exists within {target_dir}"
90+
"If you want to pull the latest commit of the repository, either delete the repository and re-run generation"
91+
f"or manually run `git pull` within the {target_dir}"
92+
)
8893
return
8994
subprocess.run(["git", "clone", "--depth", "1", git_repository, target_dir], check=True)
9095

0 commit comments

Comments
 (0)