[v3,2/2] doc: give full width to NIC overview page

Message ID 20240731155947.1681531-3-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series custom doc styling |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Thomas Monjalon July 31, 2024, 3:57 p.m. UTC
The wide tables in the NIC overview exceed the normal page width
because of the large number of drivers.

A CSS trick is added to allow displaying the tables in the full width
of the browser window.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: no change
v3: let only tables to overflow on wide screen
---
 doc/guides/custom.css        | 13 +++++++++++++
 doc/guides/nics/overview.rst |  2 ++
 2 files changed, 15 insertions(+)
  

Comments

Ferruh Yigit July 31, 2024, 4:17 p.m. UTC | #1
On 7/31/2024 4:57 PM, Thomas Monjalon wrote:
> The wide tables in the NIC overview exceed the normal page width
> because of the large number of drivers.
> 
> A CSS trick is added to allow displaying the tables in the full width
> of the browser window.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v2: no change
> v3: let only tables to overflow on wide screen
>

It is better, thanks. Now page boundaries are kept but table extended to
fit all columns.

You are improving front-end skills :)

Only color of the overview page is not white as it is in other pages,
but slight gray, is this intentional?
  
Thomas Monjalon July 31, 2024, 4:21 p.m. UTC | #2
31/07/2024 18:17, Ferruh Yigit:
> On 7/31/2024 4:57 PM, Thomas Monjalon wrote:
> > The wide tables in the NIC overview exceed the normal page width
> > because of the large number of drivers.
> > 
> > A CSS trick is added to allow displaying the tables in the full width
> > of the browser window.
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> > v2: no change
> > v3: let only tables to overflow on wide screen
> >
> 
> It is better, thanks. Now page boundaries are kept but table extended to
> fit all columns.
> 
> You are improving front-end skills :)

Thanks, that's a fun skill to work on :)

> Only color of the overview page is not white as it is in other pages,
> but slight gray, is this intentional?

It seems all pages are not really white, but #fcfcfc.
I'll apply the same color for the whole background of the tables.
  

Patch

diff --git a/doc/guides/custom.css b/doc/guides/custom.css
index 221024655c..a8ee6bed2c 100644
--- a/doc/guides/custom.css
+++ b/doc/guides/custom.css
@@ -4,6 +4,19 @@ 
 
 /* Override readthedocs theme */
 
+/* Set full width for all responsive tables of a page.
+ * Usage: insert the following line in the doc.
+ *        .. rst-class:: widepage
+ */
+@media screen and (min-width: 1100px) {
+    .wy-nav-content-wrap:has(.widepage) {
+        background: white !important;
+    }
+    .wy-nav-content:has(.widepage) .wy-table-responsive {
+        overflow: visible !important;
+    }
+}
+
 /* Spacing before a list item must be bigger than spacing inside the item.
  * Complex list items start with a p.first element. */
 .section li > .first {
diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
index 67575c699c..4553076481 100644
--- a/doc/guides/nics/overview.rst
+++ b/doc/guides/nics/overview.rst
@@ -24,6 +24,8 @@  Most of these differences are summarized below.
 
 More details about features can be found in :doc:`features`.
 
+.. rst-class:: widepage
+
 .. _table_net_pmd_features:
 
 .. include:: overview_table.txt