From: Thomas Monjalon Date: Thu, 4 May 2017 21:56:29 +0000 (+0200) Subject: doc: factorize overview table CSS X-Git-Tag: spdx-start~3243 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8a441eb99462ea1ba2876b4a0a985e079f3263c5;p=dpdk.git doc: factorize overview table CSS There were several tables in NIC and crypto guides with the same copy-pasted CSS addition. It is moved into one unique place: conf.py. Signed-off-by: Thomas Monjalon Acked-by: John McNamara --- diff --git a/doc/guides/conf.py b/doc/guides/conf.py index ef0e1c607a..c3cd0bd690 100644 --- a/doc/guides/conf.py +++ b/doc/guides/conf.py @@ -178,7 +178,7 @@ def process_numref(app, doctree, from_docname): node.replace_self(newnode) -def generate_overview_table(output_filename, section, table_name, title): +def generate_overview_table(output_filename, table_id, section, table_name, title): """ Function to generate the Overview Table from the ini files that define the features for each driver. @@ -258,9 +258,8 @@ def generate_overview_table(output_filename, section, table_name, title): outfile = open(output_filename, 'w') num_cols = len(header_names) - print('.. table:: ' + table_name + '\n', - file=outfile) - + print_table_css(outfile, table_id) + print('.. table:: ' + table_name + '\n', file=outfile) print_table_header(outfile, num_cols, header_names, title) print_table_body(outfile, num_cols, ini_files, ini_data, default_features) @@ -316,29 +315,87 @@ def print_table_divider(outfile, num_cols): print_table_row(outfile, feature, line) +def print_table_css(outfile, table_id): + template = """ +.. raw:: html + + +""" + print(template.replace("idx", "id%d" % (table_id)), file=outfile) + + def setup(app): table_file = dirname(__file__) + '/nics/overview_table.txt' - generate_overview_table(table_file, + generate_overview_table(table_file, 1, 'Features', 'Features availability in networking drivers', 'Feature') table_file = dirname(__file__) + '/cryptodevs/overview_feature_table.txt' - generate_overview_table(table_file, + generate_overview_table(table_file, 1, 'Features', 'Features availability in crypto drivers', 'Feature') table_file = dirname(__file__) + '/cryptodevs/overview_cipher_table.txt' - generate_overview_table(table_file, + generate_overview_table(table_file, 2, 'Cipher', 'Cipher algorithms in crypto drivers', 'Cipher algorithm') table_file = dirname(__file__) + '/cryptodevs/overview_auth_table.txt' - generate_overview_table(table_file, + generate_overview_table(table_file, 3, 'Auth', 'Authentication algorithms in crypto drivers', 'Authentication algorithm') table_file = dirname(__file__) + '/cryptodevs/overview_aead_table.txt' - generate_overview_table(table_file, + generate_overview_table(table_file, 4, 'AEAD', 'AEAD algorithms in crypto drivers', 'AEAD algorithm') diff --git a/doc/guides/cryptodevs/overview.rst b/doc/guides/cryptodevs/overview.rst index 656cf18c9b..6764d0d93d 100644 --- a/doc/guides/cryptodevs/overview.rst +++ b/doc/guides/cryptodevs/overview.rst @@ -35,59 +35,6 @@ Supported Feature Flags .. _table_crypto_pmd_features: -.. raw:: html - - - .. include:: overview_feature_table.txt Supported Cipher Algorithms @@ -95,59 +42,6 @@ Supported Cipher Algorithms .. _table_crypto_pmd_cipher_algos: -.. raw:: html - - - .. include:: overview_cipher_table.txt Supported Authentication Algorithms @@ -155,59 +49,6 @@ Supported Authentication Algorithms .. _table_crypto_pmd_auth_algos: -.. raw:: html - - - .. include:: overview_auth_table.txt Supported AEAD Algorithms @@ -215,57 +56,4 @@ Supported AEAD Algorithms .. _table_crypto_pmd_aead_algos: -.. raw:: html - - - .. include:: overview_aead_table.txt diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst index afb65038b0..757a3c9016 100644 --- a/doc/guides/nics/overview.rst +++ b/doc/guides/nics/overview.rst @@ -50,59 +50,6 @@ Most of these differences are summarized below. .. _table_net_pmd_features: -.. raw:: html - - - .. include:: overview_table.txt .. Note::