-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tables overflow in HTML #69
Comments
I suppressed the See also: |
Implemented potential fix at 4b71ccf. Perhaps introducing a plugin is overkill, the JavaScript at https://github.com/ideamean/gitbook-plugin-auto-scroll-table (implementation may slightly vary between github and npm, could not find original user) is pretty straightforward and follows an approach similar to https://www.w3schools.com/howto/howto_css_table_responsive.asp (wrapping each PS: Temporal preview at http://robots.uc3m.es/j/teo-developer-manual/_book/tutorial/trajectories.html PPS: Just for the historic:
|
Sorry, I noticed the JS is not applied when browsing pages. It does work if you open (or refresh) the one that contains overflowing tables, but for some reason it is not triggered on page change (despite the event binding). |
Good catch! I did notice that effect, but thought I had to refresh due to some browser cache. You are totally right. |
Okay, it turns out that the downloaded code (possibly (function() {
[].slice.call(document.querySelectorAll('table')).forEach(function(el){
var wrapper = document.createElement('div');
wrapper.className = 'table-area';
el.parentNode.insertBefore(wrapper, el);
el.parentNode.removeChild(el);
wrapper.appendChild(el);
});
})(); I replaced this locally by the code at https://github.com/ideamean/gitbook-plugin-auto-scroll-table and it works without need of refreshing the page. This makes sense because it is wrapped within |
Options:
|
Okay, Ill check what's possible. By the way, I hadn't translated the Chinese text at https://github.com/ideamean/gitbook-plugin-auto-scroll-table ...turns out it says |
PS: https://github.com/GitbookIO/plugin-scripts seems like a reasonable approach |
- <#69> - Thank you <https://github.com/ideamean/gitbook-plugin-auto-scroll-table/blob/cae3506409e5a6813a3dc2b36cca097bebd6e114/book/> - Also see original <https://www.npmjs.com/package/gitbook-plugin-auto-scroll-table> by <https://www.npmjs.com/~luchuan.neo> - The approach is also recommended at <https://www.w3schools.com/howto/howto_css_table_responsive.asp>
Okay, b3d2d6d sums it all up, with credits as clear as possible. Branch https://github.com/roboticslab-uc3m/teo-developer-manual/tree/scroll-table-69 taken from 2 commits before current |
Thanks! I think we can just commit-merge it, letting those two intermediate patches stay since they seemed to address the problem at least partly. Besides: the combined CSS could be split into page-TOC-related and scroll-table-related (but is it worth?), and I assume there are no other GitBook repos in which we need to replicate this hack (in which case see the alternative Docker solution, not yet tested). |
I think this is not possible. A |
Merged at a5a17e3, but sadly our GitBook/GH Pages workflow fails with My first guess is that the Docker image should create and expose a non-root user, but that doesn't solve the permission issue, which also interweaves with ownership considerations. This problem can be replicated locally if running rootless Docker since GitBook files generated in that way have root ownership and hence a 700 dir cannot be accessed by the host. Despite not using |
I'm trying to improve our Docker image so that container processes are run as non-root user, per best practices (ref). Sadly, I think I'll give up. On a rootless Docker installation, it seems impossible for the container user to take ownership of the mounted volume, which consequently prevents any writes on said directory. Basically, I'm hitting moby/moby#3124, but the explanation given at moby/moby#3124 (comment) seems wrong as of today (see further comments). A few links:
There might be another way: instruct the container to run as a specific user via |
Finally fixed thanks to a workaround: ea1a61c. To sum up, we are just fixing the public permissions on _book/gitbook/gitbook-plugin-scripts (needs
What was considered but didn't work:
Mory hackish ways involve symlinking: https://stackoverflow.com/questions/30897205/create-a-gitbook-plugin-locally-without-publishing-it (found by @jgvictores). |
Small (useless for now) discovery: If you install it locally (in the specific repo directory), e.g.
|
Markdown tables overflow in rendered HTML, but there is no way to scroll horizontally. I can see an
overflow: hidden
rule in the main<section>
element, I think this disables anyoverflow-x
in its children.This shouldn't happen. Relevant tables are currently being cut.
The text was updated successfully, but these errors were encountered: