From fe748adc01d655375d972e54eb958092c9259f06 Mon Sep 17 00:00:00 2001 From: protobi Date: Tue, 8 Mar 2016 12:57:04 -0500 Subject: [PATCH] Copy README from beta --- README.md | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d01742e..d664844 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,20 @@ -# xlsx +# xlsx-style Parser and writer for various spreadsheet formats. Pure-JS cleanroom implementation from official specifications and related documents. +# About this fork +--- +**NOTE:** [This project](https://github.com/SheetJS/js-xlsx/tree/beta) is a fork of the original (and awesome) [SheetJS/xlsx](https://github.com/SheetJS/js-xlsx) project. +It is extended to enable cell formats to be read from and written to .xlsx workbooks. +The intent is to provide a temporary means of using these features in practice, and ultimately to merge this into the primary project. +Report any issues to https://github.com/protobi/js-xlsx/issues. + +For those contributing to this fork: +* `master` is the main branch, which follows the original repo to enable a future pull request. +* `beta` branch is published to npm and bower to make this fork available for use. +--- + Supported read formats: - Excel 2007+ XML Formats (XLSX/XLSM) @@ -24,10 +36,10 @@ Source: ## Installation -With [npm](https://www.npmjs.org/package/xlsx): +With [npm](https://www.npmjs.org/package/xlsx-style): ```sh -npm install xlsx --save +npm install xlsx-style --save ``` In the browser: @@ -39,7 +51,7 @@ In the browser: With [bower](http://bower.io/search/?q=js-xlsx): ```sh -bower install js-xlsx +bower install js-xlsx-style#beta ``` CDNjs automatically pulls the latest version and makes all versions available at @@ -419,14 +431,21 @@ Special worksheet keys (accessible as `worksheet[key]`, each starting with `!`): will write all cells in the merge range if they exist, so be sure that only the first cell (upper-left) in the range is set. +The following properties are currently used when generating an XLSX file, but not yet parsed: + +- `ws['!rowBreaks']`: array of row break points, e.g. `[16,32]` +- `ws['!colBreaks']`: array of col break points, e.g. `[8,16]` - `ws['!pageSetup']`: `{scale: '100', orientation: 'portrait'||'landscape'} + + ### Workbook Object `workbook.SheetNames` is an ordered list of the sheets in the workbook `wb.Sheets[sheetname]` returns an object representing the worksheet. -`wb.Props` is an object storing the standard properties. The following properties are written but not parsed: +`wb.Props` is an object storing the standard properties. The following properties are currently used when +generating an XLSX file, but not yet parsed: - `title` - `subject` - `description` @@ -485,7 +504,7 @@ The exported `write` and `writeFile` functions accept an options argument: | cellDates | false | Store dates as type `d` (default is `n`) | | bookSST | false | Generate Shared String Table ** | | bookType | 'xlsx' | Type of Workbook ("xlsx" or "xlsm" or "xlsb") | -| showGridLines | true | Show gridlines on all pages | +| showGridLines | true | Show gridlines on all pages | | tabSelected | '1' | Initial tab selected | - `bookSST` is slower and more memory intensive, but has better compatibility @@ -496,6 +515,7 @@ The exported `write` and `writeFile` functions accept an options argument: - `cellDates` only applies to XLSX output and is not guaranteed to work with third-party readers. Excel itself does not usually write cells with type `d` so non-Excel tools may ignore the data or blow up in the presence of dates. +- showGridLines and tabSelected are currently used when generating an XLSX file but not yet parse. ## Cell Styles @@ -525,7 +545,7 @@ top-level attributes: `fill`, `font`, `numFmt`, `alignment`, and `border`. | | | `"0.00%;\\(0.00%\\);\\-;@"` // string specifying a custom format, escaping special characters | | | `"m/dd/yy"` // string a date format using Excel's format notation | alignment | vertical | `"bottom"||"center"||"top"` -| | horizontal | `"bottom"||"center"||"top"` +| | horizontal | `"left"||"center"||"right"` | | wrapText | `true || false` | | readingOrder | `2` // for right-to-left | | textRotation | Number from `0` to `180` or `255` (default is `0`)