Skip to content

Commit baab882

Browse files
committed
🐛 Fix(quarot_reportview.py): apply as_posix just to paths, not to urls in _generate_image_content function
1 parent 60ba420 commit baab882

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

docs/vuegen_basic_case_study.ipynb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@
139139
"outputs": [],
140140
"source": [
141141
"# Imports\n",
142-
"import os\n",
143142
"import yaml\n",
144143
"from vuegen import report_generator\n",
145-
"from vuegen.utils import get_logger, load_yaml_config\n",
144+
"from vuegen.utils import load_yaml_config\n",
146145
"\n",
147146
"if IN_COLAB:\n",
148147
" import urllib"
@@ -444,7 +443,7 @@
444443
],
445444
"metadata": {
446445
"kernelspec": {
447-
"display_name": "vuegen_py312",
446+
"display_name": "Python 3 (ipykernel)",
448447
"language": "python",
449448
"name": "python3"
450449
},
@@ -458,9 +457,9 @@
458457
"name": "python",
459458
"nbconvert_exporter": "python",
460459
"pygments_lexer": "ipython3",
461-
"version": "3.12.9"
460+
"version": "3.12.6"
462461
}
463462
},
464463
"nbformat": 4,
465-
"nbformat_minor": 2
464+
"nbformat_minor": 4
466465
}

src/vuegen/quarto_reportview.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,9 +925,9 @@ def _generate_image_content(
925925
if is_url(image_path):
926926
src = image_path
927927
else:
928-
src = get_relative_file_path(image_path, base_path="..")
928+
src = get_relative_file_path(image_path, base_path="..").as_posix()
929929

930-
return f"""![]({src.as_posix()}){{fig-alt={alt_text} width={width} height={height}}}\n"""
930+
return f"""![]({src}){{fig-alt={alt_text} width={width} height={height}}}\n"""
931931

932932
def _generate_component_imports(self, component: r.Component) -> List[str]:
933933
"""

0 commit comments

Comments
 (0)