File tree Expand file tree Collapse file tree 2 files changed +13
-17
lines changed
tools/schemacode/src/bidsschematools/render Expand file tree Collapse file tree 2 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -34,22 +34,22 @@ matches:
34
34
`matches` is used as a placeholder in BIDS filenames templates to denote that several files
35
35
share exactly the same sequence of entities and labels in their basename.
36
36
37
- For example, in the following filename template:
37
+ For example, in the following filename template:
38
38
39
- ```
40
- <matches>_bold.nii.gz
41
- <matches>_events.tsv
42
- <matches>_events.json
43
- ```
39
+ ```Text
40
+ <matches>_bold.nii.gz
41
+ <matches>_events.tsv
42
+ <matches>_events.json
43
+ ```
44
44
45
- `<matches>` could correspond to `sub-control01_task-nback_run-1`.
45
+ `<matches>` could correspond to `sub-control01_task-nback_run-1`.
46
46
47
47
source_entities :
48
48
name : source_entities
49
49
display_name : source entities
50
50
description : |
51
51
`source_entities` is used as a placeholder in BIDS derivatives filenames templates.
52
52
53
- `source_entities` MUST be the entire source filename, with the omission of
54
- the source suffix and extension.
55
- One exception to this rule is filename entities that are no longer relevant.
53
+ `source_entities` MUST be the entire source filename, with the omission of
54
+ the source suffix and extension.
55
+ One exception to this rule is filename entities that are no longer relevant.
Original file line number Diff line number Diff line change @@ -151,12 +151,6 @@ def make_glossary(schema, src_path=None):
151
151
obj_desc = obj_def .get ("description" , None )
152
152
if obj_desc is None :
153
153
raise ValueError (f"{ obj_marker } has no description." )
154
- # A backslash before a newline means continue a string
155
- obj_desc = obj_desc .replace ("\\ \n " , "" )
156
- # Two newlines should be respected
157
- obj_desc = obj_desc .replace ("\n \n " , "<br>" )
158
- # Otherwise a newline corresponds to a space
159
- obj_desc = obj_desc .replace ("\n " , " " )
160
154
161
155
text += f'\n <a name="{ obj_marker } "></a>'
162
156
text += f"\n ## { obj_key } \n \n "
@@ -184,7 +178,9 @@ def make_glossary(schema, src_path=None):
184
178
levels = [level ["name" ] if isinstance (level , dict ) else level for level in levels ]
185
179
text += f"**Allowed values**: `{ '`, `' .join (levels )} `\n \n "
186
180
187
- text += f"**Description**:\n { obj_desc } \n \n "
181
+ # Convert description into markdown and append to text
182
+ obj_desc = MarkdownIt ().render (f"**Description**:\n { obj_desc } " )
183
+ text += f"{ obj_desc } \n \n "
188
184
189
185
reduced_obj_def = {k : v for k , v in obj_def .items () if k not in keys_to_drop }
190
186
You can’t perform that action at this time.
0 commit comments