@@ -147,6 +147,7 @@ class NormativeRuleDef
147147 attr_reader :def_filename # String (mandatory)
148148 attr_reader :chapter_name # String (mandatory)
149149 attr_reader :summary # String (optional - a few words)
150+ attr_reader :note # String (optional - as long as needed)
150151 attr_reader :description # String (optional - sentence, paragraph, or more)
151152 attr_reader :kind # String (optional, can be nil)
152153 attr_reader :instances # Array<String> (optional - can be empty)
@@ -167,6 +168,11 @@ def initialize(name, def_filename, chapter_name, data)
167168 fatal ( "Provided #{ @summary . class } class for summary in normative rule #{ name } but need a String" ) unless @summary . is_a? ( String )
168169 end
169170
171+ @note = data [ "note" ]
172+ unless @note . nil?
173+ fatal ( "Provided #{ @note . class } class for note in normative rule #{ name } but need a String" ) unless @note . is_a? ( String )
174+ end
175+
170176 @description = data [ "description" ]
171177 unless @description . nil?
172178 fatal ( "Provided #{ @description . class } class for description in normative rule #{ name } but need a String" ) unless @description . is_a? ( String )
@@ -428,6 +434,7 @@ def create_normative_rules_hash(defs, tags, tag_fname2url)
428434 hash [ "kind" ] = d . kind unless d . kind . nil?
429435 hash [ "instances" ] = d . instances unless d . instances . empty?
430436 hash [ "summary" ] = d . summary unless d . summary . nil?
437+ hash [ "note" ] = d . note unless d . note . nil?
431438 hash [ "description" ] = d . description unless d . description . nil?
432439
433440 unless d . tag_refs . nil?
@@ -720,6 +727,11 @@ def output_xlsx(filename, defs, tags)
720727 rule_def_sources . append ( "Rule Summary" )
721728 end
722729
730+ unless d . note . nil?
731+ rule_defs . append ( d . note . chomp )
732+ rule_def_sources . append ( "Rule Note" )
733+ end
734+
723735 unless d . description . nil?
724736 rule_defs . append ( d . description . chomp )
725737 rule_def_sources . append ( "Rule Description" )
@@ -784,13 +796,19 @@ def output_adoc(filename, defs, tags, tag_fname2url)
784796 f . puts ( "| Rule Name | Rule Description | Origin of Description" )
785797
786798 nr_defs . each do |nr |
787- info_rows = ( nr . summary . nil? ? 0 : 1 ) + ( nr . description . nil? ? 0 : 1 ) +
788- ( nr . kind . nil? ? 0 : 1 ) + ( nr . instances . empty? ? 0 : 1 ) + nr . tag_refs . length
799+ info_rows =
800+ ( nr . summary . nil? ? 0 : 1 ) +
801+ ( nr . note . nil? ? 0 : 1 ) +
802+ ( nr . description . nil? ? 0 : 1 ) +
803+ ( nr . kind . nil? ? 0 : 1 ) +
804+ ( nr . instances . empty? ? 0 : 1 ) +
805+ nr . tag_refs . length
789806 row_span = ( info_rows > 0 ) ? ".#{ info_rows } +" : ""
790807
791808 f . puts ( "" )
792809 f . puts ( "#{ row_span } | #{ nr . name } " )
793810 f . puts ( "| #{ nr . summary } | Rule's 'summary' property" ) unless nr . summary . nil?
811+ f . puts ( "| #{ nr . note } | Rule's 'note' property" ) unless nr . note . nil?
794812 f . puts ( "| #{ nr . description } | Rule's 'description' property" ) unless nr . description . nil?
795813 f . puts ( "| #{ nr . kind } | Rule's 'kind' property" ) unless nr . kind . nil?
796814 f . puts ( '| [' + nr . instances . join ( ', ' ) + '] | Rule Instances' ) unless nr . instances . empty?
@@ -1001,8 +1019,13 @@ def html_chapter_table(f, table_num, chapter_name, nr_defs, tags, tag_fname2url)
10011019 f . puts ( %Q{ <tbody>} )
10021020
10031021 nr_defs . each do |nr |
1004- name_row_span = ( nr . summary . nil? ? 0 : 1 ) + ( nr . description . nil? ? 0 : 1 ) +
1005- ( nr . kind . nil? ? 0 : 1 ) + ( nr . instances . empty? ? 0 : 1 ) + nr . tag_refs . length
1022+ name_row_span =
1023+ ( nr . summary . nil? ? 0 : 1 ) +
1024+ ( nr . note . nil? ? 0 : 1 ) +
1025+ ( nr . description . nil? ? 0 : 1 ) +
1026+ ( nr . kind . nil? ? 0 : 1 ) +
1027+ ( nr . instances . empty? ? 0 : 1 ) +
1028+ nr . tag_refs . length
10061029
10071030 row_started = true
10081031 f . puts ( %Q{ <tr>} )
@@ -1016,6 +1039,14 @@ def html_chapter_table(f, table_num, chapter_name, nr_defs, tags, tag_fname2url)
10161039 row_started = false
10171040 end
10181041
1042+ unless nr . note . nil?
1043+ f . puts ( %Q{ <tr>} ) unless row_started
1044+ f . puts ( %Q{ <td>#{ nr . note } </td>} )
1045+ f . puts ( %Q{ <td>Rule's "note" property</td>} )
1046+ f . puts ( %Q{ </tr>} )
1047+ row_started = false
1048+ end
1049+
10191050 unless nr . description . nil?
10201051 f . puts ( %Q{ <tr>} ) unless row_started
10211052 f . puts ( %Q{ <td>#{ convert_newlines_to_html ( nr . description ) } </td>} )
0 commit comments