OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[DOCS] Improve data-table directive (#28217)
Andrzej Kopytkoc040b7b2ebbf
diff --git a/docs/articles_en/about-openvino/compatibility-and-support/supported-models.rst b/docs/articles_en/about-openvino/compatibility-and-support/supported-models.rstindex d877cb1768d..f4ec275491f 100644--- a/docs/articles_en/about-openvino/compatibility-and-support/supported-models.rst+++ b/docs/articles_en/about-openvino/compatibility-and-support/supported-models.rst@@ -6,16 +6,14 @@ models from OpenVINO-supported frameworks may also work properly but have not be**AI Models that run on Intel® Core Ultra™ Processors with OpenVINO™ toolkit:**-.. raw:: html-- <link rel="stylesheet" type="text/css" href="../../_static/css/openVinoDataTables.css">---.. csv-table::+.. data-table:::class: modeldata stripe:name: supportedModelsTable:header-rows: 1:file: ../../_static/download/supported_models.csv+ :data-column-hidden: []+ :data-order: [[ 0, "asc" ]]+ :data-page-length: 10| Marked cells indicate models that passed inference with no errors. Empty cells indicatediff --git a/docs/articles_en/about-openvino/compatibility-and-support/supported-operations.rst b/docs/articles_en/about-openvino/compatibility-and-support/supported-operations.rstindex d27f7626391..1bd8f5dae7c 100644--- a/docs/articles_en/about-openvino/compatibility-and-support/supported-operations.rst+++ b/docs/articles_en/about-openvino/compatibility-and-support/supported-operations.rst@@ -41,27 +41,36 @@ Data as of OpenVINO 2024.4, 18 Oct. 2024... tab-item:: PyTorch- .. csv-table::+ .. data-table:::class: modeldata stripe- :name: TensorFlow ops+ :name: TensorFlow_ops_v1:header-rows: 1:file: ../../_static/conformance_files/pytorch_ops.csv+ :data-column-hidden: []+ :data-order: [[ 0, "asc" ]]+ :data-page-length: 10.. tab-item:: TensorFlow- .. csv-table::+ .. data-table:::class: modeldata stripe- :name: TensorFlow ops+ :name: TensorFlow_ops_v2:header-rows: 1:file: ../../_static/conformance_files/tensorflow_ops.csv+ :data-column-hidden: []+ :data-order: [[ 0, "asc" ]]+ :data-page-length: 10.. tab-item:: PaddlePaddle- .. csv-table::+ .. data-table:::class: modeldata stripe- :name: Paddle ops+ :name: Paddle_ops:header-rows: 1:file: ../../_static/conformance_files/paddlepaddle_ops.csv+ :data-column-hidden: []+ :data-order: [[ 0, "asc" ]]+ :data-page-length: 10.. tab-item:: ONNXdiff --git a/docs/articles_en/about-openvino/performance-benchmarks/generative-ai-performance.rst b/docs/articles_en/about-openvino/performance-benchmarks/generative-ai-performance.rstindex 085a1ff8449..83581d465df 100644--- a/docs/articles_en/about-openvino/performance-benchmarks/generative-ai-performance.rst+++ b/docs/articles_en/about-openvino/performance-benchmarks/generative-ai-performance.rst@@ -8,10 +8,6 @@ The current data is as of OpenVINO 2024.4, 20 Nov. 2024.The tables below list the key performance indicators for inference on built-in GPUs.-.. raw:: html-- <label><link rel="stylesheet" type="text/css" href="../../_static/css/openVinoDataTables.css"></label>-.. tab-set::@@ -22,7 +18,9 @@ The tables below list the key performance indicators for inference on built-in G:name: supportedModelsTable_V1:header-rows: 1:file: ../../_static/benchmarks_files/llm_models_9-288V.csv- :hidden: [3,4,6]+ :data-column-hidden: [3,4,6]+ :data-order: [[ 0, "asc" ]]+ :data-page-length: 10.. tab-item:: 7-268V@@ -31,7 +29,8 @@ The tables below list the key performance indicators for inference on built-in G:name: supportedModelsTable_V2:header-rows: 1:file: ../../_static/benchmarks_files/llm_models_7-258V.csv- :hidden: [3,4,6]+ :data-column-hidden: [3,4,6]+ :data-order: [[ 0, "asc" ]].. tab-item:: 7-155H@@ -40,7 +39,8 @@ The tables below list the key performance indicators for inference on built-in G:name: supportedModelsTable_V3:header-rows: 1:file: ../../_static/benchmarks_files/llm_models_7-155H.csv- :hidden: [3,4,6]+ :data-column-hidden: [3,4,6]+ :data-order: [[ 0, "asc" ]].. grid:: 1 1 2 2diff --git a/docs/openvino_sphinx_theme/openvino_sphinx_theme/directives/code.py b/docs/openvino_sphinx_theme/openvino_sphinx_theme/directives/code.pyindex c3e0e81eec3..814517289ce 100644--- a/docs/openvino_sphinx_theme/openvino_sphinx_theme/directives/code.py+++ b/docs/openvino_sphinx_theme/openvino_sphinx_theme/directives/code.py@@ -11,7 +11,7 @@ from sphinx.util import parselinenosimport requestsimport reimport json-+import htmlimport csvlogger = logging.getLogger(__name__)@@ -147,7 +147,9 @@ class DataTable(Directive):'file': directives.path,'class': directives.unchanged,'name': directives.unchanged,- 'hidden': directives.unchanged+ 'data-column-hidden': directives.unchanged,+ 'data-page-length': directives.unchanged,+ 'data-order': directives.unchanged}def run(self) -> List[Node]:@@ -159,10 +161,12 @@ class DataTable(Directive):csv_node = []with open(csv_file, 'r') as j:csv_data = list(csv.reader(j))- class_table_tag = ' class="' + "".join(c for c in str(self.options['class']) + '"') if 'class' in self.options is not None else ""- id_table_tag = ' id="' + "".join(c for c in str(self.options['name']) + '"') if 'name' in self.options is not None else ""- hidden_table_tag = ' data-columns-hidden="' + "".join(c for c in str(self.options['hidden']) + '"') if 'hidden' in self.options is not None else ""- csv_table_html = '<table' + class_table_tag + id_table_tag + hidden_table_tag + '>'+ class_table_tag = f' class="{html.escape(self.options["class"])}"' if "class" in self.options else ""+ id_table_tag = f' id="{html.escape(self.options["name"])}"' if "name" in self.options else ""+ data_column_hidden_tag = f' data-column-hidden="{html.escape(self.options["data-column-hidden"])}"' if "data-column-hidden" in self.options else ""+ data_order_tag = f' data-order="{html.escape(self.options["data-order"])}"' if "data-order" in self.options else ""+ data_page_length_tag = f' data-page-length="{html.escape(self.options["data-page-length"])}"' if "data-page-length" in self.options else ""+ csv_table_html = f'<table{class_table_tag}{id_table_tag}{data_column_hidden_tag}{data_order_tag}{data_page_length_tag}>'head_rows = 0head_rows += self.options.get('header-rows', 0)row_count = 0diff --git a/docs/sphinx_setup/_static/css/custom.css b/docs/sphinx_setup/_static/css/custom.cssindex de8a05732a4..1679f7309da 100644--- a/docs/sphinx_setup/_static/css/custom.css+++ b/docs/sphinx_setup/_static/css/custom.css@@ -69,7 +69,7 @@ a#wap_dns {/* Sphinx-design tabs override */.sd-tab-set>input:checked+label {color: var(--sd-color-black) !important;- background-color: #f8f8f8 !important;+ background-color: white !important;border: solid 1px #bdbdbd;border-bottom: solid 0px;margin-bottom: -1px;@@ -96,7 +96,7 @@ a#wap_dns {cursor: pointer;font-size: var(--sd-fontsize-tabs-label);font-weight: 400 !important;- padding: 5px 16px 2px !important;+ padding: 5px 16px 0px !important;transition: color 250ms;width: auto;z-index: 1;@@ -110,7 +110,6 @@ a#wap_dns {box-shadow: 0 0 0 0;border: solid 1px var(--sd-color-tabs-overline);border-color: #bdbdbd;- background-color: #f8f8f8;padding-right: 4px;padding-left: 4px;padding-bottom: 6px;diff --git a/docs/sphinx_setup/_static/css/openVinoDataTables.css b/docs/sphinx_setup/_static/css/openVinoDataTables.cssindex 526aabb6abe..bedc0f5206e 100644--- a/docs/sphinx_setup/_static/css/openVinoDataTables.css+++ b/docs/sphinx_setup/_static/css/openVinoDataTables.css@@ -6,8 +6,7 @@ div.dt-buttons>.dt-button, div.dt-buttons>div.dt-button-split .dt-button {}div.dt-container .dt-paging .dt-paging-button:hover {- color: white !important;- border: 1px solid #aaa;+ border: 1px solid #aaa !important;background:none !important;background-color: var(--bttn-act-bg-hover) !important}@@ -190,10 +189,9 @@ div.dt-container .dt-paging .dt-paging-button {div.dt-container .dt-paging .dt-paging-button.current, div.dt-container .dt-paging .dt-paging-button.current:hover {background: none !important;- background-color: var(--bttn-act-bg-active) !important;+ background-color: var(--bttn-sec-border-color) !important;border-color: var(--bttn-act-bg-active) !important;border-radius: 0px !important;- color: white !important;border: 1px !important}table.dataTable thead>tr>th.dt-orderable-asc span.dt-column-order:before, table.dataTable thead>tr>th.dt-orderable-asc span.dt-column-order:after, table.dataTable thead>tr>th.dt-orderable-desc span.dt-column-order:before, table.dataTable thead>tr>th.dt-orderable-desc span.dt-column-order:after, table.dataTable thead>tr>th.dt-ordering-asc span.dt-column-order:before, table.dataTable thead>tr>th.dt-ordering-asc span.dt-column-order:after, table.dataTable thead>tr>th.dt-ordering-desc span.dt-column-order:before, table.dataTable thead>tr>th.dt-ordering-desc span.dt-column-order:after, table.dataTable thead>tr>td.dt-orderable-asc span.dt-column-order:before, table.dataTable thead>tr>td.dt-orderable-asc span.dt-column-order:after, table.dataTable thead>tr>td.dt-orderable-desc span.dt-column-order:before, table.dataTable thead>tr>td.dt-orderable-desc span.dt-column-order:after, table.dataTable thead>tr>td.dt-ordering-asc span.dt-column-order:before, table.dataTable thead>tr>td.dt-ordering-asc span.dt-column-order:after, table.dataTable thead>tr>td.dt-ordering-desc span.dt-column-order:before, table.dataTable thead>tr>td.dt-ordering-desc span.dt-column-order:after {diff --git a/docs/sphinx_setup/_static/js/openVinoDataTables.js b/docs/sphinx_setup/_static/js/openVinoDataTables.jsindex bd56a715337..fb3a57d9590 100644--- a/docs/sphinx_setup/_static/js/openVinoDataTables.js+++ b/docs/sphinx_setup/_static/js/openVinoDataTables.js@@ -1,16 +1,15 @@$(document).ready(function () {var columnDefs = [];-var tables = $('table.modeldata');for (let table of tables) {- var hidden = table.getAttribute('data-columns-hidden');+ var hidden = table.getAttribute('data-column-hidden');columnDefs = [{ "visible": false, "targets": JSON.parse(hidden) }]$(table).DataTable({responsive: true,"autoWidth": false,language: {buttons: {- colvisRestore: "Restore default"+ colvisRestore: "Restore default selection"}},lengthMenu: [diff --git a/docs/sphinx_setup/_templates/layout.html b/docs/sphinx_setup/_templates/layout.htmlindex 0d2331b2c83..a791091e1f1 100644--- a/docs/sphinx_setup/_templates/layout.html+++ b/docs/sphinx_setup/_templates/layout.html@@ -9,6 +9,7 @@<link rel="stylesheet" href="{{ pathto('_static/css/viewer.min.css', 1) }}" type="text/css" /><link rel="stylesheet" href="{{ pathto('_static/css/custom.css', 1) }}" type="text/css" /><link rel="stylesheet" href="{{ pathto('_static/css/banner.css', 1) }}" type="text/css" />+<link rel="stylesheet" href="{{ pathto('_static/css/openVinoDataTables.css', 1) }}" type="text/css" /><link href="https://cdn.datatables.net/v/dt/jq-3.7.0/dt-2.0.8/b-3.0.2/b-colvis-3.0.2/b-print-3.0.2/datatables.min.css" rel="stylesheet"><link rel="stylesheet" href="{{ pathto('_static/css/coveo_custom.css', 1) }}" type="text/css" /><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.umd.min.js"></script>