-
Notifications
You must be signed in to change notification settings - Fork 500
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
Default table alignment from theme #1164
Comments
That seems reasonable to me. Here's where that would go in the code base: /~https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor-pdf/converter.rb#L1959 Would you be interested in coding the change? It will need to be accompanied by a test (though with ~350 tests, you should be able to steal one that's already there). |
is smth like
probably it should be checked if theme has align value:
or even better to add default |
(theme.table_align || :left).to_sym
you still need the fallback since it has to be defined, so I'd just leave it this way in this case. |
Should |
Thx. I have made this small change, now I struggle with the test to cover those positions. Is it correct that I have to generate (manually?) reference pdf file and then to compare the result with it?
How do I generate reference pdf? For now I have just manually took the same src as in test and generated the PDF with default settings, put it to spec/reference and run the table tests... and they have failed :) Apparently I do smth wrong. BTW, is there a way to see what test generates? The PDF output? I would just visually confirmed that it is correct and put it into reference directory :) |
ahh, |
In this case, I think you could get away with doing an analyze test. Just put two tables on the page, and ensure that the one that has |
(and you check the position by looking for the :x position of the text in the cell). |
I have tried so many variants all of them do not work :( Could you look into the last one, where do I have mistakes:
|
Well of course it should be |
@mojavelinux this is the least I can do for you and asciidoctor-pdf :) |
I would be interested! Unfortunately I can't do this during my regular work hours, and I'm not sure when I'll be able to get to it. Also I have zero Ruby experience, kind of daunted by the task, but willing to learn for sure. Not sure how the tests work either... assuming unit tests written in Ruby? |
Thanks @habamax for stepping in here! And @mojavelinux for all you do for this project (goes without saying!). |
Thanks @habamax! I'll take a look at your test and get back to you. |
@dalemartin For the record, I can't do this during my regular works either and haven't been able to (for the most part) for 10 years. I make time.
This is a safe space for learning. So I'm glad to hear you are willing to put down your fear. I had zero Ruby experience when I sent my first two dozen patches to Asciidoctor. It doesn't matter. We're software developers, not "insert language here" developers. If you want change, you need to participate. That's how OSS works. |
Great job @habamax. You knocked the ⚾ out of the park! |
Currently we have
Proposing a matching key for tables:
Should be able to override using the current
align="left | center | right"
property for individual placement.The text was updated successfully, but these errors were encountered: