diff options
author | Ralph Amissah <ralph@amissah.com> | 2018-03-02 17:36:21 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 0524cd606d45ecc6ee52dc7c8f1655398c75712c (patch) | |
tree | 9aa65bf1ead450df126251ab53ad06480a373067 /src/sdp/meta/conf_make_meta_json.d | |
parent | conf, make, meta, init and tidy substitution (diff) |
make auto numbering related
Diffstat (limited to 'src/sdp/meta/conf_make_meta_json.d')
-rw-r--r-- | src/sdp/meta/conf_make_meta_json.d | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/src/sdp/meta/conf_make_meta_json.d b/src/sdp/meta/conf_make_meta_json.d index abb9b46..e192c70 100644 --- a/src/sdp/meta/conf_make_meta_json.d +++ b/src/sdp/meta/conf_make_meta_json.d @@ -98,15 +98,46 @@ static template contentJSONtoSiSUstruct() { ) { _struct_composite.make_str.italics = _json.object["make"]["italics"].str; } - if ("num_top" in _json.object["make"] - && (_json.object["make"]["num_top"].type().to!string == "STRING") - ) { - _struct_composite.make_str.num_top = _json.object["make"]["num_top"].str; + if ("auto_num_top_at_level" in _json.object["make"] // str == A - D, 1 - 4 + && (_json.object["make"]["auto_num_top_at_level"].type().to!string == "STRING") + ) { + _struct_composite.make_str.auto_num_top_at_level = _json.object["make"]["auto_num_top_at_level"].str; + switch (_json.object["make"]["auto_num_top_at_level"].str) { + case "A": + break; + case "B": + _struct_composite.make_str.auto_num_top_lv = 1; + break; + case "C": + _struct_composite.make_str.auto_num_top_lv = 2; + break; + case "D": + _struct_composite.make_str.auto_num_top_lv = 3; + break; + case "1": + _struct_composite.make_str.auto_num_top_lv = 4; + break; + case "2": + _struct_composite.make_str.auto_num_top_lv = 5; + break; + case "3": + _struct_composite.make_str.auto_num_top_lv = 6; + break; + case "4": + _struct_composite.make_str.auto_num_top_lv = 7; + break; + default: + break; + } } if ("num_depth" in _json.object["make"] + && (_json.object["make"]["num_depth"].type().to!string == "INTEGER") + ) { + _struct_composite.make_str.num_depth = _json.object["make"]["num_depth"].integer.to!int; + } else if ("num_depth" in _json.object["make"] && (_json.object["make"]["num_depth"].type().to!string == "STRING") ) { - _struct_composite.make_str.num_depth = _json.object["num_depth"][""].str; + _struct_composite.make_str.num_depth = _json.object["make"]["num_depth"].str.to!int; } if ("substitute" in _json.object["make"]) { string[][] _sub; @@ -147,7 +178,8 @@ static template contentJSONtoSiSUstruct() { _struct_composite.make.home_button_image = _mk.home_button_image(_struct_composite.make_str.home_button_image); _struct_composite.make.home_button_text = _mk.home_button_text(_struct_composite.make_str.home_button_text); _struct_composite.make.italics = _mk.italics(_struct_composite.make_str.italics); - _struct_composite.make.num_top = _mk.num_top(_struct_composite.make_str.num_top); + _struct_composite.make.auto_num_top_at_level = _mk.auto_num_top_at_level(_struct_composite.make_str.auto_num_top_at_level); + _struct_composite.make.auto_num_top_lv = _mk.auto_num_top_lv(_struct_composite.make_str.auto_num_top_lv); _struct_composite.make.num_depth = _mk.num_depth(_struct_composite.make_str.num_depth); _struct_composite.make.substitute = _mk.substitute(_struct_composite.make_str.substitute); _struct_composite.make.texpdf_font = _mk.texpdf_font(_struct_composite.make_str.texpdf_font); |