| @@ 1264-1300 (lines=37) @@ | ||
| 1261 | ) |
|
| 1262 | ||
| 1263 | ||
| 1264 | def meta_format_entry(category, definition, defined): |
|
| 1265 | """ |
|
| 1266 | Compute format entry for a category. |
|
| 1267 | ||
| 1268 | Arguments |
|
| 1269 | --------- |
|
| 1270 | category |
|
| 1271 | The category |
|
| 1272 | definition |
|
| 1273 | The definition |
|
| 1274 | defined |
|
| 1275 | The defined parameter |
|
| 1276 | """ |
|
| 1277 | if "format-entry-classic" in definition: |
|
| 1278 | if isinstance(definition["format-entry-classic"], MetaInlines): |
|
| 1279 | defined[category]["format-entry-classic"] = definition[ |
|
| 1280 | "format-entry-classic" |
|
| 1281 | ].content |
|
| 1282 | # Detach from original parent |
|
| 1283 | defined[category]["format-entry-classic"].parent = None |
|
| 1284 | else: |
|
| 1285 | debug( |
|
| 1286 | "[WARNING] pandoc-numbering: " |
|
| 1287 | "format-entry-classic is not correct for category " + category |
|
| 1288 | ) |
|
| 1289 | ||
| 1290 | if "format-entry-title" in definition: |
|
| 1291 | if isinstance(definition["format-entry-title"], MetaInlines): |
|
| 1292 | defined[category]["format-entry-title"] = definition[ |
|
| 1293 | "format-entry-title" |
|
| 1294 | ].content |
|
| 1295 | # Detach from original parent |
|
| 1296 | defined[category]["format-entry-title"].parent = None |
|
| 1297 | else: |
|
| 1298 | debug( |
|
| 1299 | "[WARNING] pandoc-numbering: " |
|
| 1300 | "format-entry-title is not correct for category " + category |
|
| 1301 | ) |
|
| 1302 | ||
| 1303 | ||
| @@ 1188-1224 (lines=37) @@ | ||
| 1185 | ) |
|
| 1186 | ||
| 1187 | ||
| 1188 | def meta_format_link(category, definition, defined): |
|
| 1189 | """ |
|
| 1190 | Compute format link for a category. |
|
| 1191 | ||
| 1192 | Arguments |
|
| 1193 | --------- |
|
| 1194 | category |
|
| 1195 | The category |
|
| 1196 | definition |
|
| 1197 | The definition |
|
| 1198 | defined |
|
| 1199 | The defined parameter |
|
| 1200 | """ |
|
| 1201 | if "format-link-classic" in definition: |
|
| 1202 | if isinstance(definition["format-link-classic"], MetaInlines): |
|
| 1203 | defined[category]["format-link-classic"] = definition[ |
|
| 1204 | "format-link-classic" |
|
| 1205 | ].content |
|
| 1206 | # Detach from original parent |
|
| 1207 | defined[category]["format-link-classic"].parent = None |
|
| 1208 | else: |
|
| 1209 | debug( |
|
| 1210 | "[WARNING] pandoc-numbering: " |
|
| 1211 | "format-link-classic is not correct for category " + category |
|
| 1212 | ) |
|
| 1213 | ||
| 1214 | if "format-link-title" in definition: |
|
| 1215 | if isinstance(definition["format-link-title"], MetaInlines): |
|
| 1216 | defined[category]["format-link-title"] = definition[ |
|
| 1217 | "format-link-title" |
|
| 1218 | ].content |
|
| 1219 | # Detach from original parent |
|
| 1220 | defined[category]["format-link-title"].parent = None |
|
| 1221 | else: |
|
| 1222 | debug( |
|
| 1223 | "[WARNING] pandoc-numbering: " |
|
| 1224 | "format-link-title is not correct for category " + category |
|
| 1225 | ) |
|
| 1226 | ||
| 1227 | ||
| @@ 1148-1184 (lines=37) @@ | ||
| 1145 | ) |
|
| 1146 | ||
| 1147 | ||
| 1148 | def meta_format_text(category, definition, defined): |
|
| 1149 | """ |
|
| 1150 | Compute format text for a category. |
|
| 1151 | ||
| 1152 | Arguments |
|
| 1153 | --------- |
|
| 1154 | category |
|
| 1155 | The category |
|
| 1156 | definition |
|
| 1157 | The definition |
|
| 1158 | defined |
|
| 1159 | The defined parameter |
|
| 1160 | """ |
|
| 1161 | if "format-text-classic" in definition: |
|
| 1162 | if isinstance(definition["format-text-classic"], MetaInlines): |
|
| 1163 | defined[category]["format-text-classic"] = definition[ |
|
| 1164 | "format-text-classic" |
|
| 1165 | ].content |
|
| 1166 | # Detach from original parent |
|
| 1167 | defined[category]["format-text-classic"].parent = None |
|
| 1168 | else: |
|
| 1169 | debug( |
|
| 1170 | "[WARNING] pandoc-numbering: " |
|
| 1171 | "format-text-classic is not correct for category " + category |
|
| 1172 | ) |
|
| 1173 | ||
| 1174 | if "format-text-title" in definition: |
|
| 1175 | if isinstance(definition["format-text-title"], MetaInlines): |
|
| 1176 | defined[category]["format-text-title"] = definition[ |
|
| 1177 | "format-text-title" |
|
| 1178 | ].content |
|
| 1179 | # Detach from original parent |
|
| 1180 | defined[category]["format-text-title"].parent = None |
|
| 1181 | else: |
|
| 1182 | debug( |
|
| 1183 | "[WARNING] pandoc-numbering: " |
|
| 1184 | "format-text-title is not correct for category " + category |
|
| 1185 | ) |
|
| 1186 | ||
| 1187 | ||