New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readthedocs - table formatting under 1.1 #2028
Comments
What is the behavior of the upstream Sphinx theme? If the new behavior match upstream, then this is an intentional change. The MkDocs theme should not include anything which is not supported upstream. However, if this is a regression from the upstream Sphinx theme we may need to add some additional rules to |
The sphinx theme stable demo shows the tables to have the clean formatting (as desired): https://sphinx-rtd-theme.readthedocs.io/en/stable/demo/lists_tables.html#option-lists |
Thanks for the link. Sure enough we have a problem with table formatting. The way this works is that we provide the upstream CSS in theme.css. That file comes directly from upstream without modification. We then have a few fixes specific to MkDocs in theme_extra.css. However, the few rules in Presumably, a fix for this would be to copy all relevant rules from |
As an aside, the inconsistency in the code spans depicted in the screenshots above was addressed in #2029. This would be a similar type of fix. |
I don't think this is an issue with the CSS changing. The upstream table CSS has required the Was the removal of $('table').addClass('docutils'); |
I fixed this for my own site by adding the following: extra_javascript:
- js/extra.js // js/extra.js
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll("table").forEach(function(table) {
table.classList.add("docutils");
});
}); |
Technically it wasn't removed. rather it was replaced with the upstream JavaScript. However, looking at it now, it appears that the previous version included both some of the upstream code and some hacks to make it work with MkDocs. Perhaps we need to bring parts of the old hacks back. If course, that should happen in a separate file. The upstream file should remain unmodified from upstream. |
@rockandska As already mentioned, see #2029. |
- Upgraded to latest mkdocs - Updated rule documentation with more configuration examples - Replaced triple backticks with single backticks for inline fixed text - Replaced bash with sh for shell blocks - Removed trailing hashes in markdown titles - Workaround for mkdocs table formatting issue, see mkdocs/mkdocs#2028) - Documented docker slowness issue (closes #129)
I made a documentation change and noticed that the result when browsed locally did not quite match what is seen when browsing from the web. After some research, I found mkdocs/mkdocs#2028 That described my situation well and suggested adding an extra javascript script to the configuration. This worked exactly as desired on my local machine. This accounts for the presence of extrajs.js and mkdocs.yml in this request. In addition to the display problem, "mkdocs build" generates the documentation into a directory which is not ignored by git. I added that directory to .gitignore as part of this request. Finally, since I don't know how exactly the documentation makes it to production, I made an insignificant change to one doc file as a sanity check.
Rather than including this is the JS form the upstream theme, the JS has been included in a separate file `theme_extra.js` so that is is not lost in a future update copied form upstream. Fixes mkdocs#2028.
Rather than including this is the JS form the upstream theme, the JS has been included in a separate file `theme_extra.js` so that is is not lost in a future update copied form upstream. Fixes #2028.
The formatting under 1.1 has changed quite dramatically for the
readthedocs
option. Is this intentional?Table from 1.0.4:
Table from 1.1:
My
mkdocs.yml
(variables expanded in bash script):The text was updated successfully, but these errors were encountered: