mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
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:
parent
9bf0266bad
commit
14e1b36362
5
website/api/helpers/strings/to-html.js
vendored
5
website/api/helpers/strings/to-html.js
vendored
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user