Skip to content

Commit

Permalink
Completed instructions to use gatsby-transformer-excel (#4852)
Browse files Browse the repository at this point in the history
* Completed instructions to use gatsby-transformer-excel

After trying to use the plugin for a while, I figured out that I needed to use `gatsby-source-filesystem` to point my Excel's files directory.

I propose to update the documentation in this way.

* Update README.md
  • Loading branch information
SebastienBelmon authored and KyleAMathews committed Apr 5, 2018
1 parent 2e49112 commit b4aefcc
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/gatsby-transformer-excel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,30 @@ Parses Excel files into JSON arrays.

`npm install --save gatsby-transformer-excel`

Note: You generally will use this plugin together with the [`gatsby-source-filesystem`](/packages/gatsby-source-filesystem/) plugin. `gatsby-source-filesystem` reads in the files then this plugin *transforms* the files into data you can query.

## How to use

If you put your Excel's files in `./src/data`:

```javascript
// In your gatsby-config.js
plugins: [`gatsby-transformer-excel`];
module.exports = {
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `data`,
path: `${__dirname}/src/data/`,
},
},
`gatsby-transformer-excel`,
],
}
```

You can see an example project at https://github.com/gatsbyjs/gatsby/tree/master/examples/using-excel.

## Parsing algorithm

The parsing is powered by the [SheetJS / js-xlsx](https://git.io/xlsx) library.
Expand Down

0 comments on commit b4aefcc

Please sign in to comment.