-
Notifications
You must be signed in to change notification settings - Fork 21
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
Potential issue with landscape feature and AHFormatter #565
Comments
For documents that don't use landscape (or maybe that only use one orientation) it might be possible to avoid loading that CSS. I suppose it might be possible also to only load the particular combinations that are used by the document, but that seems potentially much more difficult. I'll have to see if I can reproduce the problem and confirm that those CSS changes are the problem. That might be a bug worth reporting to AntennaHouse as well. If someone with more CSS skill than I can propose a simpler solution, I'd be delighted. When I investigated the problem, I concluded that the only way to make it work was to generate the full combinatorial matrix of possibilities. One more reason to consider biting the bullet and implementing XSL FO stylesheets, I guess. I wonder if @tgraham-antenna might have any insights. |
You might instead do You might also try things like It's not clear to me why |
I have given this a lot of thought over the last couple of weeks. I believe that CSS can be made much easier by reorganizing it slightly and by separating "article" and "book" styles. The real culprit is that named page templates are not hierarchical—at least, not according to the CSS specs. (A non-named page template always takes precedence. A named page template can only override the default page template.) Let me try to outline my proposal:
.draft.left, .draft {
--draft-background-image: url('draft-left.svg');
--draft-background-position: 0.5cm 0.5cm;
}
I understand that these kinds of changes can be a bit delicate. However, I believe that separating styling and simplifying page templates would significantly improve customizability. As it stands, the styles are difficult to understand and challenging to customize. I have a working branch locally that I am happy to share. I would need some help ironing out the details and testing PDF output with different formatters (I have only tested with AH so far). |
Earlier in October this year, the "landscape" feature was added to DocbookNG, which is highly appreciated. However, I’ve observed that it has the side effect of making rendering smaller documents take considerably longer with AHFormatter. For example, I have a simple test case where the resulting PDF document has 3 pages. Using
docbook-paged.css
from the 2.2.1 release, the document is generated in under 0.2 seconds, whereas the current release takes over 1 minute.I realise that
vendor-ahf-landscape.scss
andvendor-ahf-portrait.scss
add almost 1MB to the resulting CSS file. I’m curious to understand more about the background of this change. Perhaps there’s a way to simplify the CSS for AHF or explore other optimisations?The text was updated successfully, but these errors were encountered: