mjul / docjure

Read and write Office documents from Clojure
MIT License
619 stars 128 forks source link

V2 with a more composition-friendly and configurable API #58

Open mjul opened 7 years ago

mjul commented 7 years ago

Rewrite the API to work on a Clojure map containing the POI instance rather than the POI instance itself.

This will allow us to add configuration and other state to the map as well (e.g. a cursor, the current sheet, names of the workflow (text) styles and other information).

Please use the v2 branch for this as it will not be fully backwards compatible if client code is depending on the leaky abstraction of the POI instances being passed around for state.

There is some discussion of this in Pull Request #57 . cc: @tombooth

mjul commented 7 years ago

Also, this is related to the proposals from

It would be great if you would contribute to this as well as you have very good ideas for the future of Docjure.

krisleech commented 6 years ago

Docjure has worked really well for writing Excel. Thanks. I wonder if you are using v2 yourself in production or it is still work in progress / subject to change?

mjul commented 6 years ago

V2 is an idea for a cleaner Docjure API, but it needs helpers to happen. @krisleech: It would be great if you want to help out defining it.

leontalbot commented 6 years ago

Hello! I am discovering docjure...

Is v2 about a more declarative approach where we would have a simple read and write fn (or at least fewer fns) that digest datastructures (like hiccup or clj-pdf do for writing html or pdf) ?

This would be indeed awesome!

mjul commented 6 years ago

My idea is to simplify and make it more composable by encapsulating the underlying POI fully behind a state/cursor data structure that would enable for example more idiomatic markup and styling functions than the current imperative versions. It would also enable us to simplify reading and writing by storing more context in the state object so selecting/navigating sheets and data can be done more uniformly.