docs: relax CSS context match for pretty tables

We currently only render pretty tables if they have the "top_table"
class set. All of our tables set this, except for the ACL & migration
doc tables, which should have set it, and the API reference which does
not want it.

Simplify life by rendering all tables in a pretty style and remove the
need for the "top_table" class entirely. A small rule turns off the
pretty style for the API reference where tables are a hack used to
render enums with horizontal alignment.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2019-11-11 16:50:01 +00:00
parent a329bd0376
commit eb7388b549
5 changed files with 35 additions and 68 deletions

View File

@ -64,7 +64,7 @@
</p> </p>
<h3><a id="object_connect">virConnectPtr</a></h3> <h3><a id="object_connect">virConnectPtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -80,7 +80,7 @@
</table> </table>
<h3><a id="object_domain">virDomainPtr</a></h3> <h3><a id="object_domain">virDomainPtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -104,7 +104,7 @@
</table> </table>
<h3><a id="object_interface">virInterfacePtr</a></h3> <h3><a id="object_interface">virInterfacePtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -128,7 +128,7 @@
</table> </table>
<h3><a id="object_network">virNetworkPtr</a></h3> <h3><a id="object_network">virNetworkPtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -152,7 +152,7 @@
</table> </table>
<h3><a id="object_node_device">virNodeDevicePtr</a></h3> <h3><a id="object_node_device">virNodeDevicePtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -172,7 +172,7 @@
</table> </table>
<h3><a id="object_nwfilter">virNWFilterPtr</a></h3> <h3><a id="object_nwfilter">virNWFilterPtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -196,7 +196,7 @@
</table> </table>
<h3><a id="object_secret">virSecretPtr</a></h3> <h3><a id="object_secret">virSecretPtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -232,7 +232,7 @@
</table> </table>
<h3><a id="object_storage_pool">virStoragePoolPtr</a></h3> <h3><a id="object_storage_pool">virStoragePoolPtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -256,7 +256,7 @@
</table> </table>
<h3><a id="object_storage_vol">virStorageVolPtr</a></h3> <h3><a id="object_storage_vol">virStorageVolPtr</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Attribute</th> <th>Attribute</th>
@ -317,7 +317,7 @@
</p> </p>
<h3><a id="object_connect_driver">Connection Driver Name</a></h3> <h3><a id="object_connect_driver">Connection Driver Name</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Connection Driver</th> <th>Connection Driver</th>

View File

@ -85,7 +85,7 @@ foreach my $object (sort { $a cmp $b } keys %perms) {
my $olink = lc "object_" . $object; my $olink = lc "object_" . $object;
print <<EOF; print <<EOF;
<h3><a id="$olink">$class</a></h3> <h3><a id="$olink">$class</a></h3>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Permission</th> <th>Permission</th>

View File

@ -161,37 +161,37 @@ p.image {
text-align: center; text-align: center;
} }
.top_table { table {
border-collapse: collapse; border-collapse: collapse;
min-width: 60%; min-width: 60%;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.top_table th { table th {
background: rgb(0, 95, 97); background: rgb(0, 95, 97);
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
padding: 0.5em; padding: 0.5em;
} }
.top_table th a { table th a {
color: inherit; color: inherit;
text-decoration: inherit; text-decoration: inherit;
} }
.top_table td, .top_table th { table td, table th {
border: 1px solid rgb(60, 133, 124); border: 1px solid rgb(60, 133, 124);
} }
.top_table td { table td {
padding: 4px; padding: 4px;
} }
.top_table tr:hover td, .top_table col:hover td { table tr:hover td, table col:hover td {
background: #eeeeee; background: #eeeeee;
} }
.top_table tr td:hover { table tr td:hover {
background: #c5dbd8; background: #c5dbd8;
} }
@ -289,42 +289,12 @@ img.diagram {
margin-right: auto; margin-right: auto;
} }
table.data th, table.data td {
padding: 0.3em;
}
table.data { table tbody td.y {
border-spacing: 0px;
}
table.data thead th {
background: rgb(178,178,178);
text-align: center;
}
table.data {
border: 1px solid black;
border-collapse: collapse;
}
table.data thead tr th {
border: 1px solid black;
}
table.data tr.head th {
border-left: 1px solid black;
border-right: 1px solid black;
}
table.data tbody td {
background: rgb(240,240,240);
}
table.data tbody td.y {
background: rgb(220,255,220); background: rgb(220,255,220);
text-align: center; text-align: center;
} }
table.data tbody td.n { table tbody td.n {
background: rgb(255,220,220); background: rgb(255,220,220);
text-align: center; text-align: center;
} }
@ -377,6 +347,18 @@ table.data tbody td.n {
text-decoration: none; text-decoration: none;
} }
.api table td,.api table th {
border: 0px;
}
.api table tr:hover td, .api table col:hover td {
background: inherit;
}
.api table tr td:hover {
background: inherit;
}
dl.variablelist > dt { dl.variablelist > dt {
display: block; display: block;
float: left; float: left;
@ -392,21 +374,6 @@ dl.variablelist > dt:after {
content: ": "; content: ": ";
} }
table.acl {
margin: 1em;
border-spacing: 0px;
border: 1px solid #ccc;
}
table.acl tr, table.acl td {
padding: 0.3em;
border: 1px solid #ccc;
}
table.acl thead {
background: #ddd;
}
div.description pre.code { div.description pre.code {
border: 1px dashed grey; border: 1px dashed grey;
background-color: inherit; background-color: inherit;

View File

@ -257,7 +257,7 @@
combinations. combinations.
</p> </p>
<table class="data"> <table>
<thead> <thead>
<tr class="head"> <tr class="head">
<th colspan="3">Before migration</th> <th colspan="3">Before migration</th>

View File

@ -43,7 +43,7 @@
<xsl:if test="count(exsl:node-set($acls)/api[@name=$api]/check) > 0"> <xsl:if test="count(exsl:node-set($acls)/api[@name=$api]/check) > 0">
<h5>Access control parameter checks</h5> <h5>Access control parameter checks</h5>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Object</th> <th>Object</th>
@ -56,7 +56,7 @@
</xsl:if> </xsl:if>
<xsl:if test="count(exsl:node-set($acls)/api[@name=$api]/filter) > 0"> <xsl:if test="count(exsl:node-set($acls)/api[@name=$api]/filter) > 0">
<h5>Access control return value filters</h5> <h5>Access control return value filters</h5>
<table class="acl"> <table>
<thead> <thead>
<tr> <tr>
<th>Object</th> <th>Object</th>