Skip to content

Commit 206deab

Browse files
committed
🎨 keep urls at the top
- maybe 'Verschlimmbessern': footer can be hard to read (pdf) - needed to use escaping of {} using unicode: \u007b is { and \u007d is } - 🐛 jupyter used relative import -> changed to URL link of LOGO - unify MONA mentioning (pdf)
1 parent 5fb9049 commit 206deab

File tree

6 files changed

+54
-30
lines changed

6 files changed

+54
-30
lines changed

src/vuegen/quarto_reportview.py

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""QuartoReportView class for generating Quarto reports."""
2+
13
import os
24
import subprocess
35
import sys
@@ -11,6 +13,15 @@
1113
from . import table_utils
1214
from .utils import create_folder, get_relative_file_path, is_url, sort_imports
1315

16+
GITHUB_ORG_URL = "https://github.com/Multiomics-Analytics-Group"
17+
ORG = "Multiomics Network Analytics Group (MoNA)"
18+
GITHUB_ORG_URL_BRACKETS = "{https://github.com/Multiomics-Analytics-Group}"
19+
REPO_URL = "https://github.com/Multiomics-Analytics-Group/vuegen"
20+
LOGO_URL = (
21+
"https://raw.githubusercontent.com/Multiomics-Analytics-Group/"
22+
"vuegen/main/docs/images/vuegen_logo.svg"
23+
)
24+
1425

1526
class QuartoReportView(r.ReportView):
1627
"""
@@ -321,9 +332,10 @@ def _create_yaml_header(self) -> str:
321332
format:"""
322333
)
323334
# Define format-specific YAML configurations
335+
# \u007b is { and \u007d is }
324336
format_configs = {
325337
r.ReportType.HTML: textwrap.dedent(
326-
"""
338+
f"""
327339
html:
328340
toc: true
329341
toc-location: left
@@ -333,39 +345,43 @@ def _create_yaml_header(self) -> str:
333345
include-in-header:
334346
text: |
335347
<style type="text/css">
336-
.footer {
348+
.footer \u007b
337349
position: relative;
338350
left: 0;
339351
width: 100%;
340352
text-align: center;
341353
margin-top: 20px;
342-
}
354+
\u007d
343355
</style>
344356
include-after-body:
345357
text: |
346358
<footer class="footer">
347359
This report was generated with
348-
<a href="https://github.com/Multiomics-Analytics-Group/vuegen" target="_blank">
349-
<img src="https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_logo.svg" alt="VueGen" width="65px">
360+
<a href="{REPO_URL}" target="_blank">
361+
<img src="{LOGO_URL}" alt="VueGen" width="65px">
350362
</a>
351-
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">Multiomics Network Analytics Group (MoNA)</a>
363+
| Copyright 2025 <a href="{GITHUB_ORG_URL}" target="_blank">
364+
{ORG}</a>
352365
</footer>"""
353366
),
367+
# \u007b is { and \u007d is }
354368
r.ReportType.PDF: textwrap.indent(
355369
textwrap.dedent(
356-
"""
370+
f"""
357371
pdf:
358372
toc: false
359373
fig-align: center
360374
margin:
361375
- bottom=40mm
362376
include-in-header:
363377
text: |
364-
\\usepackage{scrlayer-scrpage}
365-
\\usepackage{hyperref}
378+
\\usepackage{{scrlayer-scrpage}}
379+
\\usepackage{{hyperref}}
366380
\\clearpairofpagestyles
367-
\\lofoot{This report was generated with \\href{https://github.com/Multiomics-Analytics-Group/vuegen}{VueGen} | \\copyright{} 2025 \\href{https://github.com/Multiomics-Analytics-Group}{Multiomics Network Analytics Group}}
368-
\\rofoot{\\pagemark}"""
381+
\\lofoot\u007bThis report was generated with
382+
\\href{{{REPO_URL}}}{{VueGen}} | \\copyright{{}} 2025
383+
\\href{GITHUB_ORG_URL_BRACKETS}\u007b{ORG}\u007d\u007d
384+
\\rofoot{{\\pagemark}}"""
369385
),
370386
" ",
371387
),
@@ -386,7 +402,7 @@ def _create_yaml_header(self) -> str:
386402
" ",
387403
),
388404
r.ReportType.REVEALJS: textwrap.dedent(
389-
"""
405+
f"""
390406
revealjs:
391407
toc: false
392408
smaller: true
@@ -397,22 +413,23 @@ def _create_yaml_header(self) -> str:
397413
include-in-header:
398414
text: |
399415
<style type="text/css">
400-
.footer {
416+
.footer \u007b
401417
position: fixed;
402418
left: 0;
403419
bottom: 0;
404420
width: 100%;
405421
text-align: center;
406-
}
422+
\u007d
407423
</style>
408424
include-after-body:
409425
text: |
410426
<footer class="footer">
411427
This report was generated with
412-
<a href="https://github.com/Multiomics-Analytics-Group/vuegen" target="_blank">
413-
<img src="https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_logo.svg" alt="VueGen" width="65px">
428+
<a href="{REPO_URL}" target="_blank">
429+
<img src="{LOGO_URL}" alt="VueGen" width="65px">
414430
</a>
415-
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">Multiomics Network Analytics Group (MoNA)</a>
431+
| Copyright 2025 <a href="{GITHUB_ORG_URL}"
432+
target="_blank">{ORG}</a>
416433
</footer>"""
417434
),
418435
r.ReportType.PPTX: textwrap.indent(
@@ -425,7 +442,7 @@ def _create_yaml_header(self) -> str:
425442
" ",
426443
),
427444
r.ReportType.JUPYTER: textwrap.dedent(
428-
"""
445+
f"""
429446
html:
430447
toc: true
431448
toc-location: left
@@ -435,22 +452,23 @@ def _create_yaml_header(self) -> str:
435452
include-in-header:
436453
text: |
437454
<style type="text/css">
438-
.footer {
455+
.footer \u007b
439456
position: relative;
440457
left: 0;
441458
width: 100%;
442459
text-align: center;
443460
margin-top: 20px;
444-
}
461+
\u007d
445462
</style>
446463
include-after-body:
447464
text: |
448465
<footer class="footer">
449466
This report was generated with
450-
<a href="https://github.com/Multiomics-Analytics-Group/vuegen" target="_blank">
451-
<img src="../docs/images/vuegen_logo.svg" alt="VueGen" width="65px">
467+
<a href="{REPO_URL}" target="_blank">
468+
<img src="{LOGO_URL}" alt="VueGen" width="65px">
452469
</a>
453-
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">Multiomics Network Analytics Group (MoNA)</a>
470+
| Copyright 2025 <a href="{GITHUB_ORG_URL}"
471+
target="_blank">{ORG}</a>
454472
</footer>"""
455473
),
456474
}

tests/report_examples/Basic_example_vuegen_demo_notebook/html/quarto_report/quarto_report.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ include-after-body:
3030
<a href="https://github.com/Multiomics-Analytics-Group/vuegen" target="_blank">
3131
<img src="https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_logo.svg" alt="VueGen" width="65px">
3232
</a>
33-
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">Multiomics Network Analytics Group (MoNA)</a>
33+
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">
34+
Multiomics Network Analytics Group (MoNA)</a>
3435
</footer>
3536
---
3637

tests/report_examples/Basic_example_vuegen_demo_notebook/jupyter/quarto_report/quarto_report.qmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ include-in-header:
2121
width: 100%;
2222
text-align: center;
2323
margin-top: 20px;
24-
}
24+
}
2525
</style>
2626
include-after-body:
2727
text: |
2828
<footer class="footer">
2929
This report was generated with
3030
<a href="https://github.com/Multiomics-Analytics-Group/vuegen" target="_blank">
31-
<img src="../docs/images/vuegen_logo.svg" alt="VueGen" width="65px">
31+
<img src="https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_logo.svg" alt="VueGen" width="65px">
3232
</a>
33-
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">Multiomics Network Analytics Group (MoNA)</a>
33+
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group"
34+
target="_blank">Multiomics Network Analytics Group (MoNA)</a>
3435
</footer>
3536
---
3637

tests/report_examples/Basic_example_vuegen_demo_notebook/pdf/quarto_report/quarto_report.qmd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ format:
1616
\usepackage{scrlayer-scrpage}
1717
\usepackage{hyperref}
1818
\clearpairofpagestyles
19-
\lofoot{This report was generated with \href{https://github.com/Multiomics-Analytics-Group/vuegen}{VueGen} | \copyright{} 2025 \href{https://github.com/Multiomics-Analytics-Group}{Multiomics Network Analytics Group}}
19+
\lofoot{This report was generated with
20+
\href{https://github.com/Multiomics-Analytics-Group/vuegen}{VueGen} | \copyright{} 2025
21+
\href{https://github.com/Multiomics-Analytics-Group}{Multiomics Network Analytics Group (MoNA)}}
2022
\rofoot{\pagemark}
2123
---
2224

tests/report_examples/Basic_example_vuegen_demo_notebook/revealjs/quarto_report/quarto_report.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ include-after-body:
3131
<a href="https://github.com/Multiomics-Analytics-Group/vuegen" target="_blank">
3232
<img src="https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_logo.svg" alt="VueGen" width="65px">
3333
</a>
34-
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">Multiomics Network Analytics Group (MoNA)</a>
34+
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group"
35+
target="_blank">Multiomics Network Analytics Group (MoNA)</a>
3536
</footer>
3637
---
3738

tests/report_examples/Basic_example_vuegen_demo_notebook_cfg/html/quarto_report/quarto_report.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ include-after-body:
3030
<a href="https://github.com/Multiomics-Analytics-Group/vuegen" target="_blank">
3131
<img src="https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_logo.svg" alt="VueGen" width="65px">
3232
</a>
33-
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">Multiomics Network Analytics Group (MoNA)</a>
33+
| Copyright 2025 <a href="https://github.com/Multiomics-Analytics-Group" target="_blank">
34+
Multiomics Network Analytics Group (MoNA)</a>
3435
</footer>
3536
---
3637

0 commit comments

Comments
 (0)