| @@ 1254-1290 (lines=37) @@ | ||
| 1251 | ) |
|
| 1252 | ||
| 1253 | ||
| 1254 | def meta_format_entry(category, definition, defined): |
|
| 1255 | """ |
|
| 1256 | Compute format entry for a category. |
|
| 1257 | ||
| 1258 | Arguments |
|
| 1259 | --------- |
|
| 1260 | category |
|
| 1261 | The category |
|
| 1262 | definition |
|
| 1263 | The definition |
|
| 1264 | defined |
|
| 1265 | The defined parameter |
|
| 1266 | """ |
|
| 1267 | if "format-entry-classic" in definition: |
|
| 1268 | if isinstance(definition["format-entry-classic"], MetaInlines): |
|
| 1269 | defined[category]["format-entry-classic"] = definition[ |
|
| 1270 | "format-entry-classic" |
|
| 1271 | ].content |
|
| 1272 | # Detach from original parent |
|
| 1273 | defined[category]["format-entry-classic"].parent = None |
|
| 1274 | else: |
|
| 1275 | debug( |
|
| 1276 | "[WARNING] pandoc-numbering: " |
|
| 1277 | "format-entry-classic is not correct for category " + category |
|
| 1278 | ) |
|
| 1279 | ||
| 1280 | if "format-entry-title" in definition: |
|
| 1281 | if isinstance(definition["format-entry-title"], MetaInlines): |
|
| 1282 | defined[category]["format-entry-title"] = definition[ |
|
| 1283 | "format-entry-title" |
|
| 1284 | ].content |
|
| 1285 | # Detach from original parent |
|
| 1286 | defined[category]["format-entry-title"].parent = None |
|
| 1287 | else: |
|
| 1288 | debug( |
|
| 1289 | "[WARNING] pandoc-numbering: " |
|
| 1290 | "format-entry-title is not correct for category " + category |
|
| 1291 | ) |
|
| 1292 | ||
| 1293 | ||
| @@ 1178-1214 (lines=37) @@ | ||
| 1175 | ) |
|
| 1176 | ||
| 1177 | ||
| 1178 | def meta_format_link(category, definition, defined): |
|
| 1179 | """ |
|
| 1180 | Compute format link for a category. |
|
| 1181 | ||
| 1182 | Arguments |
|
| 1183 | --------- |
|
| 1184 | category |
|
| 1185 | The category |
|
| 1186 | definition |
|
| 1187 | The definition |
|
| 1188 | defined |
|
| 1189 | The defined parameter |
|
| 1190 | """ |
|
| 1191 | if "format-link-classic" in definition: |
|
| 1192 | if isinstance(definition["format-link-classic"], MetaInlines): |
|
| 1193 | defined[category]["format-link-classic"] = definition[ |
|
| 1194 | "format-link-classic" |
|
| 1195 | ].content |
|
| 1196 | # Detach from original parent |
|
| 1197 | defined[category]["format-link-classic"].parent = None |
|
| 1198 | else: |
|
| 1199 | debug( |
|
| 1200 | "[WARNING] pandoc-numbering: " |
|
| 1201 | "format-link-classic is not correct for category " + category |
|
| 1202 | ) |
|
| 1203 | ||
| 1204 | if "format-link-title" in definition: |
|
| 1205 | if isinstance(definition["format-link-title"], MetaInlines): |
|
| 1206 | defined[category]["format-link-title"] = definition[ |
|
| 1207 | "format-link-title" |
|
| 1208 | ].content |
|
| 1209 | # Detach from original parent |
|
| 1210 | defined[category]["format-link-title"].parent = None |
|
| 1211 | else: |
|
| 1212 | debug( |
|
| 1213 | "[WARNING] pandoc-numbering: " |
|
| 1214 | "format-link-title is not correct for category " + category |
|
| 1215 | ) |
|
| 1216 | ||
| 1217 | ||
| @@ 1138-1174 (lines=37) @@ | ||
| 1135 | ) |
|
| 1136 | ||
| 1137 | ||
| 1138 | def meta_format_text(category, definition, defined): |
|
| 1139 | """ |
|
| 1140 | Compute format text for a category. |
|
| 1141 | ||
| 1142 | Arguments |
|
| 1143 | --------- |
|
| 1144 | category |
|
| 1145 | The category |
|
| 1146 | definition |
|
| 1147 | The definition |
|
| 1148 | defined |
|
| 1149 | The defined parameter |
|
| 1150 | """ |
|
| 1151 | if "format-text-classic" in definition: |
|
| 1152 | if isinstance(definition["format-text-classic"], MetaInlines): |
|
| 1153 | defined[category]["format-text-classic"] = definition[ |
|
| 1154 | "format-text-classic" |
|
| 1155 | ].content |
|
| 1156 | # Detach from original parent |
|
| 1157 | defined[category]["format-text-classic"].parent = None |
|
| 1158 | else: |
|
| 1159 | debug( |
|
| 1160 | "[WARNING] pandoc-numbering: " |
|
| 1161 | "format-text-classic is not correct for category " + category |
|
| 1162 | ) |
|
| 1163 | ||
| 1164 | if "format-text-title" in definition: |
|
| 1165 | if isinstance(definition["format-text-title"], MetaInlines): |
|
| 1166 | defined[category]["format-text-title"] = definition[ |
|
| 1167 | "format-text-title" |
|
| 1168 | ].content |
|
| 1169 | # Detach from original parent |
|
| 1170 | defined[category]["format-text-title"].parent = None |
|
| 1171 | else: |
|
| 1172 | debug( |
|
| 1173 | "[WARNING] pandoc-numbering: " |
|
| 1174 | "format-text-title is not correct for category " + category |
|
| 1175 | ) |
|
| 1176 | ||
| 1177 | ||