omml 0.2.1 → 0.2.3
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop_todo.yml +12 -6
- data/CLAUDE.md +19 -9
- data/Gemfile +0 -3
- data/TODO.uniwordfix/00-overview.md +29 -0
- data/TODO.uniwordfix/01-revert-contributor-changes.md +25 -0
- data/TODO.uniwordfix/02-models-base.md +55 -0
- data/TODO.uniwordfix/03-migrate-models.md +38 -0
- data/TODO.uniwordfix/04-autoload-conversion.md +52 -0
- data/TODO.uniwordfix/05-encapsulation-cleanup.md +67 -0
- data/TODO.uniwordfix/06-register-in-api.md +44 -0
- data/TODO.uniwordfix/07-spec-coverage.md +43 -0
- data/TODO.uniwordfix/08-spec-cross-context.md +63 -0
- data/TODO.uniwordfix/09-spec-cleanup.md +37 -0
- data/TODO.uniwordfix/10-claude-md-stale.md +34 -0
- data/lib/omml/configuration/context_registry.rb +36 -2
- data/lib/omml/configuration/model_registry.rb +6 -2
- data/lib/omml/configuration/type_resolver.rb +0 -2
- data/lib/omml/configuration.rb +5 -5
- data/lib/omml/models/base.rb +16 -0
- data/lib/omml/models/ct_acc.rb +1 -3
- data/lib/omml/models/ct_acc_pr.rb +1 -3
- data/lib/omml/models/ct_anchor.rb +1 -3
- data/lib/omml/models/ct_attr.rb +1 -3
- data/lib/omml/models/ct_bar.rb +1 -3
- data/lib/omml/models/ct_bar_pr.rb +1 -3
- data/lib/omml/models/ct_bookmark.rb +0 -2
- data/lib/omml/models/ct_bookmark_range.rb +0 -2
- data/lib/omml/models/ct_border.rb +1 -3
- data/lib/omml/models/ct_border_box.rb +1 -3
- data/lib/omml/models/ct_border_box_pr.rb +1 -3
- data/lib/omml/models/ct_box.rb +1 -3
- data/lib/omml/models/ct_box_pr.rb +1 -3
- data/lib/omml/models/ct_br.rb +2 -4
- data/lib/omml/models/ct_break_bin.rb +1 -3
- data/lib/omml/models/ct_break_bin_sub.rb +1 -3
- data/lib/omml/models/ct_calendar_type.rb +1 -3
- data/lib/omml/models/ct_char.rb +1 -3
- data/lib/omml/models/ct_color.rb +1 -3
- data/lib/omml/models/ct_control.rb +1 -3
- data/lib/omml/models/ct_ctrl_pr.rb +1 -3
- data/lib/omml/models/ct_custom_xml_pr.rb +1 -3
- data/lib/omml/models/ct_custom_xml_run.rb +1 -3
- data/lib/omml/models/ct_d.rb +1 -3
- data/lib/omml/models/ct_d_pr.rb +1 -3
- data/lib/omml/models/ct_data_binding.rb +1 -3
- data/lib/omml/models/ct_decimal_number.rb +1 -3
- data/lib/omml/models/ct_drawing.rb +1 -3
- data/lib/omml/models/ct_east_asian_layout.rb +1 -3
- data/lib/omml/models/ct_effect_extent.rb +1 -3
- data/lib/omml/models/ct_em.rb +1 -3
- data/lib/omml/models/ct_empty.rb +1 -3
- data/lib/omml/models/ct_eq_arr.rb +1 -3
- data/lib/omml/models/ct_eq_arr_pr.rb +1 -3
- data/lib/omml/models/ct_f.rb +1 -3
- data/lib/omml/models/ct_f_pr.rb +1 -3
- data/lib/omml/models/ct_f_type.rb +1 -3
- data/lib/omml/models/ct_ff_check_box.rb +1 -3
- data/lib/omml/models/ct_ff_data.rb +1 -3
- data/lib/omml/models/ct_ff_help_text.rb +1 -3
- data/lib/omml/models/ct_ff_name.rb +1 -3
- data/lib/omml/models/ct_ff_status_text.rb +1 -3
- data/lib/omml/models/ct_ff_text_input.rb +1 -3
- data/lib/omml/models/ct_ff_text_type.rb +1 -3
- data/lib/omml/models/ct_ffdd_list.rb +1 -3
- data/lib/omml/models/ct_fit_text.rb +1 -3
- data/lib/omml/models/ct_fld_char.rb +1 -3
- data/lib/omml/models/ct_fonts.rb +1 -3
- data/lib/omml/models/ct_ftn_edn_ref.rb +1 -3
- data/lib/omml/models/ct_func.rb +1 -3
- data/lib/omml/models/ct_func_pr.rb +1 -3
- data/lib/omml/models/ct_graphical_object.rb +1 -3
- data/lib/omml/models/ct_graphical_object_data.rb +1 -3
- data/lib/omml/models/ct_graphical_object_frame_locking.rb +1 -3
- data/lib/omml/models/ct_group_chr.rb +1 -3
- data/lib/omml/models/ct_group_chr_pr.rb +1 -3
- data/lib/omml/models/ct_highlight.rb +1 -3
- data/lib/omml/models/ct_hps_measure.rb +1 -3
- data/lib/omml/models/ct_hyperlink.rb +1 -3
- data/lib/omml/models/ct_inline.rb +1 -3
- data/lib/omml/models/ct_integer2.rb +1 -3
- data/lib/omml/models/ct_integer255.rb +1 -3
- data/lib/omml/models/ct_lang.rb +1 -3
- data/lib/omml/models/ct_language.rb +1 -3
- data/lib/omml/models/ct_lim_loc.rb +1 -3
- data/lib/omml/models/ct_lim_low.rb +1 -3
- data/lib/omml/models/ct_lim_low_pr.rb +1 -3
- data/lib/omml/models/ct_lim_upp.rb +1 -3
- data/lib/omml/models/ct_lim_upp_pr.rb +1 -3
- data/lib/omml/models/ct_lock.rb +1 -3
- data/lib/omml/models/ct_m.rb +1 -3
- data/lib/omml/models/ct_m_pr.rb +1 -3
- data/lib/omml/models/ct_macro_name.rb +1 -3
- data/lib/omml/models/ct_manual_break.rb +1 -3
- data/lib/omml/models/ct_markup.rb +1 -3
- data/lib/omml/models/ct_markup_range.rb +0 -2
- data/lib/omml/models/ct_math_pr.rb +1 -3
- data/lib/omml/models/ct_mc.rb +1 -3
- data/lib/omml/models/ct_mc_pr.rb +1 -3
- data/lib/omml/models/ct_mcs.rb +1 -3
- data/lib/omml/models/ct_move_bookmark.rb +0 -2
- data/lib/omml/models/ct_mr.rb +1 -3
- data/lib/omml/models/ct_nary.rb +1 -3
- data/lib/omml/models/ct_nary_pr.rb +1 -3
- data/lib/omml/models/ct_non_visual_drawing_props.rb +1 -3
- data/lib/omml/models/ct_non_visual_graphic_frame_properties.rb +1 -3
- data/lib/omml/models/ct_o_math.rb +1 -3
- data/lib/omml/models/ct_o_math_arg.rb +1 -3
- data/lib/omml/models/ct_o_math_arg_pr.rb +1 -3
- data/lib/omml/models/ct_o_math_jc.rb +1 -3
- data/lib/omml/models/ct_o_math_para.rb +1 -3
- data/lib/omml/models/ct_o_math_para_pr.rb +1 -3
- data/lib/omml/models/ct_object.rb +0 -2
- data/lib/omml/models/ct_office_art_extension.rb +1 -3
- data/lib/omml/models/ct_office_art_extension_list.rb +1 -3
- data/lib/omml/models/ct_on_off.rb +1 -3
- data/lib/omml/models/ct_p_tab.rb +1 -3
- data/lib/omml/models/ct_perm.rb +1 -3
- data/lib/omml/models/ct_perm_start.rb +0 -2
- data/lib/omml/models/ct_phant.rb +1 -3
- data/lib/omml/models/ct_phant_pr.rb +1 -3
- data/lib/omml/models/ct_picture.rb +0 -2
- data/lib/omml/models/ct_picture_base.rb +1 -3
- data/lib/omml/models/ct_placeholder.rb +1 -3
- data/lib/omml/models/ct_point2_d.rb +1 -3
- data/lib/omml/models/ct_pos_h.rb +1 -3
- data/lib/omml/models/ct_pos_v.rb +1 -3
- data/lib/omml/models/ct_positive_size2_d.rb +1 -3
- data/lib/omml/models/ct_proof_err.rb +1 -3
- data/lib/omml/models/ct_r.rb +3 -3
- data/lib/omml/models/ct_r_pr.rb +1 -3
- data/lib/omml/models/ct_r_pr_change.rb +0 -2
- data/lib/omml/models/ct_r_pr_original.rb +1 -3
- data/lib/omml/models/ct_rad.rb +1 -3
- data/lib/omml/models/ct_rad_pr.rb +1 -3
- data/lib/omml/models/ct_rel.rb +1 -3
- data/lib/omml/models/ct_rpr.rb +1 -3
- data/lib/omml/models/ct_ruby.rb +1 -3
- data/lib/omml/models/ct_ruby_align.rb +1 -3
- data/lib/omml/models/ct_ruby_content.rb +1 -3
- data/lib/omml/models/ct_ruby_pr.rb +1 -3
- data/lib/omml/models/ct_run_track_change.rb +0 -2
- data/lib/omml/models/ct_s_pre.rb +1 -3
- data/lib/omml/models/ct_s_pre_pr.rb +1 -3
- data/lib/omml/models/ct_s_sub.rb +1 -3
- data/lib/omml/models/ct_s_sub_pr.rb +1 -3
- data/lib/omml/models/ct_s_sub_sup.rb +1 -3
- data/lib/omml/models/ct_s_sub_sup_pr.rb +1 -3
- data/lib/omml/models/ct_s_sup.rb +1 -3
- data/lib/omml/models/ct_s_sup_pr.rb +1 -3
- data/lib/omml/models/ct_script.rb +1 -3
- data/lib/omml/models/ct_sdt_combo_box.rb +1 -3
- data/lib/omml/models/ct_sdt_content_run.rb +1 -3
- data/lib/omml/models/ct_sdt_date.rb +1 -3
- data/lib/omml/models/ct_sdt_date_mapping_type.rb +1 -3
- data/lib/omml/models/ct_sdt_doc_part.rb +1 -3
- data/lib/omml/models/ct_sdt_drop_down_list.rb +1 -3
- data/lib/omml/models/ct_sdt_end_pr.rb +1 -3
- data/lib/omml/models/ct_sdt_list_item.rb +1 -3
- data/lib/omml/models/ct_sdt_pr.rb +1 -3
- data/lib/omml/models/ct_sdt_run.rb +1 -3
- data/lib/omml/models/ct_sdt_text.rb +1 -3
- data/lib/omml/models/ct_shd.rb +1 -3
- data/lib/omml/models/ct_shp.rb +1 -3
- data/lib/omml/models/ct_signed_hps_measure.rb +1 -3
- data/lib/omml/models/ct_signed_twips_measure.rb +1 -3
- data/lib/omml/models/ct_simple_field.rb +1 -3
- data/lib/omml/models/ct_smart_tag_pr.rb +1 -3
- data/lib/omml/models/ct_smart_tag_run.rb +1 -3
- data/lib/omml/models/ct_spacing_rule.rb +1 -3
- data/lib/omml/models/ct_string.rb +1 -3
- data/lib/omml/models/ct_style.rb +1 -3
- data/lib/omml/models/ct_sym.rb +1 -3
- data/lib/omml/models/ct_text.rb +1 -3
- data/lib/omml/models/ct_text_effect.rb +1 -3
- data/lib/omml/models/ct_text_scale.rb +1 -3
- data/lib/omml/models/ct_top_bot.rb +1 -3
- data/lib/omml/models/ct_track_change.rb +0 -2
- data/lib/omml/models/ct_track_change_numbering.rb +0 -2
- data/lib/omml/models/ct_twips_measure.rb +1 -3
- data/lib/omml/models/ct_un_signed_integer.rb +1 -3
- data/lib/omml/models/ct_underline.rb +1 -3
- data/lib/omml/models/ct_vertical_align_run.rb +1 -3
- data/lib/omml/models/ct_wordprocessing_empty.rb +24 -0
- data/lib/omml/models/ct_wordprocessing_on_off.rb +1 -3
- data/lib/omml/models/ct_wordprocessing_text.rb +26 -0
- data/lib/omml/models/ct_wrap_none.rb +1 -3
- data/lib/omml/models/ct_wrap_path.rb +1 -3
- data/lib/omml/models/ct_wrap_square.rb +1 -3
- data/lib/omml/models/ct_wrap_through.rb +1 -3
- data/lib/omml/models/ct_wrap_tight.rb +1 -3
- data/lib/omml/models/ct_wrap_top_bottom.rb +1 -3
- data/lib/omml/models/ct_x_align.rb +1 -3
- data/lib/omml/models/ct_y_align.rb +1 -3
- data/lib/omml/models/groups/eg_content_run_content.rb +1 -3
- data/lib/omml/models/groups/eg_math_content.rb +1 -3
- data/lib/omml/models/groups/eg_o_math_elements.rb +1 -3
- data/lib/omml/models/groups/eg_o_math_math_elements.rb +1 -3
- data/lib/omml/models/groups/eg_office_art_extension_list.rb +1 -3
- data/lib/omml/models/groups/eg_p_content.rb +1 -3
- data/lib/omml/models/groups/eg_r_pr.rb +1 -3
- data/lib/omml/models/groups/eg_r_pr_base.rb +1 -3
- data/lib/omml/models/groups/eg_r_pr_content.rb +1 -3
- data/lib/omml/models/groups/eg_r_pr_math.rb +1 -3
- data/lib/omml/models/groups/eg_range_markup_elements.rb +1 -3
- data/lib/omml/models/groups/eg_ruby_content.rb +1 -3
- data/lib/omml/models/groups/eg_run_inner_content.rb +5 -68
- data/lib/omml/models/groups/eg_run_level_elts.rb +1 -3
- data/lib/omml/models/groups/eg_script_style.rb +1 -3
- data/lib/omml/models/groups/eg_word_r_pr.rb +1 -3
- data/lib/omml/models/groups/eg_word_run_inner_content.rb +91 -0
- data/lib/omml/models/groups/eg_wrap_type.rb +1 -3
- data/lib/omml/models/groups.rb +0 -18
- data/lib/omml/models/o_math.rb +1 -3
- data/lib/omml/models/o_math_para.rb +1 -3
- data/lib/omml/models/registerable.rb +22 -0
- data/lib/omml/models/simple_types/enum_string.rb +5 -0
- data/lib/omml/models/simple_types/hex_binary.rb +0 -1
- data/lib/omml/models/simple_types/st_adj_coordinate.rb +2 -1
- data/lib/omml/models/simple_types/st_align_h.rb +0 -2
- data/lib/omml/models/simple_types/st_align_v.rb +0 -2
- data/lib/omml/models/simple_types/st_border.rb +0 -2
- data/lib/omml/models/simple_types/st_br_clear.rb +0 -2
- data/lib/omml/models/simple_types/st_br_type.rb +0 -2
- data/lib/omml/models/simple_types/st_break_bin.rb +0 -2
- data/lib/omml/models/simple_types/st_break_bin_sub.rb +0 -2
- data/lib/omml/models/simple_types/st_calendar_type.rb +0 -2
- data/lib/omml/models/simple_types/st_combine_brackets.rb +0 -2
- data/lib/omml/models/simple_types/st_coordinate.rb +0 -1
- data/lib/omml/models/simple_types/st_displaced_by_custom_xml.rb +0 -2
- data/lib/omml/models/simple_types/st_ed_grp.rb +0 -2
- data/lib/omml/models/simple_types/st_em.rb +0 -2
- data/lib/omml/models/simple_types/st_f_type.rb +0 -2
- data/lib/omml/models/simple_types/st_ff_text_type.rb +0 -2
- data/lib/omml/models/simple_types/st_fld_char_type.rb +0 -2
- data/lib/omml/models/simple_types/st_geom_guide_name.rb +0 -2
- data/lib/omml/models/simple_types/st_hex_color.rb +2 -1
- data/lib/omml/models/simple_types/st_highlight_color.rb +0 -2
- data/lib/omml/models/simple_types/st_hint.rb +0 -2
- data/lib/omml/models/simple_types/st_info_text_type.rb +0 -2
- data/lib/omml/models/simple_types/st_integer2.rb +0 -1
- data/lib/omml/models/simple_types/st_integer255.rb +0 -1
- data/lib/omml/models/simple_types/st_jc.rb +0 -2
- data/lib/omml/models/simple_types/st_lang.rb +2 -1
- data/lib/omml/models/simple_types/st_lim_loc.rb +0 -2
- data/lib/omml/models/simple_types/st_lock.rb +0 -2
- data/lib/omml/models/simple_types/st_on_off.rb +0 -2
- data/lib/omml/models/simple_types/st_p_tab_alignment.rb +0 -2
- data/lib/omml/models/simple_types/st_p_tab_leader.rb +0 -2
- data/lib/omml/models/simple_types/st_p_tab_relative_to.rb +0 -2
- data/lib/omml/models/simple_types/st_positive_coordinate.rb +0 -1
- data/lib/omml/models/simple_types/st_proof_err.rb +0 -2
- data/lib/omml/models/simple_types/st_rel_from_h.rb +0 -2
- data/lib/omml/models/simple_types/st_rel_from_v.rb +0 -2
- data/lib/omml/models/simple_types/st_ruby_align.rb +0 -2
- data/lib/omml/models/simple_types/st_script.rb +0 -2
- data/lib/omml/models/simple_types/st_sdt_date_mapping_type.rb +0 -2
- data/lib/omml/models/simple_types/st_shd.rb +0 -2
- data/lib/omml/models/simple_types/st_shp.rb +0 -2
- data/lib/omml/models/simple_types/st_spacing_rule.rb +0 -1
- data/lib/omml/models/simple_types/st_style.rb +0 -2
- data/lib/omml/models/simple_types/st_text_effect.rb +0 -2
- data/lib/omml/models/simple_types/st_text_scale.rb +0 -1
- data/lib/omml/models/simple_types/st_theme.rb +0 -2
- data/lib/omml/models/simple_types/st_theme_color.rb +0 -2
- data/lib/omml/models/simple_types/st_top_bot.rb +0 -2
- data/lib/omml/models/simple_types/st_underline.rb +0 -2
- data/lib/omml/models/simple_types/st_vertical_align_run.rb +0 -2
- data/lib/omml/models/simple_types/st_wrap_text.rb +0 -2
- data/lib/omml/models/simple_types/st_x_align.rb +0 -2
- data/lib/omml/models/simple_types/st_y_align.rb +0 -2
- data/lib/omml/models/simple_types/token.rb +5 -0
- data/lib/omml/models/simple_types/unsigned_int.rb +0 -1
- data/lib/omml/models/simple_types/unsigned_long.rb +0 -1
- data/lib/omml/models/simple_types.rb +0 -59
- data/lib/omml/models.rb +275 -177
- data/lib/omml/namespace.rb +2 -0
- data/lib/omml/version.rb +1 -1
- data/lib/omml/wordprocessing_namespace.rb +2 -0
- data/reference-docs/shared-math.xsd +1528 -0
- metadata +19 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Omml
|
|
4
4
|
module Models
|
|
5
|
-
class EGWordRPr <
|
|
5
|
+
class EGWordRPr < Base
|
|
6
6
|
attribute :word_r_pr, :ct_r_pr, collection: 0..1
|
|
7
7
|
|
|
8
8
|
xml do
|
|
@@ -11,7 +11,5 @@ module Omml
|
|
|
11
11
|
map_element :rPr, to: :word_r_pr
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
|
-
|
|
15
|
-
Omml::Configuration.register_model(EGWordRPr)
|
|
16
14
|
end
|
|
17
15
|
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Omml
|
|
4
|
+
module Models
|
|
5
|
+
# WordprocessingML run inner content elements referenced from CT_R via
|
|
6
|
+
# <xsd:group ref="w:EG_RunInnerContent" /> in shared-math.xsd.
|
|
7
|
+
#
|
|
8
|
+
# Every element here belongs to the WordprocessingML namespace regardless
|
|
9
|
+
# of its containing parent. Per the global rule "define your own types",
|
|
10
|
+
# Omml owns these wordprocessing stubs so the gem is self-contained;
|
|
11
|
+
# consumers (e.g. Uniword) substitute their own wordprocessing classes
|
|
12
|
+
# via the register substitution mechanism.
|
|
13
|
+
class EGWordRunInnerContent < Base
|
|
14
|
+
choice(min: 1, max: 1) do
|
|
15
|
+
attribute :br, :ct_br
|
|
16
|
+
attribute :del_text, :ct_wordprocessing_text
|
|
17
|
+
attribute :instr_text, :ct_wordprocessing_text
|
|
18
|
+
attribute :del_instr_text, :ct_wordprocessing_text
|
|
19
|
+
attribute :no_break_hyphen, :ct_wordprocessing_empty
|
|
20
|
+
attribute :soft_hyphen, :ct_wordprocessing_empty, collection: 0..1
|
|
21
|
+
attribute :day_short, :ct_wordprocessing_empty, collection: 0..1
|
|
22
|
+
attribute :month_short, :ct_wordprocessing_empty, collection: 0..1
|
|
23
|
+
attribute :year_short, :ct_wordprocessing_empty, collection: 0..1
|
|
24
|
+
attribute :day_long, :ct_wordprocessing_empty, collection: 0..1
|
|
25
|
+
attribute :month_long, :ct_wordprocessing_empty, collection: 0..1
|
|
26
|
+
attribute :year_long, :ct_wordprocessing_empty, collection: 0..1
|
|
27
|
+
attribute :annotation_ref, :ct_wordprocessing_empty, collection: 0..1
|
|
28
|
+
attribute :footnote_ref, :ct_wordprocessing_empty, collection: 0..1
|
|
29
|
+
attribute :endnote_ref, :ct_wordprocessing_empty, collection: 0..1
|
|
30
|
+
attribute :separator, :ct_wordprocessing_empty, collection: 0..1
|
|
31
|
+
attribute :continuation_separator, :ct_wordprocessing_empty,
|
|
32
|
+
collection: 0..1
|
|
33
|
+
attribute :sym, :ct_sym, collection: 0..1
|
|
34
|
+
attribute :pg_num, :ct_wordprocessing_empty, collection: 0..1
|
|
35
|
+
attribute :cr, :ct_wordprocessing_empty, collection: 0..1
|
|
36
|
+
attribute :tab, :ct_wordprocessing_empty, collection: 0..1
|
|
37
|
+
attribute :object, :ct_object
|
|
38
|
+
attribute :pict, :ct_picture
|
|
39
|
+
attribute :fld_char, :ct_fld_char
|
|
40
|
+
attribute :ruby, :ct_ruby
|
|
41
|
+
attribute :footnote_reference, :ct_ftn_edn_ref
|
|
42
|
+
attribute :endnote_reference, :ct_ftn_edn_ref
|
|
43
|
+
attribute :comment_reference, :ct_markup
|
|
44
|
+
attribute :drawing, :ct_drawing
|
|
45
|
+
attribute :ptab, :ct_p_tab, collection: 0..1
|
|
46
|
+
attribute :last_rendered_page_break, :ct_wordprocessing_empty,
|
|
47
|
+
collection: 0..1
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
xml do
|
|
51
|
+
type_name "EG_WordRunInnerContent"
|
|
52
|
+
namespace Omml::WordprocessingNamespace
|
|
53
|
+
|
|
54
|
+
map_element :br, to: :br, render_empty: true
|
|
55
|
+
map_element :delText, to: :del_text, render_empty: true
|
|
56
|
+
map_element :instrText, to: :instr_text, render_empty: true
|
|
57
|
+
map_element :delInstrText, to: :del_instr_text, render_empty: true
|
|
58
|
+
map_element :noBreakHyphen, to: :no_break_hyphen, render_empty: true
|
|
59
|
+
map_element :softHyphen, to: :soft_hyphen
|
|
60
|
+
map_element :dayShort, to: :day_short
|
|
61
|
+
map_element :monthShort, to: :month_short
|
|
62
|
+
map_element :yearShort, to: :year_short
|
|
63
|
+
map_element :dayLong, to: :day_long
|
|
64
|
+
map_element :monthLong, to: :month_long
|
|
65
|
+
map_element :yearLong, to: :year_long
|
|
66
|
+
map_element :annotationRef, to: :annotation_ref
|
|
67
|
+
map_element :footnoteRef, to: :footnote_ref
|
|
68
|
+
map_element :endnoteRef, to: :endnote_ref
|
|
69
|
+
map_element :separator, to: :separator
|
|
70
|
+
map_element :continuationSeparator, to: :continuation_separator
|
|
71
|
+
map_element :sym, to: :sym
|
|
72
|
+
map_element :pgNum, to: :pg_num
|
|
73
|
+
map_element :cr, to: :cr
|
|
74
|
+
map_element :tab, to: :tab
|
|
75
|
+
map_element :object, to: :object, render_empty: true
|
|
76
|
+
map_element :pict, to: :pict, render_empty: true
|
|
77
|
+
map_element :fldChar, to: :fld_char, render_empty: true
|
|
78
|
+
map_element :ruby, to: :ruby, render_empty: true
|
|
79
|
+
map_element :footnoteReference, to: :footnote_reference,
|
|
80
|
+
render_empty: true
|
|
81
|
+
map_element :endnoteReference, to: :endnote_reference,
|
|
82
|
+
render_empty: true
|
|
83
|
+
map_element :commentReference, to: :comment_reference,
|
|
84
|
+
render_empty: true
|
|
85
|
+
map_element :drawing, to: :drawing, render_empty: true
|
|
86
|
+
map_element :ptab, to: :ptab
|
|
87
|
+
map_element :lastRenderedPageBreak, to: :last_rendered_page_break
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Omml
|
|
4
4
|
module Models
|
|
5
|
-
class EGWrapType <
|
|
5
|
+
class EGWrapType < Base
|
|
6
6
|
choice(min: 1, max: 1) do
|
|
7
7
|
attribute :wrap_none, :ct_wrap_none, collection: 1..1
|
|
8
8
|
attribute :wrap_square, :ct_wrap_square, collection: 1..1
|
|
@@ -21,7 +21,5 @@ module Omml
|
|
|
21
21
|
render_empty: true
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
|
-
|
|
25
|
-
Omml::Configuration.register_model(EGWrapType)
|
|
26
24
|
end
|
|
27
25
|
end
|
data/lib/omml/models/groups.rb
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "groups/eg_math_content"
|
|
4
|
-
require_relative "groups/eg_o_math_math_elements"
|
|
5
|
-
require_relative "groups/eg_office_art_extension_list"
|
|
6
|
-
require_relative "groups/eg_r_pr"
|
|
7
|
-
require_relative "groups/eg_r_pr_base"
|
|
8
|
-
require_relative "groups/eg_range_markup_elements"
|
|
9
|
-
require_relative "groups/eg_run_inner_content"
|
|
10
|
-
require_relative "groups/eg_script_style"
|
|
11
|
-
require_relative "groups/eg_word_r_pr"
|
|
12
|
-
require_relative "groups/eg_wrap_type"
|
|
13
|
-
require_relative "groups/eg_r_pr_content"
|
|
14
|
-
require_relative "groups/eg_r_pr_math"
|
|
15
|
-
require_relative "groups/eg_run_level_elts"
|
|
16
|
-
require_relative "groups/eg_content_run_content"
|
|
17
|
-
require_relative "groups/eg_o_math_elements"
|
|
18
|
-
require_relative "groups/eg_p_content"
|
|
19
|
-
require_relative "groups/eg_ruby_content"
|
data/lib/omml/models/o_math.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Omml
|
|
4
4
|
module Models
|
|
5
5
|
# Root element wrapper for the generated CTOMath content model.
|
|
6
|
-
class OMath <
|
|
6
|
+
class OMath < Base
|
|
7
7
|
import_model_attributes :eg_o_math_elements
|
|
8
8
|
|
|
9
9
|
xml do
|
|
@@ -15,7 +15,5 @@ module Omml
|
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
|
-
|
|
19
|
-
Omml::Configuration.register_model(OMath, id: :o_math)
|
|
20
18
|
end
|
|
21
19
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Omml
|
|
4
4
|
module Models
|
|
5
5
|
# Root element wrapper for the generated CTOMathPara content model.
|
|
6
|
-
class OMathPara <
|
|
6
|
+
class OMathPara < Base
|
|
7
7
|
attribute :o_math_para_pr, :ct_o_math_para_pr, collection: 0..1
|
|
8
8
|
attribute :o_math, :ct_o_math, collection: 1..Float::INFINITY
|
|
9
9
|
attribute :r, :ct_r, collection: 0..Float::INFINITY
|
|
@@ -19,7 +19,5 @@ module Omml
|
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
|
-
|
|
23
|
-
Omml::Configuration.register_model(OMathPara, id: :o_math_para)
|
|
24
22
|
end
|
|
25
23
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Omml
|
|
4
|
+
module Models
|
|
5
|
+
# Mixed into simple-type classes that need to know their active register
|
|
6
|
+
# when resolving dependent types (e.g. `STAdjCoordinate` delegates to
|
|
7
|
+
# either `STCoordinate` or `STGeomGuideName` depending on the value).
|
|
8
|
+
#
|
|
9
|
+
# `Omml::Configuration.register_model` calls `register=` on classes that
|
|
10
|
+
# include this module, mirroring the role of upstream's
|
|
11
|
+
# `set_register_context` on `Lutaml::Model::Serializable`.
|
|
12
|
+
module Registerable
|
|
13
|
+
def self.included(base)
|
|
14
|
+
base.extend(ClassMethods)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
module ClassMethods
|
|
18
|
+
attr_accessor :register
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Omml
|
|
4
4
|
module Models
|
|
5
5
|
class STAdjCoordinate < Lutaml::Model::Type::Value
|
|
6
|
+
include Registerable
|
|
7
|
+
|
|
6
8
|
def self.cast(value, options = {})
|
|
7
9
|
return if value.nil?
|
|
8
10
|
|
|
@@ -18,7 +20,6 @@ module Omml
|
|
|
18
20
|
|
|
19
21
|
private_class_method :cast_value
|
|
20
22
|
end
|
|
21
|
-
|
|
22
23
|
Omml::Configuration.register_model(STAdjCoordinate)
|
|
23
24
|
end
|
|
24
25
|
end
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Omml
|
|
4
4
|
module Models
|
|
5
5
|
class STHexColor < Lutaml::Model::Type::Value
|
|
6
|
+
include Registerable
|
|
7
|
+
|
|
6
8
|
def self.cast(value, options = {})
|
|
7
9
|
return if value.nil?
|
|
8
10
|
|
|
@@ -18,7 +20,6 @@ module Omml
|
|
|
18
20
|
|
|
19
21
|
private_class_method :cast_value
|
|
20
22
|
end
|
|
21
|
-
|
|
22
23
|
Omml::Configuration.register_model(STHexColor)
|
|
23
24
|
end
|
|
24
25
|
end
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Omml
|
|
4
4
|
module Models
|
|
5
5
|
class STLang < Lutaml::Model::Type::Value
|
|
6
|
+
include Registerable
|
|
7
|
+
|
|
6
8
|
def self.cast(value, options = {})
|
|
7
9
|
return if value.nil?
|
|
8
10
|
|
|
@@ -18,7 +20,6 @@ module Omml
|
|
|
18
20
|
|
|
19
21
|
private_class_method :cast_value
|
|
20
22
|
end
|
|
21
|
-
|
|
22
23
|
Omml::Configuration.register_model(STLang)
|
|
23
24
|
end
|
|
24
25
|
end
|