diff --git a/tests/norm-rule/expected/test-norm-rules.json b/tests/norm-rule/expected/test-norm-rules.json index ee337cd..0418e1e 100644 --- a/tests/norm-rule/expected/test-norm-rules.json +++ b/tests/norm-rule/expected/test-norm-rules.json @@ -19,7 +19,7 @@ ] }, { - "name": "paragraph", + "name": "paragraph-with-a-really-wide-rule-name", "def_filename": "tests/norm-rule/test.yaml", "chapter_name": "my-chapter_name", "description": "Here's a description.\nIt's got 2 lines.\n", @@ -39,7 +39,7 @@ "instances": [ "MY_PARAMETER" ], - "description": "Here's a one line description.", + "description": "Here's a one line description but it is very wide so should wrap within a cell.", "tags": [ { "name": "norm:note-1", diff --git a/tests/norm-rule/expected/test-norm-rules.xlsx b/tests/norm-rule/expected/test-norm-rules.xlsx index ea375f3..a9b62f2 100644 Binary files a/tests/norm-rule/expected/test-norm-rules.xlsx and b/tests/norm-rule/expected/test-norm-rules.xlsx differ diff --git a/tests/norm-rule/test.yaml b/tests/norm-rule/test.yaml index 4b5c8fc..7840137 100644 --- a/tests/norm-rule/test.yaml +++ b/tests/norm-rule/test.yaml @@ -12,13 +12,13 @@ normative_rule_definitions: kind: extension instances: [Zicsr, ABC] tags: ["norm:inline"] - - name: paragraph + - name: paragraph-with-a-really-wide-rule-name description: | Here's a description. It's got 2 lines. tags: ["norm:para"] - name: note_with_2_tags - description: Here's a one line description. + description: Here's a one line description but it is very wide so should wrap within a cell. kind: parameter instances: [MY_PARAMETER] tags: ["norm:note-1", "norm:note-3"] diff --git a/tools/create_normative_rules.rb b/tools/create_normative_rules.rb index 56840bd..8652eba 100644 --- a/tools/create_normative_rules.rb +++ b/tools/create_normative_rules.rb @@ -597,7 +597,7 @@ def output_xlsx(filename, defs, tags) right_arrow = "\u2192" defs.norm_rule_defs.each do |d| worksheet.write(row_num, 0, d.chapter_name) - worksheet.write(row_num, 1, d.name) + worksheet.write(row_num, 1, d.name, wrap_format) worksheet.write(row_num, 2, d.summary) unless d.summary.nil? worksheet.write(row_num, 3, d.description.chomp, wrap_format) unless d.description.nil? worksheet.write(row_num, 4, d.kind) unless d.kind.nil? @@ -626,6 +626,10 @@ def output_xlsx(filename, defs, tags) # Set column widths to hold data width. worksheet.autofit + # Override autofit for really wide columns + worksheet.set_column(1, 1, 20) # name column + worksheet.set_column(3, 3, 30) # description column + workbook.close end