-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Implemented Table, Column and Cell #854
Implemented Table, Column and Cell #854
Conversation
Overall that's look very good 👍 We also maintain an handcrafted TypeScript Definition File: https://github.com/asciidoctor/asciidoctor.js/blob/master/packages/core/types/index.d.ts So we will need to add the new functions in here too. Let me know if you are not familiar with TypeScript or if you need help to get started. I can also follow-up on your work and add the missing definition in the |
Sorry, I am not familiar with the TypeScript definition files |
@Mogztter I have no idea, why the build Build / build (ubuntu-latest, 13.x, master) (pull_request) failed. What can I do? |
No worries, I will take care of it 👍
I think it's an intermittent failure, I might need to slightly increase the timeout. Nothing to worry about but now GitHub actions does not find the commit reference 🤔 |
Build is green, nice 🎉 |
That is fine with me. |
Thanks @henriette-einstein, thanks @Mogztter much appreciated. |
* @memberof Cell | ||
*/ | ||
Cell.prototype.getColumnPercentageWidth = function () { | ||
return this.getAttribute('colpcwidth') |
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.
@mojavelinux How do you feel about these utilities functions to "quickly" access the underlying attribute?
*/ | ||
Table.prototype.hasAutowidthOption = function () { | ||
var autowidthOption = this.getAttributes()['autowidth-option'] | ||
return autowidthOption === Opal.nil ? false : autowidthOption === '' |
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.
@mojavelinux I'm always a bit concerned that someone could use setAttribute
with a boolean value:
table.setAttribute('autowidth-option', true)
table.hasAutowidthOption() // false?!
Do we need to check if the value is truthy instead?
return autowidthOption === Opal.nil ? false : autowidthOption === '' | |
return autowidthOption === Opal.nil ? false : autowidthOption |
I did a little cleanup, it's looking very good. Thanks again for the heavy lifting 💪 |
Thanks for the great project. You did the heavy work! I'll add some more test cases and will commit in a few minutes |
😊
Perfect 👌 |
- Remove getAttribute method on Table, Cell and Column (already available on AbstractBlock) - Use a dot at the end of sentences. - Use long-format everywhere (Col -> Column) - Use camelCase (getRowCount -> getRowCount) - Add missing @memberof - Fix hasFooterOption
I've rebased on master (force-push), added the TypeScript definitions and a changelog. |
Added
and some test cases