Closed dpetranek closed 8 years ago
Currently, not all the tests are passing - specifically checking row numbers. I think it's a problem with how I wrote the test instead of the functionality, though.
@dpetranek I'd be very interested in this functionality :)
@dpetranek Nice, I was just thinking about how the create-workbook function should have this and then I saw your PR.
The version I pictured uses variable arity though, [sheet-name data & name-data-pairs]
, the rationale being that sheet names and data are key value pairs and create-workbook should work like hash-map
or assoc
, cause that's what I understand from the original arity. Why are the pairs wrapped in a vector?
@madstap I like your idea of using variable arity, I think it's much more intuitive for users to have consistent syntax for this function between the single-sheet and multiple sheet versions. And your cleaned up version is much less hacky than mine was, and a distinct improvement for readability, so I'm going with that.
I also like the :pre
test to weed out unmatched pairs. I initially decided to be forgiving, and just allow it to create a blank sheet because I sometimes need to do that. But I can just pass nil
if I need a blank sheet, and I think it's better to check our expectations at the door.
I've committed the new version with cleaned up tests, everything is passing now.
@mjul Hello Martin, could you take a look at this? @madstap helped me clean up the implementation to simplify and I think it stands pretty well on its own now.
The tests are based on those for the create-workbook
function and they are all passing.
I'm about to start a new project and I'd like to see if we can get this merged before then. Thanks!
I had commented out the pomegranate dependency for reasons that are now lost to the mists of time, but I just uncommented them and re-ran the tests, everything is still good.
Looks good. Please add your names as contributors in the Readme and you are good to go.
I added mine. Your turn @madstap.
Could you just add it?
[Aleksander Madland Stapnes](https://github.com/madstap) (madstap)
Or should I make a pull request?
@madstap I added you. @mjul Looks like we're good to go. Thanks!
Hello all! Any chance this could be merged in the next day or so? If not, I can just use @dpetranek's branch directly.
Thanks for all your work on this library!
Thanks for the great work!
Hi Dylan
I just merged and published as the latest snapshot build to Clojars. Have fun with it and have a nice day, and if you have some ideas for improvements, don’t hesitate to send a pull request ;-)
Cheers, Martin
This is now available in the 1.11-SNAPSHOT build on Clojars:
https://clojars.org/dk.ative/docjure/versions/1.11.0-SNAPSHOT
@mjul Thank you very much, I look forward to using it! And yes, I'll be sure to send a PR if we come up with any fixes/improvements.
@dpetranek @madstap Thanks as well for your work on contributing this feature!
Modifies the create-workbook function without breaking backwards compatibly. The original arity of [sheetname data] is preserved, but I added an arity of [sheet-vec] that takes a vector of alternating sheetnames and sheetdata.