Skip to content

Commit

Permalink
docs: make the readme a lot simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
iyxan23 committed Sep 18, 2024
1 parent a0d309a commit 86de3e7
Showing 1 changed file with 15 additions and 46 deletions.
61 changes: 15 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,23 @@

[![Node.js CI](https://github.com/iyxan23/ooxml-templater-js/actions/workflows/node.js.yml/badge.svg)](https://github.com/iyxan23/ooxml-templater-js/actions/workflows/node.js.yml)

No-nonsense minimally invasive docx and xlsx templater written in pure
typescript, featuring a functional language.
Template within your docs, and xlsx files.

## What is this?

A library for templating within your docx and xlsx files (.pptx unplanned). It
works by modifying the xml files in place without touching anything unrelated.

It works on browsers and Node.js. See it live on [the site](https://iyxan23.github.io/ooxml-templater-js).

There is a custom-developed language for working with sheets inspired by
functional programming, making it deterministic, robust, and extremely
composable. It's also possible to define your own functions, for extra
customizability.

[Read more about the sheet templating language here.](./docs/sheet-how-to.md)

## Getting Started

Check this [doc for more info](docs/getting-started.md). You can also try it out
on the live astro-powered demo [here](https://iyxan23.github.io/ooxml-templater-js/).

## Wait what?

> What does minimally invasive even mean?
This means that the library does as little as it could to the original structure
of the template. It does not parse any style info, page setups, or anything else
that is unrelated to the templating itself (replacing specific text within the
document/sheet).

Think of it as a surgery, it only changes the parts that it needed to change
and minimizes the amount of damage it could do to other parts of the file. This
is due to me not having much experience in parsing ooxml files, where, who knows
it might break something I didn't want to break.

In short, it replaces the texts and duplicates existing text (with its style
data and all).

## wat dis?!

```
[A] yo we got `report-template.xlsx`, can you fill it out with data:
| { ... big json data ... }
+ Thanks!
attached: report-template.xlsx
[B] 1000iq mode, does
|
| import { xlsxFillTemplate } from "ooxml-templater-xlsx";
| xlsxFillTemplate(file.stream(), output, theData);
|
+ Here's the result:
attached: Q1-report.xlsx
[A] ah, we need a whole year, from Q1 to Q4.
[B] say less
|
| quarters.forEach((i) =>
| xlsxFillTemplate(i.stream(), outputStream, quarterData[i])
| );
+
attached: Q1-report.xlsx, Q2-report.xlsx, Q3-report.xlsx, Q4-report.xlsx
```

0 comments on commit 86de3e7

Please sign in to comment.