mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-29 17:20:21 -05:00
Refactor figures to SVG; enhance validation logic
Converts numerous inline TikZ diagrams to external SVG files across the book's content. This improves rendering performance, streamlines figure management, and ensures consistent visual presentation. Enhances CLI validation by: - Ignoring cross-reference IDs when checking for multiplication to prevent false positives. - Stripping inline math spans before currency checks to avoid misinterpreting mathematical expressions as currency. - Applying hex literal exclusions to pre-processed lines for more accurate validation. Adds optional Matplotlib import to the plotting module for improved flexibility in environments where the library may not be available.
This commit is contained in:
@@ -3,7 +3,12 @@
|
||||
# Ensures all generated figures across Vol 1 & 2 share a consistent,
|
||||
# MIT Press-ready aesthetic.
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
_matplotlib_available = True
|
||||
except ImportError:
|
||||
plt = None
|
||||
_matplotlib_available = False
|
||||
|
||||
# --- Brand & Book Palette ---
|
||||
COLORS = {
|
||||
|
||||
Reference in New Issue
Block a user