From e3fb8eced29a1f92c269b6f9b6f7c94ad301e911 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 29 Aug 2022 19:21:21 +0200 Subject: [PATCH 1/5] add legend below filename template --- tools/schemacode/bidsschematools/render.py | 44 ++++++++++++++++++++++ tools/schemacode/setup.cfg | 1 + 2 files changed, 45 insertions(+) diff --git a/tools/schemacode/bidsschematools/render.py b/tools/schemacode/bidsschematools/render.py index 7af32cc3dc..65aa4f1d39 100644 --- a/tools/schemacode/bidsschematools/render.py +++ b/tools/schemacode/bidsschematools/render.py @@ -7,6 +7,7 @@ import pandas as pd import yaml +from markdown_it import MarkdownIt from tabulate import tabulate from . import utils @@ -469,11 +470,54 @@ def make_filename_template( ) codeblock = codeblock.expandtabs(4) + codeblock = append_filename_template_legend(codeblock, pdf_format) codeblock = codeblock.replace("SPEC_ROOT", get_relpath(src_path)) return codeblock +def append_filename_template_legend( + text=None, + pdf_format=False, +): + + if text is None: + return + + md = MarkdownIt().disable("image").enable("table") + + legend = """ +- Filename entities or folders between square brackets (for example, `[_ses-