-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
OpenDocument writer: Table width support #6792
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I left some minor code comments. LGTM otherwise!
5fbdd32
to
6132282
Compare
Just to keep you in the loop: a new release is in preparation right now. That means merging may be delayed until after the release is out. |
Can you explain more fully what you mean by "table width support"? |
Yes sorry - this is the width of the table as percent of the page-width. It's correctly transferred into the HTML writer. |
This should be determined by the relative widths of the columns, as specified in the table AST, right? |
Column widths come in as a percentage of the table width as far as I can tell. I.e. you still need the full width of the table. The AST types define the following: -- | The width of a table column, as a fraction of the total table I.e. they seem to be relative to the total table width - not absolute. |
No, actually, the proper interpretation of the relative column widths in the table AST is as percentages of text width (not table width). |
Ok, I can change it to do that and send a pull-request to fix the AST documentation then. |
@jgm here is a pull-request to correct the AST documentation: jgm/pandoc-types#85 If you could review and it's correct then I can refactor this pull-request and the one for the DocBook reader. |
6132282
to
33ba870
Compare
@jgm I've refactored this now to make use of the column widths as a percentage. Much more satisfying than looking at an undocumented key-value I have to say. |
I'm just wondering how this interacts with the relative column widths. Do we support column widths yet in opendocument? If we do, how do these interact with the table width? |
Yes - column widths are supported and work from what I've seen - they are expressed in proportion to each other - i.e. they are without unit. |
How about a test or two? Easiest way is to add a command test, which could be named |
I'll see what I can do - this requires a full test - command tests do not work for styles as they can only manage opendocument output - not odt output. |
I'm afraid this is beyond me - there is no framework for testing the ODT writer - just the ODT reader. I'm afraid I wouldn't know how (or have the time) to develop that sort of framework. I'm afraid these styles will remain untested for the time being. |
Since this modifies the opendocument writer, couldn't we just have a command test with |
33ba870
to
9613b90
Compare
Ok, thank you for pushing me on this. I figured out what was going on - the opendocument writer doesn't emit styles unless a template is used - so I got that working. Now there's a solid unit test. Thank you. |
9613b90
to
e7f091a
Compare
Great. I don't think we need the special template. Just use the default one: |
Support for table width as a percentage of text width by summing width of columns and verifying that the sum is > 0 and <= 1.
e7f091a
to
9813c0e
Compare
done, sorry about that - didn't realize the template directory was accessible. |
great, thanks! |
Use the same key-value in Attr for the table as the HTML writer
to implement table width support.