-
Notifications
You must be signed in to change notification settings - Fork 69
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
Sort definitions in SCSS files to make them pass validators #485
Sort definitions in SCSS files to make them pass validators #485
Conversation
Fixed font namings, as their names mentioned in the CSS were not matching the fonts' internal name in the *.ttf file. I'm sure this isn't important for eBook readers, but it doesn't hurt either to have it matching now. Added generic font-family to all symbol-only fonts to please CSS validators. That generic font will never be used and, as eBook readers would have to go with some font anyways (in case e.g. the "Font Awesome" is missing in the output document), I decided to use "monospace" here. Fixed missing leading 0s in decimal numbers. Commented-out duplicate margin and font-size definitions in <h4> block. I assume eBook readers parse the document from top to bottom and take the last definition they find, so I disabled the definition at the top and kept the one at the bottom alive. Tested and verified with Calibre and my ancient Kobo GloHD device.
No semantical changes, just changed the sequence of some blocks due to CSS validators complaining about it. Moved <th.halign> and <th.valign> further down Moved <blockquote> and <pre> blocks further up before <div.abstract> Moved <div.footnotes> before <table.table td> Merged the two <dt> blocks into a single one. Tested and verified my changes with Calibre and my ancient Kobo GloHD device. Only 20 errors remaining with this change (and my previous commit).
Further changes in sequence: Moved <dl dd> down just after <dd> Moved ul, ul ul, ..., ol, ol ol, ... further up to the other <ul> definition Moved <figure.image> further up before <.chapter-header p.byline img> Moved <div.verse > pre> before <figure.listing > figcaption + pre> Had to split <th> and <td> from their existing block to move them before <table.table th> and <table.table td> Tested and verified my changes with Calibre and my ancient Kobo GloHD device. Only 12 errors remaining now.
Final commit changing the sequence of blocks to please CSS validators Moved <table.table-grid-all th> and <table.table-grid-all td> up a bit to define it before <table.table thead th> Moved <hr.pagebreak + *> further up before <table.table thead th> Moved <table.table-grid-all thead tr > *:last-child> further down after <table.table-grid-cols tbody tr > td:last-child> Moved <table.table-grid-cols th> and <table.table-grid-cols td> a bit up before <table.table thead th> Validator now says: "0 errors", yay! Tested and verified my changes yet again with Calibre and my ancient Kobo GloHD device.
Hi, my main question here is: what validator you use (and how) and whether we can integrate it into asciidoctor-epub3 testsuite to make sure CSS stays valid in the future. We already use EPUBCheck, but it doesn't report any issues in current CSS. |
Hi, thanks for the info and quick response. I used the validator integrated into Calibre (its "eBook Editor"). From the menu it can run checks on the whole book and came up with a total of 70+ issues. It's interesting that EPUBCheck didn't report anything, although I have to admit that I didn't use that tool in the past. Nevertheless, I just gave it a try, installed it and fired it against a book. My workflow for this test was this:
My first impressions are that this tool does many checks regarding the overall structure and the metadata inside, including the package OPF. So it straight pointed out that in my test workflow here I accidentally compressed the I tried the following:
Worth noting that all 3 cases were detected fine by Calibre's eBook Editor and produced red error messages there. Maybe you can give that a try on your end as well to see if you can reproduce my results? I used EPUBCheck version 4.2.6, but maybe I missed some parameters. My command line is: |
Ah, that's the bit I was missing, thanks. WRT EPUBCheck: asciidoctor-epub3 has builtin support for that. You install |
Talking about automation for testing: |
I came across asciidoctor-epub3 some time ago and use it for my own projects. Back then I already noticed that the CSS files placed into the resulting *.epub file were causing many warnings and errors in validators.
So, after using it for some years now, I finally got the time to fix all the issues. I verified my changes with the hardware I have at hand here (read: Calibre 7.6.0 and my dusty Kobo GloHD with firmware version 3.19.5761 from December 2015). Both readers don't show any differences in the tests I did, but I can't cover all devices out there, of course.
There have been no changes in the semantics, just changes in the order of the individual CSS definitions.
I would kindly ask to review my changes and get them integrated at some point, but I also noticed that the files follow a more visual approach in the order they define the individual styles: from top to bottom. Header and chapter definitions come first in the files, then the stuff which goes into the content area (tables, paragraphs, images, ...) and finally there are definitions for footers. So I would also understand if my changes are not considered an improvement and keeping the current order being favored.