Skip to content

Commit

Permalink
DBG: Add debug output to help figure things out
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Apr 18, 2024
1 parent aef74e6 commit ca435ab
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions tools/schemacode/bidsschematools/render/tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ def fence(
md: markdown.Markdown,
**kwargs,
) -> str:
df = pd.read_csv(io.StringIO(source), sep="\t")
md_table = tabulate(df, headers="keys", tablefmt="github", showindex=False) # type: ignore
return md.convert(md_table)
print(f"{source=}")
print(f"{language=}")
print(f"{css_class=}")
print(f"{options=}")
print(f"{md=}")
print(f"{kwargs=}")
try:
df = pd.read_csv(io.StringIO(source), sep="\t")
print(df)
md_table = tabulate(df, headers="keys", tablefmt="github", showindex=False) # type: ignore
print(md_table)
ret = md.convert(md_table)
print(ret)
# Remove newlines to prevent copy-paste from inserting spaces
return ret.replace("\n", "")
except Exception:
import traceback

exc = traceback.format_exc()
print(exc)
return f"<pre>{exc}</pre>"

0 comments on commit ca435ab

Please sign in to comment.