uniword 1.0.11 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/config/font_metadata.yml +56 -0
  3. data/lib/uniword/accessibility/rules/descriptive_headings_rule.rb +1 -1
  4. data/lib/uniword/assembly/toc.rb +4 -14
  5. data/lib/uniword/assembly/variable_substitutor.rb +3 -4
  6. data/lib/uniword/batch/stages/normalize_styles_stage.rb +4 -2
  7. data/lib/uniword/builder/base_builder.rb +25 -0
  8. data/lib/uniword/builder/chart_builder.rb +33 -14
  9. data/lib/uniword/builder/deterministic_id.rb +17 -0
  10. data/lib/uniword/builder/document_builder.rb +129 -34
  11. data/lib/uniword/builder/footnote_builder.rb +22 -23
  12. data/lib/uniword/builder/header_footer_builder.rb +10 -10
  13. data/lib/uniword/builder/image_builder.rb +24 -16
  14. data/lib/uniword/builder/list_builder.rb +2 -1
  15. data/lib/uniword/builder/paragraph_builder.rb +95 -20
  16. data/lib/uniword/builder/run_utils.rb +97 -0
  17. data/lib/uniword/builder/section_builder.rb +40 -67
  18. data/lib/uniword/builder/table_builder.rb +32 -13
  19. data/lib/uniword/builder/table_cell_builder.rb +19 -0
  20. data/lib/uniword/builder.rb +27 -19
  21. data/lib/uniword/cli/diff_cli.rb +0 -1
  22. data/lib/uniword/cli/generate_cli.rb +0 -1
  23. data/lib/uniword/cli/headers_cli.rb +0 -1
  24. data/lib/uniword/cli/images_cli.rb +0 -1
  25. data/lib/uniword/cli/main.rb +6 -7
  26. data/lib/uniword/cli/protect_cli.rb +0 -1
  27. data/lib/uniword/cli/resources_cli.rb +0 -1
  28. data/lib/uniword/cli/review_cli.rb +0 -1
  29. data/lib/uniword/cli/spellcheck_cli.rb +0 -1
  30. data/lib/uniword/cli/styleset_cli.rb +0 -1
  31. data/lib/uniword/cli/template_cli.rb +0 -1
  32. data/lib/uniword/cli/theme_cli.rb +0 -1
  33. data/lib/uniword/cli/toc_cli.rb +0 -1
  34. data/lib/uniword/cli/watermark_cli.rb +0 -1
  35. data/lib/uniword/cli.rb +6 -17
  36. data/lib/uniword/diff/document_differ.rb +23 -5
  37. data/lib/uniword/diff/package_differ.rb +0 -1
  38. data/lib/uniword/diff.rb +4 -0
  39. data/lib/uniword/document_factory.rb +16 -25
  40. data/lib/uniword/docx/document_statistics.rb +42 -54
  41. data/lib/uniword/docx/id_allocator.rb +143 -0
  42. data/lib/uniword/docx/package.rb +42 -6
  43. data/lib/uniword/docx/package_defaults.rb +15 -25
  44. data/lib/uniword/docx/package_serialization.rb +131 -127
  45. data/lib/uniword/docx/reconciler/body.rb +197 -0
  46. data/lib/uniword/docx/reconciler/fix_codes.rb +74 -0
  47. data/lib/uniword/docx/reconciler/helpers.rb +337 -0
  48. data/lib/uniword/docx/reconciler/notes.rb +301 -0
  49. data/lib/uniword/docx/reconciler/package_structure.rb +322 -0
  50. data/lib/uniword/docx/reconciler/parts.rb +484 -0
  51. data/lib/uniword/docx/reconciler/referential_integrity.rb +449 -0
  52. data/lib/uniword/docx/reconciler/tables.rb +162 -0
  53. data/lib/uniword/docx/reconciler/theme.rb +141 -0
  54. data/lib/uniword/docx/reconciler.rb +44 -1097
  55. data/lib/uniword/docx.rb +3 -0
  56. data/lib/uniword/drawingml/color_scheme.rb +38 -5
  57. data/lib/uniword/hyperlink.rb +27 -26
  58. data/lib/uniword/infrastructure/zip_packager.rb +41 -38
  59. data/lib/uniword/lazy_loader.rb +36 -62
  60. data/lib/uniword/math.rb +3 -86
  61. data/lib/uniword/mhtml/document.rb +1 -3
  62. data/lib/uniword/model_attribute_access.rb +27 -0
  63. data/lib/uniword/ooxml/namespaces.rb +62 -2
  64. data/lib/uniword/ooxml/relationships/package_relationships.rb +7 -0
  65. data/lib/uniword/presentationml/slide_id.rb +0 -1
  66. data/lib/uniword/presentationml/slide_master_id.rb +0 -1
  67. data/lib/uniword/properties/bold.rb +0 -2
  68. data/lib/uniword/properties/boolean_formatting.rb +0 -2
  69. data/lib/uniword/properties/borders.rb +1 -1
  70. data/lib/uniword/properties/italic.rb +0 -2
  71. data/lib/uniword/properties/numbering_properties.rb +1 -1
  72. data/lib/uniword/properties/style_reference.rb +13 -0
  73. data/lib/uniword/quality/rules/heading_hierarchy_rule.rb +1 -1
  74. data/lib/uniword/quality/rules/style_consistency_rule.rb +1 -1
  75. data/lib/uniword/review/review_manager.rb +0 -2
  76. data/lib/uniword/template/helpers/loop_helper.rb +2 -2
  77. data/lib/uniword/template/variable_resolver.rb +14 -1
  78. data/lib/uniword/theme/theme_xml_parser.rb +1 -1
  79. data/lib/uniword/toc/toc_generator.rb +3 -14
  80. data/lib/uniword/transformation/mhtml_element_renderer.rb +94 -37
  81. data/lib/uniword/transformation/mhtml_metadata_builder.rb +1 -1
  82. data/lib/uniword/transformation/ooxml_to_html_converter.rb +3 -5
  83. data/lib/uniword/validation/checkers/internal_link_checker.rb +2 -3
  84. data/lib/uniword/version.rb +1 -1
  85. data/lib/uniword/visitor/text_extractor.rb +2 -1
  86. data/lib/uniword/watermark/manager.rb +2 -2
  87. data/lib/uniword/wordprocessingml/allow_png.rb +14 -0
  88. data/lib/uniword/wordprocessingml/body.rb +51 -34
  89. data/lib/uniword/wordprocessingml/body_div.rb +17 -0
  90. data/lib/uniword/wordprocessingml/div_border.rb +23 -0
  91. data/lib/uniword/wordprocessingml/div_borders.rb +24 -0
  92. data/lib/uniword/wordprocessingml/divs_child.rb +17 -0
  93. data/lib/uniword/wordprocessingml/document_root.rb +4 -3
  94. data/lib/uniword/wordprocessingml/endnote.rb +1 -1
  95. data/lib/uniword/wordprocessingml/endnotes.rb +4 -0
  96. data/lib/uniword/wordprocessingml/footer.rb +4 -0
  97. data/lib/uniword/wordprocessingml/footer_reference.rb +0 -1
  98. data/lib/uniword/wordprocessingml/footnote.rb +1 -1
  99. data/lib/uniword/wordprocessingml/footnotes.rb +4 -0
  100. data/lib/uniword/wordprocessingml/header.rb +4 -0
  101. data/lib/uniword/wordprocessingml/header_reference.rb +0 -1
  102. data/lib/uniword/wordprocessingml/hyperlink.rb +2 -2
  103. data/lib/uniword/wordprocessingml/instr_text.rb +20 -5
  104. data/lib/uniword/wordprocessingml/level.rb +2 -0
  105. data/lib/uniword/wordprocessingml/mar_bottom.rb +17 -0
  106. data/lib/uniword/wordprocessingml/mar_left.rb +17 -0
  107. data/lib/uniword/wordprocessingml/mar_right.rb +17 -0
  108. data/lib/uniword/wordprocessingml/mar_top.rb +17 -0
  109. data/lib/uniword/wordprocessingml/num.rb +4 -0
  110. data/lib/uniword/wordprocessingml/numbering.rb +1 -22
  111. data/lib/uniword/wordprocessingml/optimize_for_browser.rb +14 -0
  112. data/lib/uniword/wordprocessingml/page_defaults.rb +39 -0
  113. data/lib/uniword/wordprocessingml/paragraph.rb +16 -13
  114. data/lib/uniword/wordprocessingml/paragraph_properties.rb +12 -8
  115. data/lib/uniword/wordprocessingml/run.rb +32 -36
  116. data/lib/uniword/wordprocessingml/run_properties/merging.rb +45 -0
  117. data/lib/uniword/wordprocessingml/run_properties.rb +8 -5
  118. data/lib/uniword/wordprocessingml/section_properties.rb +3 -3
  119. data/lib/uniword/wordprocessingml/separator_char.rb +21 -0
  120. data/lib/uniword/wordprocessingml/settings.rb +19 -17
  121. data/lib/uniword/wordprocessingml/styles/style_definition.rb +1 -1
  122. data/lib/uniword/wordprocessingml/styles/style_library.rb +16 -0
  123. data/lib/uniword/wordprocessingml/table_defaults.rb +44 -0
  124. data/lib/uniword/wordprocessingml/text.rb +8 -2
  125. data/lib/uniword/wordprocessingml/web_div.rb +41 -0
  126. data/lib/uniword/wordprocessingml/web_divs.rb +18 -0
  127. data/lib/uniword/wordprocessingml/web_encoding.rb +17 -0
  128. data/lib/uniword/wordprocessingml/web_settings.rb +5 -21
  129. data/lib/uniword/wordprocessingml/zoom.rb +2 -0
  130. data/lib/uniword/wordprocessingml.rb +23 -0
  131. data/lib/uniword.rb +27 -0
  132. metadata +46 -70
  133. data/lib/uniword/math/accent.rb +0 -25
  134. data/lib/uniword/math/accent_properties.rb +0 -25
  135. data/lib/uniword/math/argument_properties.rb +0 -22
  136. data/lib/uniword/math/bar.rb +0 -25
  137. data/lib/uniword/math/bar_properties.rb +0 -25
  138. data/lib/uniword/math/begin_char.rb +0 -22
  139. data/lib/uniword/math/border_box.rb +0 -25
  140. data/lib/uniword/math/border_box_properties.rb +0 -39
  141. data/lib/uniword/math/box.rb +0 -25
  142. data/lib/uniword/math/box_properties.rb +0 -33
  143. data/lib/uniword/math/char.rb +0 -22
  144. data/lib/uniword/math/control_properties.rb +0 -27
  145. data/lib/uniword/math/degree.rb +0 -26
  146. data/lib/uniword/math/delimiter.rb +0 -25
  147. data/lib/uniword/math/delimiter_properties.rb +0 -33
  148. data/lib/uniword/math/denominator.rb +0 -26
  149. data/lib/uniword/math/element.rb +0 -61
  150. data/lib/uniword/math/end_char.rb +0 -22
  151. data/lib/uniword/math/equation_array.rb +0 -25
  152. data/lib/uniword/math/equation_array_properties.rb +0 -33
  153. data/lib/uniword/math/fraction.rb +0 -27
  154. data/lib/uniword/math/fraction_properties.rb +0 -25
  155. data/lib/uniword/math/function.rb +0 -27
  156. data/lib/uniword/math/function_name.rb +0 -26
  157. data/lib/uniword/math/function_properties.rb +0 -23
  158. data/lib/uniword/math/group_char.rb +0 -25
  159. data/lib/uniword/math/group_char_properties.rb +0 -29
  160. data/lib/uniword/math/lim.rb +0 -26
  161. data/lib/uniword/math/lower_limit.rb +0 -27
  162. data/lib/uniword/math/lower_limit_properties.rb +0 -23
  163. data/lib/uniword/math/math_break.rb +0 -22
  164. data/lib/uniword/math/math_font.rb +0 -22
  165. data/lib/uniword/math/math_properties.rb +0 -53
  166. data/lib/uniword/math/math_run.rb +0 -42
  167. data/lib/uniword/math/math_run_properties.rb +0 -37
  168. data/lib/uniword/math/math_simple_int_val.rb +0 -24
  169. data/lib/uniword/math/math_simple_val.rb +0 -24
  170. data/lib/uniword/math/math_style.rb +0 -22
  171. data/lib/uniword/math/math_text.rb +0 -23
  172. data/lib/uniword/math/matrix.rb +0 -25
  173. data/lib/uniword/math/matrix_column.rb +0 -23
  174. data/lib/uniword/math/matrix_column_properties.rb +0 -24
  175. data/lib/uniword/math/matrix_columns.rb +0 -23
  176. data/lib/uniword/math/matrix_properties.rb +0 -37
  177. data/lib/uniword/math/matrix_row.rb +0 -23
  178. data/lib/uniword/math/nary.rb +0 -29
  179. data/lib/uniword/math/nary_properties.rb +0 -33
  180. data/lib/uniword/math/numerator.rb +0 -26
  181. data/lib/uniword/math/o_math.rb +0 -65
  182. data/lib/uniword/math/o_math_para.rb +0 -25
  183. data/lib/uniword/math/o_math_para_properties.rb +0 -22
  184. data/lib/uniword/math/phantom.rb +0 -25
  185. data/lib/uniword/math/phantom_properties.rb +0 -33
  186. data/lib/uniword/math/pre_sub_superscript.rb +0 -29
  187. data/lib/uniword/math/pre_sub_superscript_properties.rb +0 -23
  188. data/lib/uniword/math/radical.rb +0 -27
  189. data/lib/uniword/math/radical_properties.rb +0 -25
  190. data/lib/uniword/math/separator_char.rb +0 -22
  191. data/lib/uniword/math/sub.rb +0 -26
  192. data/lib/uniword/math/sub_superscript.rb +0 -29
  193. data/lib/uniword/math/sub_superscript_properties.rb +0 -25
  194. data/lib/uniword/math/subscript.rb +0 -27
  195. data/lib/uniword/math/subscript_properties.rb +0 -23
  196. data/lib/uniword/math/sup.rb +0 -26
  197. data/lib/uniword/math/superscript.rb +0 -27
  198. data/lib/uniword/math/superscript_properties.rb +0 -23
  199. data/lib/uniword/math/upper_limit.rb +0 -27
  200. data/lib/uniword/math/upper_limit_properties.rb +0 -23
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Base element for math structures
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:e>
11
- class Element < Lutaml::Model::Serializable
12
- # Pattern 0: Attributes BEFORE xml mappings
13
- attribute :arg_properties, ArgumentProperties
14
- attribute :runs, MathRun, collection: true, initialize_empty: true
15
- attribute :functions, Function, collection: true, initialize_empty: true
16
- attribute :fractions, Fraction, collection: true, initialize_empty: true
17
- attribute :superscripts, Superscript, collection: true,
18
- initialize_empty: true
19
- attribute :subscripts, Subscript, collection: true, initialize_empty: true
20
- attribute :sub_superscripts, SubSuperscript, collection: true,
21
- initialize_empty: true
22
- attribute :delimiters, Delimiter, collection: true, initialize_empty: true
23
- attribute :radicals, Radical, collection: true, initialize_empty: true
24
- attribute :narys, Nary, collection: true, initialize_empty: true
25
- attribute :boxes, Box, collection: true, initialize_empty: true
26
- attribute :accents, Accent, collection: true, initialize_empty: true
27
- attribute :bars, Bar, collection: true, initialize_empty: true
28
- attribute :group_chars, GroupChar, collection: true,
29
- initialize_empty: true
30
- attribute :border_boxes, BorderBox, collection: true,
31
- initialize_empty: true
32
- attribute :matrices, Matrix, collection: true, initialize_empty: true
33
- attribute :equation_arrays, EquationArray, collection: true,
34
- initialize_empty: true
35
-
36
- xml do
37
- element "e"
38
- namespace Uniword::Ooxml::Namespaces::MathML
39
- mixed_content
40
-
41
- map_element "argPr", to: :arg_properties, render_nil: false
42
- map_element "r", to: :runs, render_nil: false
43
- map_element "func", to: :functions, render_nil: false
44
- map_element "f", to: :fractions, render_nil: false
45
- map_element "sSup", to: :superscripts, render_nil: false
46
- map_element "sSub", to: :subscripts, render_nil: false
47
- map_element "sSubSup", to: :sub_superscripts, render_nil: false
48
- map_element "d", to: :delimiters, render_nil: false
49
- map_element "rad", to: :radicals, render_nil: false
50
- map_element "nary", to: :narys, render_nil: false
51
- map_element "box", to: :boxes, render_nil: false
52
- map_element "acc", to: :accents, render_nil: false
53
- map_element "bar", to: :bars, render_nil: false
54
- map_element "groupChr", to: :group_chars, render_nil: false
55
- map_element "borderBox", to: :border_boxes, render_nil: false
56
- map_element "m", to: :matrices, render_nil: false
57
- map_element "eqArr", to: :equation_arrays, render_nil: false
58
- end
59
- end
60
- end
61
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Ending delimiter character
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:endChr>
11
- class EndChar < Lutaml::Model::Serializable
12
- attribute :val, :string
13
-
14
- xml do
15
- element "endChr"
16
- namespace Uniword::Ooxml::Namespaces::MathML
17
-
18
- map_attribute "val", to: :val
19
- end
20
- end
21
- end
22
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Equation array (system of equations)
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:eqArr>
11
- class EquationArray < Lutaml::Model::Serializable
12
- attribute :properties, EquationArrayProperties
13
- attribute :elements, Element, collection: true, initialize_empty: true
14
-
15
- xml do
16
- element "eqArr"
17
- namespace Uniword::Ooxml::Namespaces::MathML
18
- mixed_content
19
-
20
- map_element "eqArrPr", to: :properties, render_nil: false
21
- map_element "e", to: :elements, render_nil: false
22
- end
23
- end
24
- end
25
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Equation array formatting properties
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:eqArrPr>
11
- class EquationArrayProperties < Lutaml::Model::Serializable
12
- attribute :base_jc, MathSimpleVal
13
- attribute :max_dist, MathSimpleVal
14
- attribute :obj_dist, MathSimpleVal
15
- attribute :row_spacing_rule, MathSimpleIntVal
16
- attribute :row_spacing, MathSimpleIntVal
17
- attribute :ctrl_pr, ControlProperties
18
-
19
- xml do
20
- element "eqArrPr"
21
- namespace Uniword::Ooxml::Namespaces::MathML
22
- mixed_content
23
-
24
- map_element "baseJc", to: :base_jc, render_nil: false
25
- map_element "maxDist", to: :max_dist, render_nil: false
26
- map_element "objDist", to: :obj_dist, render_nil: false
27
- map_element "rSpRule", to: :row_spacing_rule, render_nil: false
28
- map_element "rSp", to: :row_spacing, render_nil: false
29
- map_element "ctrlPr", to: :ctrl_pr, render_nil: false
30
- end
31
- end
32
- end
33
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Mathematical fraction
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:f>
11
- class Fraction < Lutaml::Model::Serializable
12
- attribute :properties, FractionProperties
13
- attribute :numerator, Numerator
14
- attribute :denominator, Denominator
15
-
16
- xml do
17
- element "f"
18
- namespace Uniword::Ooxml::Namespaces::MathML
19
- mixed_content
20
-
21
- map_element "fPr", to: :properties, render_nil: false
22
- map_element "num", to: :numerator
23
- map_element "den", to: :denominator
24
- end
25
- end
26
- end
27
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Fraction formatting properties
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:fPr>
11
- class FractionProperties < Lutaml::Model::Serializable
12
- attribute :type, MathSimpleVal
13
- attribute :ctrl_pr, ControlProperties
14
-
15
- xml do
16
- element "fPr"
17
- namespace Uniword::Ooxml::Namespaces::MathML
18
- mixed_content
19
-
20
- map_element "type", to: :type, render_nil: false
21
- map_element "ctrlPr", to: :ctrl_pr, render_nil: false
22
- end
23
- end
24
- end
25
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Mathematical function (sin, cos, log, etc.)
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:func>
11
- class Function < Lutaml::Model::Serializable
12
- attribute :properties, FunctionProperties
13
- attribute :function_name, FunctionName
14
- attribute :element, Element
15
-
16
- xml do
17
- element "func"
18
- namespace Uniword::Ooxml::Namespaces::MathML
19
- mixed_content
20
-
21
- map_element "funcPr", to: :properties, render_nil: false
22
- map_element "fName", to: :function_name
23
- map_element "e", to: :element
24
- end
25
- end
26
- end
27
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Function name (e.g., sin, cos, log)
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:fName>
11
- class FunctionName < Lutaml::Model::Serializable
12
- # Pattern 0: Attributes BEFORE xml mappings
13
- attribute :arg_properties, ArgumentProperties
14
- attribute :runs, MathRun, collection: true, initialize_empty: true
15
-
16
- xml do
17
- element "fName"
18
- namespace Uniword::Ooxml::Namespaces::MathML
19
- mixed_content
20
-
21
- map_element "argPr", to: :arg_properties, render_nil: false
22
- map_element "r", to: :runs, render_nil: false
23
- end
24
- end
25
- end
26
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Function formatting properties
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:funcPr>
11
- class FunctionProperties < Lutaml::Model::Serializable
12
- attribute :ctrl_pr, ControlProperties
13
-
14
- xml do
15
- element "funcPr"
16
- namespace Uniword::Ooxml::Namespaces::MathML
17
- mixed_content
18
-
19
- map_element "ctrlPr", to: :ctrl_pr, render_nil: false
20
- end
21
- end
22
- end
23
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Group character object (overbrace, underbrace)
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:groupChr>
11
- class GroupChar < Lutaml::Model::Serializable
12
- attribute :properties, GroupCharProperties
13
- attribute :element, Element
14
-
15
- xml do
16
- element "groupChr"
17
- namespace Uniword::Ooxml::Namespaces::MathML
18
- mixed_content
19
-
20
- map_element "groupChrPr", to: :properties, render_nil: false
21
- map_element "e", to: :element
22
- end
23
- end
24
- end
25
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Group character formatting properties
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:groupChrPr>
11
- class GroupCharProperties < Lutaml::Model::Serializable
12
- attribute :chr, Char
13
- attribute :pos, MathSimpleVal
14
- attribute :vert_jc, MathSimpleVal
15
- attribute :ctrl_pr, ControlProperties
16
-
17
- xml do
18
- element "groupChrPr"
19
- namespace Uniword::Ooxml::Namespaces::MathML
20
- mixed_content
21
-
22
- map_element "chr", to: :chr, render_nil: false
23
- map_element "pos", to: :pos, render_nil: false
24
- map_element "vertJc", to: :vert_jc, render_nil: false
25
- map_element "ctrlPr", to: :ctrl_pr, render_nil: false
26
- end
27
- end
28
- end
29
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Limit content
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:lim>
11
- class Lim < Lutaml::Model::Serializable
12
- # Pattern 0: Attributes BEFORE xml mappings
13
- attribute :arg_properties, ArgumentProperties
14
- attribute :runs, MathRun, collection: true, initialize_empty: true
15
-
16
- xml do
17
- element "lim"
18
- namespace Uniword::Ooxml::Namespaces::MathML
19
- mixed_content
20
-
21
- map_element "argPr", to: :arg_properties, render_nil: false
22
- map_element "r", to: :runs, render_nil: false
23
- end
24
- end
25
- end
26
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Lower limit object
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:limLow>
11
- class LowerLimit < Lutaml::Model::Serializable
12
- attribute :properties, LowerLimitProperties
13
- attribute :element, Element
14
- attribute :lim, Lim
15
-
16
- xml do
17
- element "limLow"
18
- namespace Uniword::Ooxml::Namespaces::MathML
19
- mixed_content
20
-
21
- map_element "limLowPr", to: :properties, render_nil: false
22
- map_element "e", to: :element
23
- map_element "lim", to: :lim
24
- end
25
- end
26
- end
27
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Lower limit formatting properties
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:limLowPr>
11
- class LowerLimitProperties < Lutaml::Model::Serializable
12
- attribute :ctrl_pr, ControlProperties
13
-
14
- xml do
15
- element "limLowPr"
16
- namespace Uniword::Ooxml::Namespaces::MathML
17
- mixed_content
18
-
19
- map_element "ctrlPr", to: :ctrl_pr, render_nil: false
20
- end
21
- end
22
- end
23
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Break in math equation
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:brk>
11
- class MathBreak < Lutaml::Model::Serializable
12
- attribute :aln_at, :integer
13
-
14
- xml do
15
- element "brk"
16
- namespace Uniword::Ooxml::Namespaces::MathML
17
-
18
- map_attribute "val", to: :aln_at
19
- end
20
- end
21
- end
22
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Math font specification
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:mathFont>
11
- class MathFont < Lutaml::Model::Serializable
12
- attribute :val, :string
13
-
14
- xml do
15
- element "mathFont"
16
- namespace Uniword::Ooxml::Namespaces::MathML
17
-
18
- map_attribute "val", to: :val
19
- end
20
- end
21
- end
22
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Document-level math properties
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:mathPr>
11
- class MathProperties < Lutaml::Model::Serializable
12
- attribute :math_font, MathFont
13
- attribute :brk_bin, MathSimpleVal
14
- attribute :brk_bin_sub, MathSimpleVal
15
- attribute :small_frac, MathSimpleVal
16
- attribute :disp_def, MathSimpleVal
17
- attribute :lMargin, MathSimpleIntVal
18
- attribute :rMargin, MathSimpleIntVal
19
- attribute :def_jc, MathSimpleVal
20
- attribute :pre_sp, MathSimpleIntVal
21
- attribute :post_sp, MathSimpleIntVal
22
- attribute :inter_sp, MathSimpleIntVal
23
- attribute :intra_sp, MathSimpleIntVal
24
- attribute :wrap_indent, MathSimpleIntVal
25
- attribute :wrap_right, MathSimpleVal
26
- attribute :int_lim, MathSimpleVal
27
- attribute :n_ary_lim, MathSimpleVal
28
-
29
- xml do
30
- element "mathPr"
31
- namespace Uniword::Ooxml::Namespaces::MathML
32
- mixed_content
33
-
34
- map_element "mathFont", to: :math_font, render_nil: false
35
- map_element "brkBin", to: :brk_bin, render_nil: false
36
- map_element "brkBinSub", to: :brk_bin_sub, render_nil: false
37
- map_element "smallFrac", to: :small_frac, render_nil: false
38
- map_element "dispDef", to: :disp_def, render_nil: false
39
- map_element "lMargin", to: :lMargin, render_nil: false
40
- map_element "rMargin", to: :rMargin, render_nil: false
41
- map_element "defJc", to: :def_jc, render_nil: false
42
- map_element "preSp", to: :pre_sp, render_nil: false
43
- map_element "postSp", to: :post_sp, render_nil: false
44
- map_element "interSp", to: :inter_sp, render_nil: false
45
- map_element "intraSp", to: :intra_sp, render_nil: false
46
- map_element "wrapIndent", to: :wrap_indent, render_nil: false
47
- map_element "wrapRight", to: :wrap_right, render_nil: false
48
- map_element "intLim", to: :int_lim, render_nil: false
49
- map_element "naryLim", to: :n_ary_lim, render_nil: false
50
- end
51
- end
52
- end
53
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Math run - text with formatting
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:r>
11
- #
12
- # CRITICAL: Can contain BOTH m:rPr (Math properties) AND w:rPr (Word properties)
13
- class MathRun < Lutaml::Model::Serializable
14
- # Pattern 0: Attributes BEFORE xml mappings
15
- attribute :math_properties, MathRunProperties
16
- attribute :word_properties, Uniword::Wordprocessingml::RunProperties
17
- attribute :text, MathText
18
-
19
- xml do
20
- element "r"
21
- namespace Uniword::Ooxml::Namespaces::MathML
22
- mixed_content
23
-
24
- # Math-specific properties (m:rPr)
25
- # The MathRunProperties class declares its own MathML namespace
26
- map_element "rPr", to: :math_properties,
27
- render_nil: false
28
-
29
- # WordprocessingML properties (w:rPr)
30
- # The RunProperties class declares its own WordProcessingML namespace
31
- # Note: In new lutaml-model, we can't specify namespace at mapping level
32
- # The target class's declared namespace is used instead
33
- map_element "rPr", to: :word_properties,
34
- render_nil: false
35
-
36
- # Math text (m:t)
37
- map_element "t", to: :text,
38
- render_nil: false
39
- end
40
- end
41
- end
42
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Math run formatting properties
8
- #
9
- # Generated from OOXML schema: math.yml
10
- # Element: <m:rPr>
11
- class MathRunProperties < Lutaml::Model::Serializable
12
- # Pattern 0: Attributes BEFORE xml mappings
13
- attribute :lit, :string
14
- attribute :nor, :string
15
- attribute :scr, :string
16
- attribute :sty, MathStyle
17
- attribute :brk, MathBreak
18
- attribute :aln, :string
19
- attribute :ctrl_pr, ControlProperties
20
-
21
- xml do
22
- element "rPr"
23
- namespace Uniword::Ooxml::Namespaces::MathML
24
- mixed_content
25
-
26
- # Each is its own element
27
- map_element "lit", to: :lit, render_nil: false
28
- map_element "nor", to: :nor, render_nil: false
29
- map_element "scr", to: :scr, render_nil: false
30
- map_element "sty", to: :sty, render_nil: false
31
- map_element "brk", to: :brk, render_nil: false
32
- map_element "aln", to: :aln, render_nil: false
33
- map_element "ctrlPr", to: :ctrl_pr, render_nil: false
34
- end
35
- end
36
- end
37
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Generic wrapper for math elements with m:val attribute (integer values)
8
- #
9
- # Reusable across all math property elements that follow the pattern:
10
- # <m:elementName m:val="12345"/>
11
- #
12
- # The element name is determined by the parent's map_element key,
13
- # not by this class's root directive.
14
- class MathSimpleIntVal < Lutaml::Model::Serializable
15
- attribute :value, :integer
16
-
17
- xml do
18
- element "mathSimpleIntVal"
19
- namespace Uniword::Ooxml::Namespaces::MathML
20
- map_attribute "val", to: :value, render_nil: false
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Generic wrapper for math elements with m:val attribute (string values)
8
- #
9
- # Reusable across all math property elements that follow the pattern:
10
- # <m:elementName m:val="stringValue"/>
11
- #
12
- # The element name is determined by the parent's map_element key,
13
- # not by this class's root directive.
14
- class MathSimpleVal < Lutaml::Model::Serializable
15
- attribute :value, :string
16
-
17
- xml do
18
- element "mathSimpleVal"
19
- namespace Uniword::Ooxml::Namespaces::MathML
20
- map_attribute "val", to: :value, render_nil: false
21
- end
22
- end
23
- end
24
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/model"
4
-
5
- module Uniword
6
- module Math
7
- # Math style wrapper
8
- #
9
- # Element: <m:sty>
10
- class MathStyle < Lutaml::Model::Serializable
11
- # Pattern 0: Attribute BEFORE xml mapping
12
- attribute :value, :string
13
-
14
- xml do
15
- element "sty"
16
- namespace Uniword::Ooxml::Namespaces::MathML
17
-
18
- map_attribute "val", to: :value
19
- end
20
- end
21
- end
22
- end