Skip to content

[MAINT] use jinja in the macros #2083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Mar 10, 2025

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated: could be extracted in separate PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated: could be extracted in separate PR

@Remi-Gau Remi-Gau changed the title [WIP][MAINT] use jinja in the macros [MAINT] use jinja in the macros Mar 10, 2025
@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Mar 10, 2025

@oesteban

descriptions are back in pdf and still there in html:

image

image

@Remi-Gau
Copy link
Collaborator Author

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

@oesteban
Copy link
Collaborator

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).

data_type:
display_name: Data type
description: |
A functional group of different types of data.
Data files are contained in a directory named for the data type.
In raw datasets, the data type directory is nested inside subject and (optionally) session directories.
BIDS defines the following data types:
1. `func` (task based and resting state functional MRI)
2. `dwi` (diffusion weighted imaging)
3. `fmap` (field inhomogeneity mapping data such as field maps)
4. `anat` (structural imaging such as T1, T2, PD, and so on)
5. `perf` (perfusion)
6. `meg` (magnetoencephalography)
7. `eeg` (electroencephalography)
8. `ieeg` (intracranial electroencephalography)
9. `beh` (behavioral)
10. `pet` (positron emission tomography)
11. `micr` (microscopy)
12. `nirs` (near infrared spectroscopy)
13. `motion` (motion)
14. `mrs` (magnetic resonance spectroscopy)
dataset:
display_name: Dataset

@Remi-Gau
Copy link
Collaborator Author

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).

data_type:
display_name: Data type
description: |
A functional group of different types of data.
Data files are contained in a directory named for the data type.
In raw datasets, the data type directory is nested inside subject and (optionally) session directories.
BIDS defines the following data types:
1. `func` (task based and resting state functional MRI)
2. `dwi` (diffusion weighted imaging)
3. `fmap` (field inhomogeneity mapping data such as field maps)
4. `anat` (structural imaging such as T1, T2, PD, and so on)
5. `perf` (perfusion)
6. `meg` (magnetoencephalography)
7. `eeg` (electroencephalography)
8. `ieeg` (intracranial electroencephalography)
9. `beh` (behavioral)
10. `pet` (positron emission tomography)
11. `micr` (microscopy)
12. `nirs` (near infrared spectroscopy)
13. `motion` (motion)
14. `mrs` (magnetic resonance spectroscopy)
dataset:
display_name: Dataset

ha yeah good catch!

@Remi-Gau
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Glossary renderer is unaware of version (Markdown or PDF)
2 participants