-
Notifications
You must be signed in to change notification settings - Fork 65
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
pandoc.table.return refactoring #186
Conversation
Let me know if you need any help here. What does |
Minor things to be addressed:
These are not high priority, but probably we should do this in the means of refactoring, so that we can finish thinking about this in the near future, and can concentrate on new features, or rather documenting existing ones :) Other than these minor things, I see nothing serious to be refactored. I thought that converting all objects to the intermediary would suppress more part of the function, but what we have here is still extremely important, as makes maintenance a lot easier in the future. |
…ctoring split.cells
@daroczig, I added braces to if/for and fixed hardcoded values. Do you think it's reasonable to add braces in all other places to have more correct coverage? Also, I don't quite understand the issue with |
Thanks a lot! Re curly braces: yeah, it seems that it's required for Re > pander(data.frame(a = 'foo|bar', b = 'my missing cell'), style = 'rmarkdown')
| a | b |
|:-------:|:---------------:|
| foo|bar | my missing cell | Rendering as:
|
@daroczig, I was trying to find out about extra Now as to why rationale behind it, IMHO it was done to automatically account for separators like > pander(data.frame(a = '7 chars', b = paste(rep('Δ', 5), collapse = ' ')), split.table = 23, style='grid')
+---------+
| a |
+=========+
| 7 chars |
+---------+
Table: Table continues below
+-----------+
| b |
+===========+
| Δ Δ Δ Δ Δ |
+-----------+
> pander(data.frame(a = '7 chars', b = paste(rep('Δ', 5), collapse = ' ')), split.table = 24, style='grid')
+---------+-----------+
| a | b |
+=========+===========+
| 7 chars | Δ Δ Δ Δ Δ |
+---------+-----------+
> nchar("| 7 chars | Δ Δ Δ Δ Δ |", type='width')
[1] 23
So it seems to me that addition of spaces need to be adjusted accourding to |
Kudos for the great debugging! Your suggestion makes sense for sure, the number of extra spaces should be determined by the separator/style. Thanks again. |
pandoc.table.return refactoring
👍 |
I have started working on refactoring
pandoc.table.return
through converting to intermediate representation. As for now I am tryingdata.frame
as an intermediate representation. IMHO that should be a great simplification of many things and I will be pushing new commit as I refactor and test the other parts.