Skip to content

Commit b71a301

Browse files
authored
fix tutoirals (#87)
* fix tutoirals * upd workflow * remove print * lint * fix?
1 parent 4cc3b99 commit b71a301

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.github/workflows/build-docs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ jobs:
4949
poetry install --with docs
5050
5151
- name: Run tests
52+
if: github.event_name != 'workflow_dispatch'
5253
run: |
5354
echo "Testing documentation build..."
5455
make test-docs
5556
5657
- name: Build documentation
57-
if: ${{ github.ref == 'refs/heads/dev' }}
58+
if: ${{ github.ref == 'refs/heads/dev' }} && github.event_name != 'workflow_dispatch'
5859
run: |
5960
make docs
6061

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test-docs:
3535
$(poetry) python -m sphinx build -b doctest docs/source docs/build/html
3636

3737
.PHONY: serve-docs
38-
serve-docs: docs
38+
serve-docs:
3939
$(poetry) python -m http.server -d docs/build/html 8333
4040

4141
.PHONY: multi-version-docs
@@ -49,4 +49,4 @@ clean-docs:
4949
rm -rf docs/source/user_guides
5050

5151
.PHONY: all
52-
all: lint
52+
all: lint

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@
168168

169169
def setup(app: Sphinx) -> None:
170170
generate_versions_json(repo_root, BASE_URL)
171-
user_guids_dir = app.srcdir / "docs" / "source" / "user_guides"
172-
171+
user_guids_dir = app.srcdir / "user_guides"
173172
generate_tutorial_links_for_notebook_creation(
174173
include=[
175174
(
@@ -185,4 +184,5 @@ def setup(app: Sphinx) -> None:
185184
source="user_guides",
186185
destination=user_guids_dir,
187186
)
187+
188188
app.connect("autoapi-skip-member", skip_member)

docs/source/docs_utils/tutorials.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import logging
12
from pathlib import Path
23

4+
logging.basicConfig(level=logging.INFO)
5+
logger = logging.getLogger(__name__)
6+
37

48
def create_notebook_link(source: Path, destination: Path) -> None:
59
"""
@@ -136,4 +140,6 @@ def generate_tutorial_links_for_notebook_creation(
136140
filtered_links += [link]
137141

138142
for included in include:
139-
create_index_file(included, filtered_links, dest / Path(f"index_{included[1].replace(' ', '_').lower()}.rst"))
143+
path = dest / Path(f"index_{included[1].replace(' ', '_').lower()}.rst")
144+
logger.info("dest %s", path)
145+
create_index_file(included, filtered_links, path)

0 commit comments

Comments
 (0)