Website: Update tables in HTML compiled from Markdown (#6929)

* add custom table renderer to to-html

* remove table-layout from docs stylesheet

* Update to-html.js

* update comment

* lint fix

* rename variables
This commit is contained in:
Eric 2022-08-03 10:38:05 -05:00 committed by GitHub
parent 9bf0266bad
commit 14e1b36362
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -112,6 +112,11 @@ module.exports = {
return `<blockquote><img src="/images/icon-info-16x16@2x.png" alt="An icon indicating that this section has important information"><div class="d-block">`+quote+`</div></blockquote>\n`;
};
// Creating a custom table renderer to add Bootstrap's responsive table styles to markdown tables.
customRenderer.table = function(headerHtml, bodyHtml) {
return `<div class="table-responsive-xl"><table class="table">\n<thead>\n${headerHtml}\n</thead>\n<tbody>${bodyHtml}\n</tbody>\n</table>\n</div>`;
};
markedOpts.renderer = customRenderer;
// Now actually compile the markdown to HTML.
marked(inputs.mdString, markedOpts, function afterwards (err, htmlString) {

View File

@ -494,7 +494,6 @@
table {
border: 1px solid @border-lt-gray;
table-layout: fixed;
width: 100%;
border-collapse: collapse;
font-size: 16px;
@ -516,9 +515,6 @@
padding: 8px 7px 7px 8px;
}
}
h4 + table { // For parameter tables
table-layout: auto;
}
.note {
background-color: @core-vibrant-blue-10;
border-radius: 12px;