File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1- <div style =" text-align :center " > <img src =" https://aws.github.io/deep-learning-containers/assets/logos/AWS_logo_RGB.svg#only-light " alt =" AWS Logo " width =" 30% " >
2- <img src =" https://aws.github.io/deep-learning-containers/assets/logos/AWS_logo_RGB_REV.svg#only-dark " alt =" AWS Logo " width =" 30% " > </div >
1+ <div style =" text-align :center " >
2+ <picture >
3+ <source media =" (prefers-color-scheme: dark) " srcset =" https://aws.github.io/deep-learning-containers/assets/logos/AWS_logo_RGB_REV.svg " >
4+ <source media =" (prefers-color-scheme: light) " srcset =" https://aws.github.io/deep-learning-containers/assets/logos/AWS_logo_RGB.svg " >
5+ <img alt =" AWS Deep Learning Containers " src =" https://aws.github.io/deep-learning-containers/assets/logos/AWS_logo_RGB.svg " width =" 30% " >
6+ </picture >
7+ </div >
38
49<h1 style =" text-align : center ;" >AWS Deep Learning Containers</h1 >
510
Original file line number Diff line number Diff line change 1313"""Documentation generation functions."""
1414
1515import logging
16+ import re
1617from pathlib import Path
1718
1819import sorter as sorter_module
@@ -345,6 +346,12 @@ def generate_index(dry_run: bool = False) -> str:
345346
346347 readme_content = README_PATH .read_text ()
347348 readme_content = readme_content .replace (SITE_URL , "" )
349+ readme_content = re .sub (
350+ r'<picture>\s*<source media="\(prefers-color-scheme: dark\)" srcset="([^"]+)">\s*<source media="\(prefers-color-scheme: light\)" srcset="([^"]+)">\s*<img alt="([^"]*)" src="[^"]*" width="([^"]*)">\s*</picture>' ,
351+ r'<img src="\2#only-light" alt="\3" width="\4">\n<img src="\1#only-dark" alt="\3" width="\4">' ,
352+ readme_content ,
353+ flags = re .DOTALL ,
354+ )
348355 template = Template (load_jinja2 (template_path ))
349356 content = template .render (readme_content = readme_content )
350357
You can’t perform that action at this time.
0 commit comments