diff --git a/_extensions/quarto-openapi/lib/markdown.ts b/_extensions/quarto-openapi/lib/markdown.ts index c88fa50..8b34df5 100644 --- a/_extensions/quarto-openapi/lib/markdown.ts +++ b/_extensions/quarto-openapi/lib/markdown.ts @@ -55,6 +55,7 @@ export function gridTable(headers: string[], rows: TableRow[]): string[] { } }; + lines.push("::: {.quarto-openapi-table}"); lines.push(separator("-")); emitRow(headerLines); lines.push(separator("=")); @@ -64,6 +65,8 @@ export function gridTable(headers: string[], rows: TableRow[]): string[] { lines.push(separator("-")); } + lines.push(":::"); + return lines; } diff --git a/_extensions/quarto-openapi/quarto-openapi-styles.css b/_extensions/quarto-openapi/quarto-openapi-styles.css index 270515d..a77bc0c 100644 --- a/_extensions/quarto-openapi/quarto-openapi-styles.css +++ b/_extensions/quarto-openapi/quarto-openapi-styles.css @@ -1,3 +1,15 @@ +/* Prevent schema tables from overflowing into the sidebar */ +.quarto-openapi-table table { + table-layout: fixed; + width: 100%; +} + +.quarto-openapi-table td, +.quarto-openapi-table th { + overflow-wrap: break-word; + word-break: break-word; +} + /* Nesting indentation for schema property tables */ .schema-nest-1 { padding-left: 1em; } .schema-nest-2 { padding-left: 2em; }