Skip to content

Allow tables to opt out of default Bootstrap styling - #87

Draft
compiler-segfault wants to merge 1 commit into
ProperDocs:masterfrom
compiler-segfault:fix/mkdocs-table-style-opt-out
Draft

compiler-segfault wants to merge 1 commit into
ProperDocs:masterfrom
compiler-segfault:fix/mkdocs-table-style-opt-out

Conversation

@compiler-segfault

Copy link
Copy Markdown

Problem

Fixes #80. The MkDocs theme adds Bootstrap table classes to every table on page load, including author-styled tables in Markdown pages and template overrides.

Change

A table marked no-bootstrap-table is skipped by the existing styling pass. Unmarked Markdown and HTML tables keep the same defaults, and classes the author explicitly set are preserved. The theme guide documents the opt-out.

Validation

Built a minimal site with properdocs build --strict and inspected the generated page after DOMContentLoaded in Chrome and Edge. On master, both browsers added theme classes to all three marked tables. With the patch, all five cases have the expected classes in both browsers:

Table Expected classes after load
Ordinary Markdown table table table-striped table-hover
Marked HTML content table no-bootstrap-table
Marked HTML table with explicit compact Bootstrap styling no-bootstrap-table table table-sm
Unmarked HTML table with a custom class Custom class plus the three theme defaults
Marked table in a footer override Original opt-out and custom classes

Both built-in themes and four fixture sites pass the upstream strict-build integration suite. The theme and build unit tests pass (58 tests). A full local discovery run has four Windows symlink permission errors on both master and the patch.

AI disclosure

Codex prepared the patch and ran the local tests. Submitting as a draft pending account-owner review.

@Andre601

Copy link
Copy Markdown
Contributor

Why not make a fork of the mkdocs theme without the modification?
Why this change?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

properdocs-theme-mkdocs: don’t unconditionally add Bootstrap styles to tables

2 participants