Skip to content

Commit

Permalink
[#171][Crum/Flashcards] Add a Second <br/> when Images are Absent.
Browse files Browse the repository at this point in the history
Otherwise, the following `<hr/>` would collide with the dictionary pages
lists.
  • Loading branch information
pishoyg committed Aug 22, 2024
1 parent b620c38 commit f1b6927
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions flashcards/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,22 @@ def dialect(col: str) -> field.Field:
),
"<br/>",
# Image.
field.img(
keys=roots_col("key"),
# Although the same result can be obtained using
# glob.glob(f"dictionary/marcion.sourceforge.net/data/img-300/{key}-*")
# we use this method in order to avoid using the computationally expensive
# glob.glob.
get_paths=explanatory_images.get,
sort_paths=utils.sort_semver,
fmt_args=lambda path: {
"caption": image_sensor.get_caption(path),
"id": "explanatory" + utils.stem(path),
},
force=False,
field.xor(
field.img(
keys=roots_col("key"),
# Although the same result can be obtained using
# glob.glob(f"dictionary/marcion.sourceforge.net/data/img-300/{key}-*")
# we use this method in order to avoid using the computationally expensive
# glob.glob.
get_paths=explanatory_images.get,
sort_paths=utils.sort_semver,
fmt_args=lambda path: {
"caption": image_sensor.get_caption(path),
"id": "explanatory" + utils.stem(path),
},
force=False,
),
"<br/>",
),
# Editor's notes.
field.aon(
Expand Down

0 comments on commit f1b6927

Please sign in to comment.