From b4aefcc8a0595c8e5bf0d6031e66ee2231bee4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Belmon?= Date: Thu, 5 Apr 2018 19:31:15 +0200 Subject: [PATCH] Completed instructions to use gatsby-transformer-excel (#4852) * 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 --- packages/gatsby-transformer-excel/README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/gatsby-transformer-excel/README.md b/packages/gatsby-transformer-excel/README.md index bc9b008b430cf..03dd71f3e7ac8 100644 --- a/packages/gatsby-transformer-excel/README.md +++ b/packages/gatsby-transformer-excel/README.md @@ -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.