-
Notifications
You must be signed in to change notification settings - Fork 196
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
Support multiple table headers #52
base: master
Are you sure you want to change the base?
Conversation
…n be more than 1 row of headers in a table.
Thanks for this @stury. I'll try to review this as soon as possible, but in the meantime, if either @christiankm or @john-mueller wants to take a look at this, I think that'd be great - since they worked on the original implementation of tables for Ink. |
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.
I dont see any problem adding support for this. Thanks for your contribution!
I am unaware if the standard markdown syntax allows this. As far as I can see the code looks fine.
Thanks! I could not find an official call out that Markdown supported this feature either, but using the Mac App Store applications |
Curious to hear if our CommonMark expert @john-mueller has any insight on this. Would merging this cause any problems in terms of CommonMark-conformance? |
Tables are not part of the CommonMark spec yet, but they are a part of the GitHub-flavored spec, which is merely an extension to CommonMark. The tables @christiankm and I worked on are basically GitHub-flavored, so technically this would be an extension to their extension. I'll do a quick check this weekend that this doesn't break anything related to CommonMark, but I seriously doubt it will, and I think it's purely additive to the GitHub-flavored tables. 👍 |
Great, thanks a lot for your insight, guys 🙂 Let's move ahead with this one then, I'll try to have it reviewed sometime during the next week. Cheers 👍 |
Just checking in with you to see if you need any other help from me with this PR. It looks like the last comment was from 19 days ago. |
Hi John,
I appreciate you open sourcing this Swift Package! I had a need for it to convert a markdown document I'm creating at work into HTML. This was just about the right ticket for me. One issue I ran into, which the commercial application products
Byword
andiA Writer
seem to support is that you can have multiple header rows in a Table. Ink doesn't support that. It's hard coded to only accept one row as the header.I've updated the code, to add this functionality.
I think they're fairly lightweight changes:
header
toheaders
, and converted its type from aRow?
to[Row]?
.findHeaderAlignmentRow()
to find where the row is for the header separator, and alignment hints in markdown.This update seems to be working well for me now. So I thought I'd send a PR back to you with these changes.
Thanks for this project! Nice and simple to integrate with, and was simple enough to troubleshoot and fix the problem I ran into.
Scott Tury