#!/usr/bin/env python """ Extract function signatures from html comments in markdown. """ import glob import os import os.path import pathlib import sys import contextlib import subprocess @contextlib.contextmanager def pushd(new_dir): previous_dir = os.getcwd() os.chdir(new_dir) yield os.chdir(previous_dir) HERE = pathlib.Path(__file__).parent def get_sigs(): sigs = set() ref_dir = os.path.join(HERE, 'src', 'functions-reference') with pushd(ref_dir): for file in glob.glob('*.qmd'): with open(file) as rmd_file: lines = rmd_file.readlines() for line in lines: if line.startswith('