Skip to content

Commit 1db0baf

Browse files
committed
Add support for markdown tables
1 parent fedc63d commit 1db0baf

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

app/src/app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ const toc = document.getElementsByClassName('toc')[0]
6565
const tocDropdown = document.getElementsByClassName('toc-dropdown')[0]
6666
tocDropdown.appendChild(toc.cloneNode(true))
6767

68+
// add table classes
69+
const tables = document.getElementsByTagName('table')
70+
for (let table of tables) {
71+
table.classList.add('table')
72+
table.classList.add('table-bordered')
73+
table.classList.add('table-fixed')
74+
75+
const thead = document.getElementsByTagName('thead')[0]
76+
thead.classList.add('thead-dark')
77+
}
78+
6879
document.querySelectorAll('[data-component="title"]').forEach(el => {
6980
createRoot(el).render(
7081
<Provider store={store}>

assets/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ caption {
157157
caption-side: top;
158158
padding-top: 0;
159159
}
160+
.caption {
161+
margin-bottom: 0.75rem;
162+
color: #6c757d;
163+
font-size: small;
164+
}
160165
pre {
161166
color: white;
162167
background-color: #343a40;
@@ -230,6 +235,7 @@ code {
230235
.show-component p:last-child,
231236
.show-component ul:last-child,
232237
.show-component pre:last-child,
238+
.show-component table:last-child,
233239
.show-component [data-component="table"]:last-child table,
234240
.pattern-component pre:last-child {
235241
margin-bottom: 0;

build/protocol.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def main():
7070
html = markdown(md, extensions=[
7171
'fenced_code',
7272
'attr_list',
73+
'tables',
7374
TocExtension(toc_depth='2-3', title='Table of Contents'),
7475
CustomBlocksExtension(generators={
7576
'config': config_generator,

0 commit comments

Comments
 (0)