bids-specification icon indicating copy to clipboard operation
bids-specification copied to clipboard

[MAINT] use jinja in the macros

Open Remi-Gau opened this issue 8 months ago • 7 comments

this is just a test to see if using jinja templates in the macros could help with our rendering of HTML / PDF

  • closes https://github.com/bids-standard/bids-specification/issues/2069

Remi-Gau avatar Mar 10 '25 11:03 Remi-Gau

  • AFAICT using jinja templates already fixes: https://github.com/bids-standard/bids-specification/issues/2069

@oesteban

descriptions are back in pdf and still there in html:

image

image

Remi-Gau avatar Mar 10 '25 14:03 Remi-Gau

a few oddities:

ordered list are a quote blocked in the html version:

image

or don't have the proper 'order' in pdf (item 1. appears twice)

image

Remi-Gau avatar Mar 10 '25 14:03 Remi-Gau

Also see https://bids-specification--2083.org.readthedocs.build/en/2083/glossary.html#stimuluspresentation-metadata

image

or similarly:

  • https://bids-specification--2083.org.readthedocs.build/en/2083/glossary.html#deidentificationmethodcodesequence-metadata

  • https://bids-specification--2083.org.readthedocs.build/en/2083/glossary.html#genetics-metadata

Remi-Gau avatar Mar 10 '25 14:03 Remi-Gau

ordered list are a quote blocked in the html version:

I believe this is not a bug - we need to remove the indentation from the common principles yaml (it was added precisely because the current parser would otherwise render something funky).

https://github.com/bids-standard/bids-specification/blob/7f5e0a778e8aec08e1d6743f19626c929d91e69c/src/schema/objects/common_principles.yaml#L11-L48

oesteban avatar Mar 10 '25 14:03 oesteban

ordered list are a quote blocked in the html version:

I believe this is not a bug - we need to remove the indentation from the common principles yaml (it was added precisely because the current parser would otherwise render something funky).

https://github.com/bids-standard/bids-specification/blob/7f5e0a778e8aec08e1d6743f19626c929d91e69c/src/schema/objects/common_principles.yaml#L11-L48

ha yeah good catch!

Remi-Gau avatar Mar 10 '25 14:03 Remi-Gau

will probably focus refactoring by getting macros to use jinja first with 'no change in behavior' and then tackle remaining 'bugs' in a follow up PRs

also I would not mind have more explicit tests for some of this because working on this feels like flying blind.

Remi-Gau avatar Mar 10 '25 15:03 Remi-Gau

I believe this is not a bug - we need to remove the indentation from the common principles yaml (it was added precisely because the current parser would otherwise render something funky).

to keep track of as well:

this may affect the rendering of the list in the common principles:

image

Remi-Gau avatar Mar 10 '25 17:03 Remi-Gau