Report: Suite doc format
[csit.git] / resources / tools / presentation / generator_files.py
index 9ef6c0a..a828c4b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Cisco and/or its affiliates.
+# Copyright (c) 2021 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -34,7 +34,7 @@ RST_INCLUDE_TABLE = (u"\n.. only:: html\n\n"
                      u"\n  .. raw:: latex\n\n"
                      u"      \\csvautolongtable{{{file_latex}}}\n\n")
 
-REGEX_NIC_SHORT = re.compile(r'(\d*ge\dp\d)(\D*\d*[a-z]*)-')
+REGEX_NIC_SHORT = re.compile(r'(\d*ge\dp\d)([a-z]*\d*[a-z]*)-')
 
 
 def generate_files(spec, data):
@@ -197,16 +197,13 @@ def file_details_split(file_spec, input_data, frmt=u"rst"):
                 if chapters[chapter_l1][chapter_l2].get(nic, None) is None:
                     chapters[chapter_l1][chapter_l2][nic] = dict(
                         rst_file=f"{join(table_set, chapter_l1)}_{nic}.rst".
-                        replace(u"2n1l-", u""),
+                        replace(u"2n1l-", u"").replace(u"1n1l-", u""),
                         tables=list()
                     )
                 for idx, tbl_file in enumerate(table_lst):
                     if suite[u"name"] in tbl_file:
                         chapters[chapter_l1][chapter_l2][nic][u"tables"].append(
-                            (
-                                table_lst.pop(idx),
-                                suite[u"doc"].replace(u'|br|', u'\n\n -')
-                            )
+                            (table_lst.pop(idx), suite[u"doc"])
                         )
                         break
     titles = {