Skip to content

Commit ea4d468

Browse files
committed
1.0.0 release
1 parent 019db57 commit ea4d468

File tree

6 files changed

+110
-5
lines changed

6 files changed

+110
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ pom.xml.asc
99
/.nrepl-port
1010
.hgignore
1111
.hg/
12+
.idea/
13+
*.iml

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Change Log
2+
3+
## [1.0.0] - 2019-04-17
4+
### Added
5+
- PDF generation
6+
- Nicer readme, roadmap & tests
7+
8+
## [0.1.0] - 2019-01-15
9+
- Pulled this code out of an accounting project I was working on as its own library.
10+
- Already had
11+
- Clojure data wrapper over Apache POI.
12+
- Tree/table/cell specifications.
13+
- Excel sheet writing.
14+

README.md

Lines changed: 92 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,44 @@
1-
## excel-clj
1+
# excel-clj
22

3-
Purpose: declarative creation of Excel spreadsheets / PDFs with Clojure from
4-
higher level abstractions (tree, table) or via a manual grid specification, with
5-
boilerplate-free common sense styling.
3+
Declarative generation of Excel documents & PDFs with Clojure from higher level
4+
abstractions (tree, table) or via a manual grid specification, with boilerplate-free
5+
common sense styling.
6+
7+
[CHANGELOG](CHANGELOG.md) | Uses [Break Versioning](https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md)
8+
9+
Lein:
10+
```
11+
[org.clojars.mjdowney/excel-clj "1.0.0"]
12+
```
13+
14+
- [Getting Started](#getting-started)
15+
- [Tables](#tables)
16+
- [Trees](#trees)
17+
- [PDF Generation](#pdf-generation)
18+
- [Table Styling](#table-styling)
19+
- [Tree Styling](#tree-styling)
20+
- [Manual Styling](#manual-styling)
21+
- [Grid Format & Cell Merging](#grid-format-&-cell-merging)
22+
- [Roadmap](#roadmap)
23+
- [Tree flexibility](#roadmap)
24+
- [Templates](#roadmap)
25+
- [Reading & editing](#roadmap)
26+
- [Formulas](#roadmap)
27+
28+
## Getting Started
629

730
All of the namespaces have an `example` function at the end; they're intended to
831
be browsable and easy to interact with to glean information beyond what's here
932
in a the readme.
1033

1134
Start by skimming this and then browsing [core.clj](src/excel_clj/core.clj).
1235

36+
Tests are run with
37+
38+
```clojure
39+
lein test
40+
```
41+
1342
### Tables
1443
Though Excel is much more than a program for designing tabular layouts, a table
1544
is a common abstraction that we impose on our data.
@@ -157,3 +186,62 @@ that includes optional style data / cell merging instructions.
157186
```
158187

159188
![A spreadsheet with a merged title](resources/manual-grid.png)
189+
190+
## Roadmap
191+
- Tree flexibility. [tree.clj](src/excel_clj/tree.clj) should be able to work
192+
with any data shape given the same functions as [`clojure.core/tree-seq`](https://clojuredocs.org/clojure.core/tree-seq).
193+
Additionally, it should provide hooks for custom ways to aggregate columns
194+
(instead of expecting `Number` data and summing it) and whether or not to display
195+
sub-category level totals vs just grand totals.
196+
197+
- Templates! There's no reason to do all of the styling work programmatically.
198+
We should be able to download [some cool Google Sheets template](https://docs.google.com/spreadsheets/u/0/?usp=mkt_sheets_tpl)
199+
as an `.xlsx` file, edit it to indicate where `excel-clj` should fill in tables,
200+
trees, or individual cells, and then write code that reads the template from a
201+
`resources/some-template.xlsx` and produces a filled in sheet.
202+
203+
Not at all a fully formed spec yet, but something along the lines of filling
204+
in the following sheet:
205+
206+
![Template draft](resources/template-draft.png)
207+
208+
Using some simple data:
209+
```clojure
210+
{:title "The Title"
211+
:start-date (Date. (- (System/currentTimeMillis) (* 1000 60 60 24 7)))
212+
:end-date (Date.)
213+
:employee-name "Foo"
214+
:employee-id "Bar"
215+
:manager-name "Baz"
216+
:department "Accounting"
217+
:expense-purpose "Trip"
218+
:tbl [{:date (Date.) :category "Cat A" :desc "Misc expenses"
219+
:notes "" :amount 500.00M}
220+
{:date (Date.) :category "Cat B" :desc "Other expenses"
221+
:notes "" :amount 100.00M}]}
222+
```
223+
224+
To get the following result:
225+
226+
![Filled in template draft](resources/filled-template-draft.png)
227+
228+
- Reading & editing existing spradsheets. This should go hand in hand with
229+
template generation.
230+
231+
- Formulas! We don't have them. I'm envisioning a syntax where a table column
232+
or a cell contain a `:value` of `(excel/formula ...)`. The interior of the
233+
formula could allow relative coordinate generation with the placeholders `*x*`
234+
and `*y*` — which could be operated on to find relative coordinates (e.g.
235+
`(- *x* 2)`) — and would then be replaced during rendering with the column and
236+
row. E.g.
237+
238+
```clojure
239+
(def table-data
240+
[{"Foos" 10, "Bars" 5, "Total" (excel/formula "=(- *x* 2)*y* + (- *x* 1)*y*")}
241+
{"Foos" 12, "Bars" 8, "Total" (excel/formula "=(- *x* 2)*y* + (- *x* 1)*y*")}])
242+
```
243+
244+
would result in the formulas being rendered in the C column after the title
245+
row, the first being `=A1+B1` and the second being `=A2+B2`.
246+
247+
- Java wrapper? Uncertain if this would be useful / how it would look.

project.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
(defproject excel-clj "1.0.0"
1+
(defproject org.clojars.mjdowney/excel-clj "1.0.0"
22
:description "Generate Excel documents & PDFs from Clojure data."
3+
:url "https://github.com/matthewdowney/excel-clj"
34
:license {:name "Eclipse Public License"
45
:url "http://www.eclipse.org/legal/epl-v10.html"}
56
:dependencies [[org.clojure/clojure "1.10.0"]

resources/filled-template-draft.png

41.6 KB
Loading

resources/template-draft.png

38.4 KB
Loading

0 commit comments

Comments
 (0)