Forum Feature requests

Debug Controls

It would be great if there was a mechanism (CSS rule?) which could trigger custom error/debugging information to be output on stdout or stderr.

Typical usage would be to catch incorrectly tagged elements, or groups of elements in undesirable arrangements. Sure XSL or a schema could be used to accomplish a similar validation goal, but CSS selectors are very quick to implement and much more flexible - and more importantly don't require an additional tool in the chain.

It could also benefit Prince's fall back system allowing it to alert the user/server when a fall back is triggered.

selector {
prince-debug: "some message";
prince-error: "some message";
prince-fatal: "some message";

Also, it seems that internally Prince runs a couple (or more?) passes over the document. Perhaps additional parameters could be set to determine at which pass a message is triggered.

For example:

prince-debug: "some message", pass-1;

The string output would need to support the usual content() attr() etc functions to give it the power to be really useful.

I've search through this forum and docs and can't find any similar functionality, please let me know if this exists already or can be achieved using a different technique.
That's an interesting idea! I don't think we'll have time to add this to Prince 7.0, but I'll add it to the development roadmap so we can revisit it later after the release is out.
Now that Prince supports JavaScript, I think it would be easier to implement a mechanism like this as a script, perhaps using jQuery.