Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong picture in README #248

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/scripts/convert_code_to_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
# Adjust the chemical encoding example picture in the index and the README
adjust_pictures(
"docs/build/index.html",
match="full_lookup",
light_version="full_lookup_light",
dark_version="full_lookup_dark",
match="_images/full_lookup_light",
light_version="_images/full_lookup_light",
dark_version="_images/full_lookup_dark",
)


Expand Down
13 changes: 10 additions & 3 deletions docs/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ def adjust_pictures(

Scienfitz marked this conversation as resolved.
Show resolved Hide resolved
if line_index is not None:
line = lines[line_index]
light_line = line.replace("reference external", "reference external only-light")
light_line = line
light_line = light_line.replace( # For replacing the banner
'"reference external"', '"reference external only-light"'
)
light_line = light_line.replace( # For replacing the example plot
'img alt="Substance Encoding Example" ',
'img alt="Substance Encoding Example" class="only-light align-center" ',
)
lines[line_index] = light_line
dark_line = light_line.replace("only-light", "only-dark")
dark_line = light_line.replace("light", "dark")
AVHopp marked this conversation as resolved.
Show resolved Hide resolved
dark_line = dark_line.replace(light_version, dark_version)
lines[line_index + 1] = dark_line
lines.insert(line_index + 1, dark_line)

with open(file_path, "w") as file:
file.writelines(lines)
Expand Down
Loading