Implementation and formatting of default table (without caption).
[docutils/kirr.git] / sandbox / paultremblay / docutilsToFo / docutils_fo_dicts.py
blobcdd5b29fb7b9042b6776f9183a7ee4160639a1f0
1 # -*- coding: UTF8 -*-
2 from att_set_dict import att_set_dict
5 #===========================================================
6 # SHORT CUTS
8 short_cut_att_sets = {
9 'abstract': 'abstract-block',
10 'abstract-title': 'abstract-title-block',
11 'abstract-paragraph': 'abstract-paragraph-block',
12 'address':'address-block',
13 'author':'author-block',
14 'authors':'authors-block',
15 'bibliographic-field':'bibliographic-fields-item-label-block',
16 'bibliographic-fields': 'bibliographic-fields-list-block',
17 'bibliographic-fields-text': 'bibliographic-fields-item-body',
18 'bibliographic-fields-paragraph': 'bibliographic-fields-block',
19 'body': 'default-flow',
20 'body-header' : 'body-header-block',
21 'body-footer' : 'body-footer-block',
22 'bullet-list': 'bullet-list-block',
23 'bullet-list-level2' :'bullet-level2-list-block',
24 'bullet-list-paragraph': 'bullet-list-item-body-block',
25 'contact':'contact-block',
26 'copyright':'copyright-block',
27 'bibliographic-field-custom1': 'custom-bib-info1',
28 'bibliographic-field-custom2': 'custom-bib-info2',
29 'bibliographic-field-custom3': 'custom-bib-info3',
30 'bibliographic-field-custom4': 'custom-bib-info4',
31 'bibliographic-field-custom5': 'custom-bib-info5',
32 'bibliographic-field-custom6': 'custom-bib-info6',
33 'bibliographic-field-custom7': 'custom-bib-info7',
34 'bibliographic-field-custom8': 'custom-bib-info8',
35 'bibliographic-field-custom9': 'custom-bib-info9',
36 'bibliographic-field-custom10': 'custom-bib-info10',
37 'block-quote' : 'block-quote-outer-block',
38 'block-quote-paragraph' : 'block-quote-paragraph-block',
39 'block-quote-attribution' : 'block-quote-attribution-block',
40 'date':'date-block',
41 'dedication': 'dedication-block',
42 'dedication-title': 'dedication-title-block',
43 'dedication-paragraph': 'dedication-paragraph-block',
44 'definition-list-classifier': 'classifier-inline',
45 'definition-list': 'definition-list-block',
46 'definition-list-paragraph': 'definition-paragraph-block',
47 'definition-list-definition': 'definition-block',
48 'definition-term':'definition-term-block',
49 'document': 'default-page-sequence',
50 'even-footer': 'even-footer-block',
51 'even-header': 'even-header-block',
52 'even-page': 'even-simple-page-master',
53 'enumerated-list': 'enumerated-list-block',
54 'enumerated-list-level2': 'enumerated-level2-list-block',
55 'enumerated-list-paragraph': 'enumerated-list-item-body-block',
56 'field-name':'field-list-item-label-block',
57 'field-list': 'field-list-block',
58 'field-list-paragraph': 'field-body-block',
59 'field-name':'field-list-item-label-block',
60 'first-header' : 'first-header-block',
61 'first-footer' : 'first-footer-block',
62 'first-page': 'first-simple-page-master',
63 'first-paragraph': 'first-paragraph-block',
64 'footer' : 'footer-block',
65 'footer-paragraph': 'paragraph-footer-block',
66 'header': 'header-block',
67 'even-header': 'even-header-block',
68 'header-paragraph': 'paragraph-header-block',
69 'heading1':'title-level1-block',
70 'heading2':'title-level2-block',
71 'heading3':'title-level3-block',
72 'heading4':'title-level4-block',
73 'heading5':'title-level5-block',
74 'heading6':'title-level6-block',
75 'heading7':'title-level7-block',
76 'line-block': 'outer-line-block',
77 'line-level1': 'level1-line-block',
78 'line-level2': 'level2-line-block',
79 'line-level3': 'level3-line-block',
80 'line-level4': 'level4-line-block',
81 'line-level5': 'level5-line-block',
82 'odd-footer': 'odd-footer-block',
83 'odd-header': 'odd-header-block',
84 'odd-page': 'odd-simple-page-master',
85 'option': 'option-inline',
86 'option-argument': 'option-argument-inline',
87 'organization':'organization-block',
88 'page': 'default-simple-page-master',
89 'paper-size': 'paper-size-simple-page-master',
90 'paragraph': 'paragraph-block',
91 'revision':'revision-block',
92 'stanza-title': 'stanza-title-block',
93 'status':'status-block',
94 'subtitle': 'document-subtitle-block',
95 'table-and-caption' : 'table-block-container',
96 'title': 'document-title-block',
97 'title-subtitle': 'document-title-page-block',
98 'toc': 'toc-block',
99 'toc-body-footer':'toc-body-footer-block',
100 'toc-body-header':'toc-body-header-block',
101 'toc-first-header':'toc-first-header-block',
102 'toc-first-footer':'toc-first-footer-block',
103 'toc-odd-header':'toc-odd-header-block',
104 'toc-even-header':'toc-even-header-block',
105 'toc-odd-footer':'toc-odd-footer-block',
106 'toc-even-footer':'toc-even-footer-block',
107 'toc-title': 'toc-title-block',
108 'toc-entry1': 'toc-level1-block',
109 'toc-entry2': 'toc-level2-block',
110 'toc-entry3': 'toc-level3-block',
111 'toc-entry4': 'toc-level4-block',
112 'toc-entry5': 'toc-level5-block',
113 'toc-default': 'toc-entry-defaults-block',
114 'transition':'transition-block',
115 'version':'version-block',
118 short_cut_att_sets2 = {
119 ('option-list-body','list') :'option-list-item-body',
120 ('option-list-body','definition') :'option-list-description-block',
121 ('option-list','list') :'option-list-block',
122 ('option-list','definition') :'option-list-definition-block',
123 ('options', 'list'): 'option-list-item-label-block',
124 ('options', 'definition'): 'option-group-block',
125 ('option-list-paragraph', 'list'): 'option-list-item-body-block',
126 ('option-list-paragraph', 'definition'): 'option-list-paragraph-block',
128 # ===========================================================
133 # ATT LISTS
134 # ==========================================================================
136 accessibility_properties = [
137 'source-document',
138 'role']
139 area_alignment_properties = [
140 'alignment-adjust',
141 'alignment-baseline',
142 'baseline-shift',
143 'dominant-baseline',
144 'vertical-align']
145 area_properties = [
147 area_properties_inheritable = [
148 'display-align',
149 'reference-orientation',
150 'writing-mode']
151 area_properties_unheritable = [
152 'clip',
153 'overflow']
154 aural_properties_inheritable = [
155 'azimuth',
156 'elevation',
157 'pitch',
158 'pitch-range',
159 'play-during',
160 'richness',
161 'speak',
162 'speak-header',
163 'speak-numeral',
164 'speak-punctuation',
165 'speech-rate',
166 'stress',
167 'voice-family',
168 'volume']
169 aural_properties_unheritable = [
170 'cue',
171 'cue-after',
172 'cue-before',
173 'pause',
174 'pause-after',
175 'pause-before']
176 background_properties = [
177 'background',
178 'background-attachment',
179 'background-color',
180 'background-image',
181 'background-position',
182 'background-position-vertical',
183 'background-position-horizontal',
184 'background-repeat',
185 'rx:background-content-type',
186 'rx:background-content-height',
187 'rx:background-content-width',
188 'rx:background-scaling']
189 block_attlist = [
190 'text-altitude',
191 'text-depth']
192 block_container_attlist = [
193 'absolute-position',
194 'z-index']
195 block_properties = [
196 'clear',
197 'span']
198 border_padding_background_properties = [
200 border_precedence_properties = [
201 'border-after-precedence',
202 'border-before-precedence',
203 'border-end-precedence',
204 'border-start-precedence']
205 border_properties = [
206 'border',
207 'border-after-color',
208 'border-after-style',
209 'border-after-width',
210 'border-after-width.length',
211 'border-after-width.conditionality',
212 'border-before-color',
213 'border-before-style',
214 'border-before-width',
215 'border-before-width.length',
216 'border-before-width.conditionality',
217 'border-bottom',
218 'border-bottom-color',
219 'border-bottom-style',
220 'border-bottom-width',
221 'border-bottom-width.length',
222 'border-bottom-width.conditionality',
223 'border-color',
224 'border-end-color',
225 'border-end-style',
226 'border-end-width',
227 'border-end-width.length',
228 'border-end-width.conditionality',
229 'border-left',
230 'border-left-color',
231 'border-left-style',
232 'border-left-width',
233 'border-left-width.length',
234 'border-left-width.conditionality',
235 'border-right',
236 'border-right-color',
237 'border-right-style',
238 'border-right-width',
239 'border-right-width.length',
240 'border-right-width.conditionality',
241 'border-start-color',
242 'border-start-style',
243 'border-start-width',
244 'border-start-width.length',
245 'border-start-width.conditionality',
246 'border-style',
247 'border-top',
248 'border-top-color',
249 'border-top-style',
250 'border-top-width',
251 'border-top-width.length',
252 'border-top-width.conditionality',
253 'border-width']
254 box_size_properties = [
256 character_properties_inheritable = [
257 'letter-spacing',
258 'letter-spacing.minimum',
259 'letter-spacing.optimum',
260 'letter-spacing.maximum',
261 'letter-spacing.precedence',
262 'letter-spacing.conditionality',
263 'word-spacing',
264 'word-spacing.minimum',
265 'word-spacing.optimum',
266 'word-spacing.maximum',
267 'word-spacing.precedence',
268 'word-spacing.conditionality',
269 'glyph-orientation-horizontal',
270 'glyph-orientation-vertical',
271 'score-spaces',
272 'text-transform']
273 character_properties_unheritable = [
274 'text-decoration',
275 'text-shadow']
276 common_block_properties = [
277 'id',
278 'rx:key']
279 common_inline_properties = [
280 'id',
281 'rx:key',
282 'text-altitude',
283 'text-depth']
284 flow_attlist = [
286 flow_properties = [
287 'id',
288 'rx:key',
289 'flow-name']
290 font_properties = [
291 'font',
292 'font-selection-strategy',
293 'font-family',
294 'font-size',
295 'font-size-adjust',
296 'font-stretch',
297 'font-style',
298 'font-variant',
299 'font-weight']
300 footnote_body_attlist = [
302 height_properties = [
303 'height',
304 'min-height',
305 'max-height',
306 'block-progression-dimension',
307 'block-progression-dimension.minimum',
308 'block-progression-dimension.optimum',
309 'block-progression-dimension.maximum']
310 hyphenation_properties_block = [
311 'hyphenation-keep',
312 'hyphenation-ladder-count']
313 hyphenation_properties_inline = [
314 'country',
315 'language',
316 'script',
317 'xml:lang',
318 'hyphenate',
319 'hyphenation-character',
320 'hyphenation-push-character-count',
321 'hyphenation-remain-character-count']
322 inheritable_properties = [
324 inheritable_properties_block = [
325 'intrusion-displace',
326 'relative-align']
327 inheritable_properties_inline = [
328 'color',
329 'visibility']
330 inline_attlist = [
332 inline_properties = [
334 keeps_and_breaks_properties_atomic = [
335 'break-after',
336 'break-before',
337 'page-break-after',
338 'page-break-before']
339 keeps_and_breaks_properties_block_inheritable = [
340 'orphans',
341 'widows']
342 keeps_and_breaks_properties_inline_inheritable = [
343 'keep-together',
344 'keep-together.within-line',
345 'keep-together.within-column',
346 'keep-together.within-page',
347 'page-break-inside']
348 keeps_properties_atomic = [
349 'keep-with-next',
350 'keep-with-next.within-line',
351 'keep-with-next.within-column',
352 'keep-with-next.within-page',
353 'keep-with-previous',
354 'keep-with-previous.within-line',
355 'keep-with-previous.within-column',
356 'keep-with-previous.within-page']
357 leader_properties = [
358 'leader-alignment',
359 'leader-pattern',
360 'leader-pattern-width',
361 'leader-length',
362 'leader-length.minimum',
363 'leader-length.optimum',
364 'leader-length.maximum',
365 'rule-style',
366 'rule-thickness']
367 line_height_properties = [
368 'line-height',
369 'line-height.minimum',
370 'line-height.optimum',
371 'line-height.maximum',
372 'line-height.precedence',
373 'line-height.conditionality',
374 'line-height-shift-adjustment']
375 line_related_properties = [
376 'text-align',
377 'text-align-last',
378 'text-indent',
379 'last-line-end-indent',
380 'line-stacking-strategy',
381 'linefeed-treatment',
382 'white-space',
383 'white-space-treatment',
384 'white-space-collapse',
385 'wrap-option',
386 'direction']
387 list_block_attlist = [
388 'clear']
389 list_item_attlist = [
391 list_item_body_attlist = [
392 'id',
393 'rx:key']
394 list_item_label_attlist = [
395 'id',
396 'rx:key']
397 list_properties = [
398 'provisional-distance-between-starts',
399 'provisional-label-separation']
400 margin_properties_CSS = [
401 'margin',
402 'margin-bottom',
403 'margin-left',
404 'margin-right',
405 'margin-top']
406 margin_properties_block = [
407 'space-after',
408 'space-after.minimum',
409 'space-after.optimum',
410 'space-after.maximum',
411 'space-after.precedence',
412 'space-after.conditionality',
413 'space-before',
414 'space-before.minimum',
415 'space-before.optimum',
416 'space-before.maximum',
417 'space-before.precedence',
418 'space-before.conditionality']
419 margin_properties_inheritable = [
420 'start-indent',
421 'end-indent']
422 margin_properties_inline = [
423 'space-start',
424 'space-start.minimum',
425 'space-start.optimum',
426 'space-start.maximum',
427 'space-start.precedence',
428 'space-start.conditionality',
429 'space-end',
430 'space-end.minimum',
431 'space-end.optimum',
432 'space-end.maximum',
433 'space-end.precedence',
434 'space-end.conditionality']
435 padding_properties = [
436 'padding',
437 'padding-after',
438 'padding-after.length',
439 'padding-after.conditionality',
440 'padding-before',
441 'padding-before.length',
442 'padding-before.conditionality',
443 'padding-bottom',
444 'padding-bottom.length',
445 'padding-bottom.conditionality',
446 'padding-end',
447 'padding-end.length',
448 'padding-end.conditionality',
449 'padding-left',
450 'padding-left.length',
451 'padding-left.conditionality',
452 'padding-right',
453 'padding-right.length',
454 'padding-right.conditionality',
455 'padding-start',
456 'padding-start.length',
457 'padding-start.conditionality',
458 'padding-top',
459 'padding-top.length',
460 'padding-top.conditionality']
461 page_sequence_attlist = [
462 'format',
463 'letter-value',
464 'grouping-separator',
465 'grouping-size',
466 'id',
467 'rx:key',
468 'initial-page-number',
469 'force-page-count',
470 'master-reference']
471 region_after_attlist = [
472 'extent',
473 'precedence']
474 region_before_attlist = [
475 'extent',
476 'precedence']
477 region_body_attlist = [
478 'column-count',
479 'column-gap']
480 region_properties = [
481 'region-name']
482 relative_position_properties = [
483 'relative-position',
484 'position']
485 row_group_attlist = [
486 'id',
487 'rx:key']
488 simple_page_master_attlist = [
489 'master-name',
490 'page-height',
491 'page-width',
492 'reference-orientation',
493 'size',
494 'writing-mode']
495 table_attlist = [
496 'clear']
497 table_body_attlist = [
499 table_cell_attlist = [
500 'id',
501 'rx:key',
502 'column-number',
503 'ends-row',
504 'number-columns-spanned',
505 'number-rows-spanned',
506 'starts-row']
507 table_header_attlist = [
509 table_properties_inheritable = [
510 'border-collapse',
511 'border-spacing',
512 'border-separation',
513 'border-separation.inline-progression-direction',
514 'border-separation.block-progression-direction',
515 'caption-side',
516 'empty-cells']
517 table_properties_unheritable = [
518 'table-layout',
519 'table-omit-header-at-break',
520 'table-omit-footer-at-break',
521 'rx:table-omit-initial-header']
522 table_row_attlist = [
524 width_properties = [
525 'width',
526 'min-width',
527 'max-width',
528 'inline-progression-dimension',
529 'inline-progression-dimension.minimum',
530 'inline-progression-dimension.optimum',
531 'inline-progression-dimension.maximum']
533 area_properties.extend(area_properties_inheritable)
534 area_properties.extend(area_properties_unheritable)
536 inheritable_properties_inline.extend(aural_properties_inheritable)
537 inheritable_properties_inline.extend(character_properties_inheritable)
538 inheritable_properties_inline.extend(font_properties)
539 inheritable_properties_inline.extend(hyphenation_properties_inline)
540 inheritable_properties_inline.extend(line_height_properties)
542 inheritable_properties_block.extend(table_properties_inheritable)
543 inheritable_properties_block.extend(area_properties_inheritable)
544 inheritable_properties_block.extend(hyphenation_properties_block)
545 inheritable_properties_block.extend(margin_properties_inheritable)
546 inheritable_properties_block.extend(keeps_and_breaks_properties_inline_inheritable)
547 inheritable_properties_block.extend(keeps_and_breaks_properties_block_inheritable)
548 inheritable_properties_block.extend(leader_properties)
549 inheritable_properties_block.extend(line_related_properties)
550 inheritable_properties_block.extend(list_properties)
552 inheritable_properties.extend(inheritable_properties_inline)
553 inheritable_properties.extend(inheritable_properties_block)
555 border_padding_background_properties.extend(border_properties)
556 border_padding_background_properties.extend(padding_properties)
557 border_padding_background_properties.extend(background_properties)
559 margin_properties_block.extend(margin_properties_CSS)
560 margin_properties_inline.extend(margin_properties_CSS)
562 keeps_and_breaks_properties_atomic.extend(keeps_properties_atomic)
564 common_block_properties.extend(accessibility_properties)
565 common_block_properties.extend(aural_properties_unheritable)
566 common_block_properties.extend(border_padding_background_properties)
567 common_block_properties.extend(margin_properties_block)
568 common_block_properties.extend(inheritable_properties)
570 common_inline_properties.extend(accessibility_properties)
571 common_inline_properties.extend(aural_properties_unheritable)
572 common_inline_properties.extend(area_alignment_properties)
573 common_inline_properties.extend(border_padding_background_properties)
574 common_inline_properties.extend(character_properties_unheritable)
575 common_inline_properties.extend(keeps_properties_atomic)
576 common_inline_properties.extend(margin_properties_inline)
577 common_inline_properties.extend(relative_position_properties)
578 common_inline_properties.extend(inheritable_properties_inline)
580 region_properties.extend(border_padding_background_properties)
582 region_properties.extend(area_properties)
583 flow_properties.extend(inheritable_properties)
585 block_properties.extend(common_block_properties)
586 block_properties.extend(keeps_and_breaks_properties_atomic)
587 block_properties.extend(relative_position_properties)
589 box_size_properties.extend(height_properties)
590 box_size_properties.extend(width_properties)
592 inline_properties.extend(common_inline_properties)
593 inline_properties.extend(inheritable_properties_block)
595 block_attlist.extend(block_properties)
596 block_attlist.extend(character_properties_unheritable)
597 block_container_attlist.extend(area_properties_unheritable)
598 block_container_attlist.extend(block_properties)
599 block_container_attlist.extend(box_size_properties)
600 flow_attlist.extend(flow_properties)
601 footnote_body_attlist.extend(accessibility_properties)
602 footnote_body_attlist.extend(inheritable_properties)
603 inline_attlist.extend(height_properties)
604 inline_attlist.extend(inline_properties)
605 list_block_attlist.extend(common_block_properties)
606 list_block_attlist.extend(keeps_and_breaks_properties_atomic)
607 list_block_attlist.extend(relative_position_properties)
608 list_item_attlist.extend(common_block_properties)
609 list_item_attlist.extend(keeps_and_breaks_properties_atomic)
610 list_item_attlist.extend(relative_position_properties)
611 list_item_body_attlist.extend(accessibility_properties)
612 list_item_body_attlist.extend(inheritable_properties)
613 list_item_label_attlist.extend(accessibility_properties)
614 list_item_label_attlist.extend(inheritable_properties)
615 page_sequence_attlist.extend(inheritable_properties)
616 region_after_attlist.extend(region_properties)
617 region_before_attlist.extend(region_properties)
618 region_body_attlist.extend(margin_properties_CSS)
619 region_body_attlist.extend(region_properties)
620 row_group_attlist.extend(accessibility_properties)
621 row_group_attlist.extend(aural_properties_unheritable)
622 row_group_attlist.extend(background_properties)
623 row_group_attlist.extend(border_precedence_properties)
624 row_group_attlist.extend(border_properties)
625 row_group_attlist.extend(inheritable_properties)
626 row_group_attlist.extend(relative_position_properties)
627 simple_page_master_attlist.extend(margin_properties_CSS)
628 table_attlist.extend(box_size_properties)
629 table_attlist.extend(common_block_properties)
630 table_attlist.extend(keeps_and_breaks_properties_atomic)
631 table_attlist.extend(table_properties_unheritable)
632 table_body_attlist.extend(keeps_and_breaks_properties_atomic)
633 table_body_attlist.extend(row_group_attlist)
634 table_cell_attlist.extend(accessibility_properties)
635 table_cell_attlist.extend(aural_properties_unheritable)
636 table_cell_attlist.extend(border_padding_background_properties)
637 table_cell_attlist.extend(border_precedence_properties)
638 table_cell_attlist.extend(box_size_properties)
639 table_cell_attlist.extend(inheritable_properties)
640 table_cell_attlist.extend(keeps_and_breaks_properties_atomic)
641 table_header_attlist.extend(row_group_attlist)
642 table_row_attlist.extend(height_properties)
643 table_row_attlist.extend(keeps_and_breaks_properties_atomic)
644 table_row_attlist.extend(row_group_attlist)
646 which_list = {
647 'block': block_attlist,
648 'block-container': block_container_attlist,
649 'cell': table_cell_attlist,
650 'flow': flow_attlist,
651 'footnote-body': footnote_body_attlist,
652 'header': table_header_attlist,
653 'inline': inline_attlist,
654 # 'item-body': list_item_body_attlist,
655 'list-item-body': list_item_body_attlist,
656 'item-label': list_item_label_attlist,
657 'list-block':list_block_attlist,
658 'list-item': list_item_attlist,
659 'page-sequence': page_sequence_attlist,
660 'region-after': region_after_attlist,
661 'region-before': region_before_attlist,
662 'region-body': region_body_attlist,
663 'simple-page-master': simple_page_master_attlist,
664 'table': table_attlist,
665 'table-body': table_body_attlist,
666 'table-cell': table_cell_attlist,
667 'table-header' : table_header_attlist,
668 'table-row': table_row_attlist
671 custom_atts = {
672 'bottom-margin' : 'margin-bottom',
673 'left-margin' : 'margin-left',
674 'right-margin' : 'margin-right',
675 'top-margin' : 'margin-top',
676 'line-spacing':'line-height',
677 'first-line-indent': 'text-indent',
678 'left-indent': 'start-indent',
679 'right-indent': 'end-indent',
680 'alignment':'text-align',
681 'keep-on-same-page': 'keep-together.within-page',
682 'font': 'font-family', # could be problamatic
683 'space-from-label': 'provisional-distance-between-starts',
684 'height': 'page-height',
685 'width': 'page-width',
686 # 'space-from-option': 'provisional-distance-between-starts',
687 # 'space-between-items': 'space-before',
691 special_att_sets_dict = {
694 # att att-sets
695 special_att_att_set_dict = {
696 ('bold', 'font-style'): [('font-weight','bold')],
697 ('italic', 'font-style'): [('font-style','italic')],
698 ('bold-italic', 'font-style'):[('font-weight','bold'), ('font-style','italic')],
699 ('italic-bold', 'font-style'):[('font-weight','bold'), ('font-style','italic')],
700 ('normal', 'font-style'):[('font-weight', 'normal'), ('font-style', 'normal')]
703 # att-sets atts
704 special_att_set_att_dict = {
705 ('bibliographic-fields', 'space-from-field'): [('bibliographic-fields-list-block', 'provisional-distance-between-starts')],
706 ('bibliographic-fields', 'space-from-name'): [('bibliographic-fields-list-block', 'provisional-distance-between-starts')],
707 ('bibliographic-fields', 'space-between-items'): [('bibliographic-fields-list-item', 'space-before')],
708 ('body-section' , 'start-page'):[('body-page-sequence', 'initial-page-number')],
709 ('body-section' , 'page-format'):[('body-page-sequence', 'format')],
710 ('bullet-list', 'space-between-items'): [('bullet-list-item', 'space-before')],
711 ('bullet-list', 'space-from-bullet'): [('bullet-list-block', 'provisional-distance-between-starts')],
712 ('bullet-list-level2', 'space-from-bullet'): [('bullet-level2-list-block', 'provisional-distance-between-starts')],
713 ('bullet-list-level2', 'space-between-items'): [('bullet-level2-list-item', 'space-before')],
714 ('definition-list', 'space-between-items'): [('definition-list-item-block', 'space-before')],
715 ('definition-list', 'space-below-term'): [('definition-term-block', 'space-after')],
717 ('enumerated-list', 'space-between-items'): [('enumerated-list-item', 'space-before')],
718 ('enumerated-list', 'space-from-number'): [('enumerated-list-block', 'provisional-distance-between-starts')],
719 ('enumerated-list-level2', 'space-from-number'): [('bullet-level2-list-block', 'provisional-distance-between-starts')],
720 ('enumerated-list-level2', 'space-between-items'): [('bullet-level2-list-item', 'space-before')],
721 ('header' , 'height'):[('header-region-before', 'extent'),('region-body', 'margin-top')],
722 ('field-list', 'space-from-name'): [('field-list-block', 'provisional-distance-between-starts')],
723 ('field-list', 'space-between-items'): [('field-list-item', 'space-before')],
724 ('footer' , 'height'):[('footer-region-after', 'extent'),('region-body', 'margin-bottom')],
725 ('toc-section' , 'start-page'):[('toc-page-sequence', 'initial-page-number')],
726 ('toc-section' , 'page-format'):[('toc-page-sequence', 'format')],
727 ('table' , 'width'):[('table', 'inline-progression-dimension')],
731 # special: only in certain contexts
732 special_att_set_att_dict2 = {
733 ('option-list', 'space-from-option', 'list'): [('option-list-block', 'provisional-distance-between-starts')],
734 ('option-list', 'space-between-items', 'list'): [('option-list-item', 'space-before')],
735 ('option-list', 'space-between-items', 'definition'): [('option-list-item-block', 'space-before')],
736 ('option-list', 'space-below-option', 'definition'): [('option-group-block', 'space-after')],
738 special_att_value_dict = {
739 ('font-style', 'bold'): [('font-weight','bold')],
740 ('font-style', 'italic'): [('font-style','italic')],
741 ('font-style','bold-italic'):[('font-weight','bold'), ('font-style','italic')],
742 ('font-style','italic-bold' ):[('font-weight','bold'), ('font-style','italic')],
743 ('font-style', 'normal'):[('font-weight', 'normal'), ('font-style', 'normal')],
744 ('page-break-before' , 'True'):[('break-before', 'page')],
745 ('page-break-before' , 'true'):[('break-before', 'page')],
746 ('page-break-before' , 'Yes'):[('break-before', 'page')],
747 ('page-break-before' , 'yes'):[('break-before', 'page')],
748 ('page-break-before' , 'False'):[('break-before', 'auto')],
749 ('page-break-before' , 'ralse'):[('break-before', 'auto')],
750 ('page-break-before' , 'No'):[('break-before', 'auto')],
751 ('page-break-before' , 'no'):[('break-before', 'auto')],
752 ('page-break-after' , 'True'):[('break-after', 'page')],
753 ('page-break-after' , 'true'):[('break-after', 'page')],
754 ('page-break-after' , 'Yes'):[('break-after', 'page')],
755 ('page-break-after' , 'yes'):[('break-after', 'page')],
756 ('page-break-after' , 'False'):[('break-after', 'auto')],
757 ('page-break-after' , 'ralse'):[('break-after', 'auto')],
758 ('page-break-after' , 'No'):[('break-after', 'auto')],
759 ('page-break-after' , 'no'):[('break-after', 'auto')],
760 ('keep-with-next' , 'True'):[('keep-with-next', 'always')],
761 ('keep-with-next' , 'true'):[('keep-with-next', 'always')],
762 ('keep-with-next' , 'Yes'):[('keep-with-next', 'always')],
763 ('keep-with-next' , 'yes'):[('keep-with-next', 'always')],
764 ('keep-with-previous' , 'True'):[('keep-with-previous', 'always')],
765 ('keep-with-previous' , 'true'):[('keep-with-previous', 'always')],
766 ('keep-with-previous' , 'Yes'):[('keep-with-previous', 'always')],
767 ('keep-with-previous' , 'yes'):[('keep-with-previous', 'always')],
768 ('keep-on-same-page' , 'True'):[('keep-together.within-page', 'always')],
769 ('keep-on-same-page' , 'true'):[('keep-together.within-page', 'always')],
770 ('keep-on-same-page' , 'Yes'):[('keep-together.within-page', 'always')],
771 ('keep-on-same-page' , 'yes'):[('keep-together.within-page', 'always')],
772 ('vertical-alignment' , 'bottom'):[('display-align', 'after')],
773 ('vertical-alignment' , 'top'):[('display-align', 'before')],
774 ('vertical-alignment' , 'center'):[('display-align', 'center')],
777 special_values_dict = {
781 # ==================================================================
782 # PROPERTIES THAT ARE REALLY PARAMS
784 prop_as_param_dict = {
785 'page.page-layout':'page-layout',
786 'title-subtitle.placement': 'title-pagination',
787 'bibliographic-fields.placement' : 'bibliographic-pagination',
788 'dedication.placement': 'dedication-pagination',
789 'abstract.placement': 'abstract-pagination',
790 'toc.placement': 'toc-pagination',
791 'front.order': 'font-order',
792 'header.suppress-first-page': 'suppress-first-page-header',
793 'footer.suppress-first-page': 'suppress-first-page-footer',
794 'bibliographic-fields.author-text': 'author-text',
795 'bibliographic-fields.authors-text': 'authors-text',
796 'bibliographic-fields.organization-text': 'organization-text',
797 'bibliographic-fields.contact-text': 'contact-text',
798 'bibliographic-fields.status-text': 'status-text',
799 'bibliographic-fields.copyright-text': 'copyright-text',
800 'bibliographic-fields.address-text': 'address-text',
801 'bibliographic-fields.revision-text': 'revision-text',
802 'bibliographic-fields.date-text': 'date-text',
803 'bibliographic-fields.format': 'bibliographic-format',
804 'bibliographic-field-custom1.text': 'custom-bib-info1-name',
805 'bibliographic-field-custom2.text': 'custom-bib-info2-name',
806 'bibliographic-field-custom3.text': 'custom-bib-info3-name',
807 'bibliographic-field-custom4.text': 'custom-bib-info4-name',
808 'bibliographic-field-custom5.text': 'custom-bib-info5-name',
809 'bibliographic-field-custom6.text': 'custom-bib-info6-name',
810 'bibliographic-field-custom7.text': 'custom-bib-info7-name',
811 'bibliographic-field-custom8.text': 'custom-bib-info8-name',
812 'bibliographic-field-custom9.text': 'custom-bib-info9-name',
813 'bibliographic-field-custom10.text': 'custom-bib-info10-name',
814 'heading1.number-format':'number-section1',
815 'heading2.number-format':'number-section2',
816 'heading3.number-format':'number-section3',
817 'heading4.number-format':'number-section4',
818 'heading5.number-format':'number-section5',
819 'heading6.number-format':'number-section6',
820 'heading7.number-format':'number-section7',
821 'headings.inherit-sections-number':'inherit-section-num',
822 'line-block.number': 'number-verse',
823 'transition.text':'transition-text',
824 'bullet-list.text': 'bullet-text',
825 'bullet-list-level2.text': 'bullet-text-level2',
826 'option-list.format':'option-list-format',
827 'options-list.separator': 'options-separator',
828 'document.page-layout': 'page-layout',
829 'block-quote.attriubution-text' : 'text-before-block-quote-attribution',
830 'table.column-widths': 'table-cols',
834 # ========================================================================
835 # DEFAULT PARAMS
836 param_dict = {
837 'abstract-pagination' : 'with-front',
838 'address-text' : 'Address: ',
839 'attention-title' : 'Attention!',
840 'author-text' : 'Author: ',
841 'authors-text' : 'Authors: ',
842 'bibliographic-pagination' : 'with-toc',
843 'bullet-text' : '•',
844 'caution-title' : 'Caution!',
845 'contact-text' : 'Contact: ',
846 'copyright-text' : 'Copyright: ',
847 'danger-title' : '!Danger!',
848 'date-text' : 'Date: ',
849 'dedication-pagination' : 'with-front',
850 'error-title' : 'Error',
851 'footnote-placement' : 'footnote',
852 'footnote-style' : 'list',
853 'front-order' : 'title,bibliographic,dedication,abstract,toc',
854 'hint-title' : 'Hint',
855 'important-title' : 'Important',
856 'inherit-section-num' : 'True',
857 'internal-link-type' : 'link',
858 'note-title' : 'Note',
859 'number-section1' : '1',
860 'number-section2' : '.1',
861 'number-section3' : '.1',
862 'number-section4' : '.1',
863 'number-section5' : '.1',
864 'number-section6' : '.1',
865 'number-section7' : '.1',
866 'number-section8' : '.1',
867 'number-section9' : '.1',
868 'number-verse' : '',
869 'option-list-format' : 'list',
870 'options-separator' : ', ',
871 'organization-text' : 'Organization: ',
872 'page-layout' : 'simple',
873 'revision-text' : 'Revision: ',
874 'space-between-footnotes' : '5pt',
875 'spacing-footer' : '',
876 'spacing-header' : '',
877 'status-text' : 'Status: ',
878 'strict' : '',
879 'suppress-first-page-footer' : '',
880 'suppress-first-page-header' : '',
881 'table-title-placement' : 'bottom',
882 'test' : '',
883 'text-before-block-quote-attribution' : '—',
884 'text-before-epigraph-attribution' : '—',
885 'text-before-pull-quote-attribution' : '—',
886 'tip-title' : 'Tip',
887 'title-pagination' : 'with-front',
888 'toc-pagination' : 'with-toc',
889 'transition-text' : '***',
890 'version-text' : 'Version: ',
891 'warning-title' : 'Warning!',
893 param_list = param_dict.keys()
895 true_or_false_dict = {'True':'True', 'true':'True', 'yes':'True', 'Yes': 'True', 'False': 'False',
896 'false':'False', 'no': 'False', 'No':'False'}
897 true_dict = {'true':True, 'True':True, 'yes':True, 'Yes':True}
898 false_dict = {'false':False, 'False':False, 'none': False, 'None':False, 'no': False, 'No':False}
899 param_dict_test = {'strict':true_or_false_dict,
900 'suppress-first-page-header': true_or_false_dict,
901 'suppress-first-page-footer': true_or_false_dict,
904 # Commands List
905 # =========================================================================
906 commands_list = ['xsl-stylesheet']