Skip to content

Commit 8dd14a3

Browse files
bachelor-dounoemotiovon
authored andcommitted
All imported resource files are placed under the _generated directory to avoid mixing with local changes during commits.
1 parent 390ccee commit 8dd14a3

7 files changed

Lines changed: 41 additions & 25 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ _build/*
22
.venv
33
.vscode
44
.DS_Store
5-
sources/pytorch/api_doc.rst
5+
sources/pytorch/api_doc.rst
6+
sources/_generated

Makefile

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ BUILDDIR = _build
1212
PROJECT_CONFIGS = \
1313
_repos/verl/docs/ascend_tutorial:sources/verl \
1414
_repos/VeOmni/docs:sources/VeOmni \
15-
_repos/LLaMA-Factory/docs:sources/LLaMA-Factory \
16-
_repos/ms-swift/docs:sources/ms-swift
15+
_repos/LLaMA-Factory/docs:sources/LLaMA-Factory \
16+
_repos/ms-swift/docs:sources/ms-swift
17+
18+
# Configure all subprojects generated path
19+
GENERATED_DOCS := sources/_generated
1720

1821
# Put it first so that "make" without argument is like "make help".
1922
help:
@@ -25,19 +28,31 @@ help:
2528
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
2629
%: Makefile
2730
@echo "Initializing submodules..."
28-
@git submodule update --init
29-
31+
@git submodule update --init --remote
32+
33+
@echo "Preparing generated docs directory..."
34+
@mkdir -p $(GENERATED_DOCS)
35+
3036
@echo "Copying project documentation..."
3137
@for config in $(PROJECT_CONFIGS); do \
3238
src=$$(echo $$config | cut -d: -f1); \
33-
dst=$$(echo $$config | cut -d: -f2); \
34-
# Removing existing index files to avoid conflicts \
39+
rel_dst=$$(echo $$config | cut -d: -f2); \
40+
dst="$(GENERATED_DOCS)/$$rel_dst"; \
41+
echo "Copying $$src -> $$dst"; \
42+
\
43+
# Clean destination to avoid stale files \
44+
rm -rf $$dst; \
45+
mkdir -p $$dst; \
46+
\
47+
# Remove index files from source to avoid conflicts \
3548
find $$src -name 'index.*' -delete 2>/dev/null || true; \
49+
\
3650
echo "Copying $$src to $$dst"; \
37-
cp -r $$src/* $$dst/ 2>/dev/null || echo " Source directory does not exist or is empty: $$src"; \
51+
cp -r "$$src"/* "$$dst"/ 2>/dev/null || \
52+
echo " [WARN] Source directory does not exist or is empty: $$src"; \
3853
done
39-
54+
4055
@echo "Cleaning up submodules..."
4156
@git submodule deinit -f _repos/*
42-
43-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
57+
58+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

sources/LLaMA-Factory/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ LLaMA-Factory
44
.. toctree::
55
:maxdepth: 3
66

7-
source/advanced/npu_installation.rst
8-
source/advanced/npu_training.rst
9-
source/advanced/distributed.rst
7+
../_generated/sources/LLaMA-Factory/source/advanced/npu_installation
8+
../_generated/sources/LLaMA-Factory/source/advanced/npu_training
9+
../_generated/sources/LLaMA-Factory/source/advanced/distributed

sources/VeOmni/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ VeOmni
44
.. toctree::
55
:maxdepth: 3
66

7-
get_started/installation/install_ascend.md
8-
hardware_support/get_started_npu.md
7+
../_generated/sources/VeOmni/get_started/installation/install_ascend
8+
../_generated/sources/VeOmni/hardware_support/get_started_npu

sources/ms-swift/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ ms-swift
44
.. toctree::
55
:maxdepth: 3
66

7-
source/BestPractices/NPU-support.md
8-
source_en/BestPractices/NPU-support.md
7+
../_generated/sources/ms-swift/source/BestPractices/NPU-support
8+
../_generated/sources/ms-swift/source_en/BestPractices/NPU-support

sources/roll/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
roll
1+
ROLL
22
============
33

44
.. toctree::

sources/verl/index.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ verl
44
.. toctree::
55
:maxdepth: 3
66

7-
ascend_quick_start.rst
8-
ascend_sglang_quick_start.rst
9-
dockerfile_build_guidance.rst
10-
ascend_profiling_en.rst
11-
ascend_profiling_zh.rst
12-
ascend_consistency.rst
7+
../_generated/sources/verl/ascend_quick_start
8+
../_generated/sources/verl/ascend_sglang_quick_start
9+
../_generated/sources/verl/dockerfile_build_guidance
10+
../_generated/sources/verl/ascend_profiling_en
11+
../_generated/sources/verl/ascend_profiling_zh
12+
../_generated/sources/verl/ascend_consistency

0 commit comments

Comments
 (0)