MCPcopy
hub / github.com/pydata/xarray / update_videos

Function update_videos

doc/conf.py:431–461  ·  view source on GitHub ↗

Update the videos page.

(app: Sphinx)

Source from the content-addressed store, hash-verified

429
430
431def update_videos(app: Sphinx):
432 """Update the videos page."""
433
434 LOGGER.info("Updating videos page...")
435
436 videos = yaml.safe_load(pathlib.Path(app.srcdir, "videos.yml").read_bytes())
437
438 items = []
439 for video in videos:
440 authors = " | ".join(video["authors"])
441 item = f"""
442.. grid-item-card:: {" ".join(video["title"].split())}
443 :text-align: center
444
445 .. raw:: html
446
447 {video['src']}
448 +++
449 {authors}
450 """
451 items.append(item)
452
453 items_md = indent(dedent("\n".join(items)), prefix=" ")
454 markdown = f"""
455.. grid:: 1 2 2 2
456 :gutter: 2
457
458 {items_md}
459 """
460 pathlib.Path(app.srcdir, "videos-gallery.txt").write_text(markdown)
461 LOGGER.info("Videos page updated.")
462
463
464def setup(app: Sphinx):

Callers

nothing calls this directly

Calls 3

infoMethod · 0.80
splitMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…