Correct man page formatting in RST output
[ric-plt/lib/rmr.git] / doc / src / rtd / fmt_changes.ksh
index 3a1498c..930bce4 100644 (file)
 #   limitations under the License.
 #==================================================================================
 
-# format the changes file at the top level into xfm input
+#      Mnemonic:       fmt_changes.ksh
+#      Abstract:       This script looks for CHANGES*.txt files at the top level
+#                              and builds one {X}fm source file from which the release notes
+#                              RTD file is created.
+
 cat <<endKat
+
+.** ------------------------------------------------------------------------
+.** CAUTION: This .xfm file is automatically generated by fmt_changes.ksh
+.**          do NOT edit. Use 'make rel-notes.xfm' to regenerate.
+.** ------------------------------------------------------------------------
+
+.dv GEN_TITLE 1
+.dv doc_title RMR Release Notes
 .im setup.im
+.dh 1 u=off
+
 &h1(RMR Release Notes)
-The following is a list of release highlights for the core RMR library.
-These are extracted directly from the CHANGES file at the repo root; 
-please refer to that file for a completely up to date listing of
-API changes.  
-&space
+The following is a list of release highlights for the RMR library.
+At one point in time the RMR repo also housed a wrapper library with a
+separate version and release cycle.
+This resulted in &ital(leap frogging) versions for each package; the
+RMR core library was assigned odd major numbers (e.g. 3.1.0).
+When the wrapper code was moved to a different repo the need to leap frog
+versions ceased, and beginning with version 4.0.0, the RMR versions should
+no longer skip.
 
 endKat
 
-sed 's/^/!/' ../../../CH*|awk ' 
+for x in ../../../CHANGES*.txt
+do
+       awk '
+               /^#/ { next }           # ditch all comments
 
-       print_raw && /^!$/ { 
-               printf( "&space\n\n" ); 
-               next 
-       } 
+               # tag project releases by matching release tag associated
+               /4\.0\.5$/  { printf( "&h1(Bronze Release)\n" ); rheader = 1 }
+               /1\.11\.1$/ { printf( "&h1(Amber Release)\n" ); rheader = 1 }
 
-       { gsub ( "!", "", $1 ) }
+               print_raw && /^$/ {                             # include blank lines after first real stuff
+                       printf( "&space\n\n" );
+                       next
+               }
 
-       $1 + 0 >= 2019 {
-               print_raw = 1
-               printf( "&h2(%s)\n", $0 )
-               next 
-       }
+               $1 + 0 >= 2019 {
+                       print_raw = 1                           # safe to print blank lines
+                       printf( "&h2(%s)\n", $0 )
+                       next
+               }
 
-       print_raw { print } 
-       '
+               print_raw { print }
+       ' $x
+done