tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

Footnotes' ASCII conversion doesn't respect /Q defaults #122

Closed bibimbop closed 11 years ago

bibimbop commented 11 years ago

The default for blockquotes are 2/2/2. If I convert the footnotes to ascii, I get:

/Q F:2 L:8 R:2

So 2/8/2 instead of 2/2/2. Or it could be that there is no way to set the defaults for the conversion.

tallforasmurf commented 11 years ago

The value of L: is calculated as follows:

2 for the PG required 2-space indent of formatted text
1 for a left bracket
1 for a right bracket
1 for a space
n for the width of the widest key value in that class of footnote.

When all alpha keys are single letters, or all numerics are single-digits, you get L:6 so the notes format:

[A] First line of note...
    continuation on next line lines up.

If you get L:8 it is because you have at least one key of 3 characters, [123] or [xiv]?

bibimbop commented 11 years ago

That's correct.

However it's not the format I'd like. I'd prefer to have 2/2/2. I could do a search replace, but then that might conflict with some other quote formatting. Fixing that issue might need a new interface.

No real urgency for me though.

tallforasmurf commented 11 years ago

Literally /Q F:2 L:2 R:2 -- or just /Q and nothing more so the defaults rule at reflow time? I could just take out all the calculation of key symbol width and use the bare /Q .

tallforasmurf commented 11 years ago

OK, here's what I'm going to do.

There are no constraints on the contents of a /Q line. The reflow logic parses it looking for keywords followed by a colon and a number. But anything that doesn't match that pattern is ignored.

So I'm going to change the Ascii convert to write /Q FN xxx where xxx is the key style name, typically ABC or 123 or ivx.

This will be ignored by reflow, but you can use find/replace to change it specific indents if you want.

tallforasmurf commented 11 years ago

2e4af9d