Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Quotation border only printed on last page #557

Closed
meisterluk opened this issue Sep 12, 2016 · 8 comments
Closed

Quotation border only printed on last page #557

meisterluk opened this issue Sep 12, 2016 · 8 comments
Assignees

Comments

@meisterluk
Copy link
Contributor

Given:

Hello World
===========

[[someid]]
____
A


B


C


D


E


F


G


H


I


J


K


L


M


N


O


P


Q


R


S


T


U


V


W


X


Y


Z
____


Normal text afterwards.

Expected:
One border lefthandside to the quotation on both pages.

Actual:
First page shows no border. Second page has a border lefthandside to the quotation on both pages.
quote-border

@mojavelinux
Copy link
Member

mojavelinux commented Sep 13, 2016

Framing for quote blocks that span multiple pages is not yet implemented. In fact, the only block type that currently supports this scenario (as of 1.5.0.alpha.13) are listing and literal blocks. The same treatment / logic needs to be applied to all blocks that have framing or background. This is a duplicate of #270.

Here are the issues to track multi-page support for various block types for reference:

@meisterluk
Copy link
Contributor Author

quote & verse is very different from implementing sidebar & example.

First call means lowest z-index. Drawing a background rectangle means it needs to be called before anything else. However, asciidoctor relies on prawnpdf to determine where to put characters or even page breaks. Hence in between setting text across multiple pages, it would be required to draw the rectangles.

Basically prawnpdf's API is too poorly engineered for such use cases. The only workaround I can see is manually interrupting setting text and checking whether page_number has changed. I won't fix it. I want nice solutions, not another workaround.

As far as this issue is concerned, a fix is available. I consider it fixed.

@mojavelinux
Copy link
Member

We don't close issues until the PR is merged, so I'm going to reopen until then.

@mojavelinux mojavelinux reopened this Sep 15, 2016
@mojavelinux
Copy link
Member

I agree the Prawn API is poor at helping with layout, but I created a two-phase writer in the converter for precisely this use case. (I'll admit this API is still rough around the edges, but it gets the job done for now). The first phase performs a dry run that brings back the total height (it should also return the the start page and the end page, so I might add that). From that information, you can perform all the graphics work at the beginning of the second phase, then write the content.

@mojavelinux
Copy link
Member

I'll share that it took me several weeks to come up with a solution for dealing with Prawn's single-pass rendering. That led me to using a scratch document, where I can test content before "burning" it into the main document.

@mojavelinux
Copy link
Member

I've send a revised pull request to your pull request. If that looks good to you, merge it and I'll rebase and push upstream.

@mojavelinux
Copy link
Member

Resolved by 471af37.

@meisterluk
Copy link
Contributor Author

Thanks for improving it!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants