Load variables from variables.json file
()
| 32 | entry_file = "TOC.md" |
| 33 | |
| 34 | def load_variables(): |
| 35 | """Load variables from variables.json file""" |
| 36 | current_dir = os.path.dirname(os.path.abspath(__file__)) |
| 37 | variables_path = os.path.join(current_dir, "../variables.json") |
| 38 | try: |
| 39 | with open(variables_path, "r", encoding="utf-8") as f: |
| 40 | return json.load(f) |
| 41 | except Exception as e: |
| 42 | print(f"Warning: Could not load variables.json: {e}") |
| 43 | return {} |
| 44 | |
| 45 | def get_value_by_path(obj, path): |
| 46 | """Get value from nested dictionary using dot notation path""" |