+
+ Spreadsheet JS Data
+
![`pres.xlsx` data](pathname:///pres.png)
@@ -518,47 +520,83 @@ for(var n = 1, mean = 0; n <= x.length; ++n) mean += (x[n-1] - mean)/n;
Let $M[x;m] = \frac{1}{m}\sum_{i=1}^{m}x_m$ be the mean of the first $m$ elements. Then:
-
+
+
+
+
$M[x;m+1]$
-
+
+
$= \frac{1}{m+1}\sum_{i=1}^{m+1} x_i$
-
+
+
+
+
+
$= \frac{1}{m+1}\sum_{i=1}^{m} x_i + \frac{x_{m+1}}{m+1}$
-
+
+
+
+
+
$= \frac{m}{m+1}(\frac{1}{m}\sum_{i=1}^{m} x_i) + \frac{x_{m+1}}{m+1}$
-
+
+
+
+
+
$= \frac{m}{m+1}M[x;m] + \frac{x_{m+1}}{m+1}$
-
+
+
+
+
+
$= (1 - \frac{1}{m+1})M[x;m] + \frac{x_{m+1}}{m+1}$
-
+
+
+
+
+
$= M[x;m] + \frac{x_{m+1}}{m+1} - \frac{1}{m+1}M[x;m]$
-
+
+
+
+
+
$= M[x;m] + \frac{1}{m+1}(x_{m+1}-M[x;m])$
-
+
+
+
+
$new\_mean$
-
+
+
$= old\_mean + (x_{m+1}-old\_mean) / (m+1)$
-
+
+
+
+
+
Switching to zero-based indexing, the relation matches the following expression:
diff --git a/docz/docs/03-demos/01-math/09-danfojs.md b/docz/docs/03-demos/01-math/09-danfojs.md
index 6280e2e..b6e436f 100644
--- a/docz/docs/03-demos/01-math/09-danfojs.md
+++ b/docz/docs/03-demos/01-math/09-danfojs.md
@@ -42,7 +42,9 @@ The DanfoJS `DataFrame`[^1] represents two-dimensional tabular data. It is the
starting point for most DanfoJS data processing tasks. A `DataFrame` typically
corresponds to one SheetJS worksheet[^2].
-Spreadsheet DanfoJS DataFrame
+
+ Spreadsheet DanfoJS DataFrame
+
![`pres.xlsx` data](pathname:///pres.png)
@@ -294,11 +296,11 @@ function DanfoToXLS() {
[^1]: See ["Dataframe"](https://danfo.jsdata.org/api-reference/dataframe) in the DanfoJS documentation
[^2]: See ["Sheet Objects"](/docs/csf/sheet)
[^3]: See ["danfo.readExcel"](https://danfo.jsdata.org/api-reference/input-output/danfo.read_excel) in the DanfoJS documentation.
-[^4]: See ["Reading Files"](/docs/api/parse-options/#parsing-options) for the full list of parsing options.
+[^4]: See ["Reading Files"](/docs/api/parse-options#parsing-options) for the full list of parsing options.
[^5]: See ["File API" in "Local File Access"](/docs/demos/local/file#file-api) for more details.
[^6]: See ["danfo.toExcel"](https://danfo.jsdata.org/api-reference/input-output/danfo.to_excel) in the DanfoJS documentation.
[^7]: See [`writeFile` in "Writing Files"](/docs/api/write-options)
-[^8]: See ["Writing Files"](/docs/api/write-options/#writing-options) for the full list of writing options.
+[^8]: See ["Writing Files"](/docs/api/write-options#writing-options) for the full list of writing options.
[^9]: See ["Creating a DataFrame"](https://danfo.jsdata.org/api-reference/dataframe/creating-a-dataframe) in the DanfoJS documentation.
[^10]: See [`sheet_to_json` in "Utilities"](/docs/api/utilities/array#array-output)
[^11]: See ["danfo.toJSON"](https://danfo.jsdata.org/api-reference/input-output/danfo.to_json) in the DanfoJS documentation.
diff --git a/docz/docs/03-demos/01-math/11-tensorflow.md b/docz/docs/03-demos/01-math/11-tensorflow.md
index 6d1e4a0..c7ba37e 100644
--- a/docz/docs/03-demos/01-math/11-tensorflow.md
+++ b/docz/docs/03-demos/01-math/11-tensorflow.md
@@ -22,8 +22,8 @@ results back to spreadsheets.
- ["CSV Data Interchange"](#csv-data-interchange) uses SheetJS to process sheets
and generate CSV data that TF.js can import.
-- ["JSON Data Interchange"](#json-data-interchange) uses SheetJS to process
- sheets and generate rows of objects that can be post-processed.
+- ["JS Array Interchange"](#js-array-interchange) uses SheetJS to process sheets
+ and generate rows of objects that can be post-processed.
:::info pass
diff --git a/docz/docs/03-demos/01-math/index.md b/docz/docs/03-demos/01-math/index.md
index 4e3e285..dec0e8d 100644
--- a/docz/docs/03-demos/01-math/index.md
+++ b/docz/docs/03-demos/01-math/index.md
@@ -219,7 +219,9 @@ const petal_length = Float64Array.from(aoa.map(row => row[C]).slice(1));
Some datasets are stored in tables where each row represents a variable and each
column represents an observation:
-JavaScript Spreadsheet
+
+ JavaScript Spreadsheet
+
```js
var aoa = [
@@ -332,7 +334,9 @@ function SheetJSeriesToRows() { return ( {
A single typed array can be converted to a pure JS array with `Array.from`. For
columns, each value should be individually wrapped in an array:
-JavaScript Spreadsheet
+
+ JavaScript Spreadsheet
+
```js
var data = [
diff --git a/docz/docs/03-demos/02-frontend/01-kaioken.md b/docz/docs/03-demos/02-frontend/01-kaioken.md
index f44a8f8..a90fa32 100644
--- a/docz/docs/03-demos/02-frontend/01-kaioken.md
+++ b/docz/docs/03-demos/02-frontend/01-kaioken.md
@@ -58,7 +58,9 @@ The example [presidents sheet](https://sheetjs.com/pres.xlsx) has one header row
with "Name" and "Index" columns. The natural JS representation is an object for
each row, using the values in the first rows as keys:
-Spreadsheet State
+
+ Spreadsheet State
+
![`pres.xlsx` data](pathname:///pres.png)
diff --git a/docz/docs/03-demos/02-frontend/02-react.md b/docz/docs/03-demos/02-frontend/02-react.md
index 93ff8b1..1490b26 100644
--- a/docz/docs/03-demos/02-frontend/02-react.md
+++ b/docz/docs/03-demos/02-frontend/02-react.md
@@ -61,7 +61,9 @@ The example [presidents sheet](https://sheetjs.com/pres.xlsx) has one header row
with "Name" and "Index" columns. The natural JS representation is an object for
each row, using the values in the first rows as keys:
-Spreadsheet State
+
+ Spreadsheet State
+
![`pres.xlsx` data](pathname:///pres.png)
diff --git a/docz/docs/03-demos/02-frontend/03-angular.md b/docz/docs/03-demos/02-frontend/03-angular.md
index e217e5f..55a1f4c 100644
--- a/docz/docs/03-demos/02-frontend/03-angular.md
+++ b/docz/docs/03-demos/02-frontend/03-angular.md
@@ -91,7 +91,9 @@ The example [presidents sheet](https://sheetjs.com/pres.xlsx) has one header row
with "Name" and "Index" columns. The natural JS representation is an object for
each row, using the values in the first rows as keys:
-Spreadsheet State
+
+ Spreadsheet State
+
![`pres.xlsx` data](pathname:///pres.png)
diff --git a/docz/docs/03-demos/02-frontend/04-vue.md b/docz/docs/03-demos/02-frontend/04-vue.md
index f5011e2..817fda6 100644
--- a/docz/docs/03-demos/02-frontend/04-vue.md
+++ b/docz/docs/03-demos/02-frontend/04-vue.md
@@ -60,7 +60,9 @@ The example [presidents sheet](https://sheetjs.com/pres.xlsx) has one header row
with "Name" and "Index" columns. The natural JS representation is an object for
each row, using the values in the first rows as keys:
-Spreadsheet State
+
+ Spreadsheet State
+
![`pres.xlsx` data](pathname:///pres.png)
diff --git a/docz/docs/03-demos/02-frontend/07-angularjs.md b/docz/docs/03-demos/02-frontend/07-angularjs.md
index e02830d..9b52bec 100644
--- a/docz/docs/03-demos/02-frontend/07-angularjs.md
+++ b/docz/docs/03-demos/02-frontend/07-angularjs.md
@@ -171,7 +171,9 @@ The example [presidents sheet](https://sheetjs.com/pres.xlsx) has one header row
with "Name" and "Index" columns. The natural JS representation is an object for
each row, using the values in the first rows as keys:
-Spreadsheet State
+
+ Spreadsheet State
+
![`pres.xlsx` data](pathname:///pres.png)
diff --git a/docz/docs/03-demos/02-frontend/index.md b/docz/docs/03-demos/02-frontend/index.md
index 8f1f510..fae69a9 100644
--- a/docz/docs/03-demos/02-frontend/index.md
+++ b/docz/docs/03-demos/02-frontend/index.md
@@ -65,7 +65,7 @@ The following demos are in separate pages:
{item.label} {item.customProps?.summary && (" - " + item.customProps.summary)}
);
})}
-Dojo Toolkit
-Snowpack
-WMR
+Dojo Toolkit
+Snowpack
+WMR
diff --git a/docz/docs/03-demos/12-static/12-astro.md b/docz/docs/03-demos/12-static/12-astro.md
index 68e77f5..af505a2 100644
--- a/docz/docs/03-demos/12-static/12-astro.md
+++ b/docz/docs/03-demos/12-static/12-astro.md
@@ -69,7 +69,7 @@ AstroJS has introduced a number of breaking changes in minor releases.
:::info pass
-This demo uses ["Base64 Loader"](/docs/demos/static/vitejs#base64-loader)
+This demo uses ["Base64 Loader"](/docs/demos/static/vitejs#base64-plugin)
from the ViteJS demo.
The ViteJS demo used the query `?b64` to identify files. To play nice with
diff --git a/docz/docs/03-demos/17-mobile/01-reactnative.md b/docz/docs/03-demos/17-mobile/01-reactnative.md
index 924a8e3..bed4e1d 100644
--- a/docz/docs/03-demos/17-mobile/01-reactnative.md
+++ b/docz/docs/03-demos/17-mobile/01-reactnative.md
@@ -69,7 +69,9 @@ imported from any component or script in the app.
For simplicity, this demo uses an "Array of Arrays"[^2] as the internal state.
-Spreadsheet Array of Arrays
+
+ Spreadsheet Array of Arrays
+
![`pres.xlsx` data](pathname:///pres.png)
diff --git a/docz/docs/03-demos/17-mobile/index.md b/docz/docs/03-demos/17-mobile/index.md
index 8319f38..8aa1d32 100644
--- a/docz/docs/03-demos/17-mobile/index.md
+++ b/docz/docs/03-demos/17-mobile/index.md
@@ -47,9 +47,9 @@ projects that can use community modules. However, its "lean core" approach
forces developers to learn iOS/Android programming or use community modules to
provide basic app features.
-The original Web View framework was PhoneGap/Cordova. The modern frameworks
-are built atop Cordova. Cordova is waning in popularity but it has a deep
-library of community modules to solve many problems.
+The original Web View framework was PhoneGap/Cordova. The modern frameworks are
+built atop Cordova. Cordova is waning in popularity but it has a deep library of
+community modules to solve many problems.
Before creating a new app, it is important to identify what features the app
should support and investigate community modules. If there are popular modules
diff --git a/docz/docs/03-demos/19-desktop/06-reactnative.md b/docz/docs/03-demos/19-desktop/06-reactnative.md
index bc254ab..8051314 100644
--- a/docz/docs/03-demos/19-desktop/06-reactnative.md
+++ b/docz/docs/03-demos/19-desktop/06-reactnative.md
@@ -84,7 +84,9 @@ imported from any component or script in the app.
For simplicity, this demo uses an "Array of Arrays"[^2] as the internal state.
-Spreadsheet Array of Arrays
+
+ Spreadsheet Array of Arrays
+
![`pres.xlsx` data](pathname:///pres.png)
diff --git a/docz/docs/03-demos/23-data/10-sql.md b/docz/docs/03-demos/23-data/10-sql.md
index 387fc2d..0ffb0c8 100644
--- a/docz/docs/03-demos/23-data/10-sql.md
+++ b/docz/docs/03-demos/23-data/10-sql.md
@@ -9,6 +9,11 @@ sidebar_custom_props:
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+Structured Query Language ("SQL") is a popular declarative language for issuing
+commands to database servers.
+
+## Raw SQL Operations
+
### Generating Tables
This example will fetch https://sheetjs.com/data/cd.xls, scan the columns of the
@@ -148,7 +153,7 @@ types and other database minutiae.
### Other SQL Databases
-The `generate_sql` function from ["Building Schemas from Worksheets"](#building-schemas-from-worksheets)
+The `generate_sql` function from ["Generating Tables"](#generating-tables)
can be adapted to generate SQL statements for a variety of databases, including:
**PostgreSQL**
diff --git a/docz/docs/03-demos/27-local/09-indexeddb.md b/docz/docs/03-demos/27-local/09-indexeddb.md
index abf28c6..06e1755 100644
--- a/docz/docs/03-demos/27-local/09-indexeddb.md
+++ b/docz/docs/03-demos/27-local/09-indexeddb.md
@@ -21,8 +21,8 @@ libraries in production applications.
:::
The IndexedDB API provides an in-browser sandboxed local data store for JSON
-objects. Like the [Local Storage API](/docs/demos/data/storageapi), IndexedDB is
-a popular choice for offline storage.
+objects. Like the [Local Storage API](/docs/demos/local/storageapi), IndexedDB
+is a popular choice for offline storage.
## Wrapper Libraries
diff --git a/docz/docs/03-demos/30-cloud/index.md b/docz/docs/03-demos/30-cloud/index.md
index 82996c8..6b9dc79 100644
--- a/docz/docs/03-demos/30-cloud/index.md
+++ b/docz/docs/03-demos/30-cloud/index.md
@@ -26,7 +26,7 @@ of code that are run in NodeJS or other server-side JS platforms. While SheetJS
libraries can run in server-side environments, the cloud platforms can corrupt
form data. This can be disabled with cloud-specific configuration:
-- [AWS Lambda Functions](/docs/demos/cloud/aws#aws-lambda-functions)
+- [AWS Lambda Functions](/docs/demos/cloud/aws#lambda-functions)
- [Azure Functions](/docs/demos/cloud/azure#azure-functions)
- [GitHub Actions](/docs/demos/cloud/github)
- [Deno Deploy](/docs/demos/cloud/deno)
@@ -38,7 +38,7 @@ files typically contain binary characters. Cloud storage APIs can corrupt
binary data, so special care must be taken.
- [Amazon Simple Storage Service (S3)](/docs/demos/cloud/aws#s3-storage)
-- [Azure Blob Storage](/docs/demos/cloud/azure#azure-blob-storage)
+- [Azure Blob Storage](/docs/demos/cloud/azure#blob-storage)
### File Hosting
diff --git a/docz/docs/03-demos/32-extensions/03-excelapi.md b/docz/docs/03-demos/32-extensions/03-excelapi.md
index 6169354..812d906 100644
--- a/docz/docs/03-demos/32-extensions/03-excelapi.md
+++ b/docz/docs/03-demos/32-extensions/03-excelapi.md
@@ -64,9 +64,9 @@ npx office-addin-usage-data list
The [SheetJS NodeJS module](/docs/getting-started/installation/nodejs) can be
imported from scripts in an Excel Custom Functions project.
-The [`sheet_to_json`](/docs/api/utilities#json) helper function can generate
-arrays of arrays of values based on the worksheet data. Excel custom functions
-transparently treat these as Dynamic Arrays.
+The [`sheet_to_json`](/docs/api/utilities/array#array-output) helper function
+can generate arrays of arrays of values based on the worksheet data. Excel
+custom functions transparently treat these as Dynamic Arrays.
This example fetches a file, parses the data, and extracts the first worksheet:
diff --git a/docz/docs/03-demos/37-bigdata/02-worker.md b/docz/docs/03-demos/37-bigdata/02-worker.md
index ce5812b..e6c9d5e 100644
--- a/docz/docs/03-demos/37-bigdata/02-worker.md
+++ b/docz/docs/03-demos/37-bigdata/02-worker.md
@@ -19,8 +19,9 @@ to a remote server.
The following diagrams show the normal and Web Worker flows when exporting a
dataset. The regions with a red background mark when the browser is frozen.
-Normal Export Web Worker Export
-
+
+ Normal Export Web Worker Export
+
```mermaid
sequenceDiagram
@@ -497,7 +498,7 @@ self.addEventListener('message', (e) => {
### Streaming Write
A more general discussion, including row-oriented processing demos, is included
-in the ["Large Datasets"](/docs/demos/stream#browser) demo.
+in the ["Large Datasets"](/docs/demos/bigdata/stream#browser) demo.
`XLSX.stream.to_csv` incrementally generates CSV rows.
diff --git a/docz/docs/03-demos/37-bigdata/index.md b/docz/docs/03-demos/37-bigdata/index.md
index 1579e98..7b8fa80 100644
--- a/docz/docs/03-demos/37-bigdata/index.md
+++ b/docz/docs/03-demos/37-bigdata/index.md
@@ -21,10 +21,11 @@ Since many of the techniques only work in a few engines, they are not embedded
in the library. They are recommended only when traditional approaches falter.
{useCurrentSidebarCategory().items.map((item, index) => {
- const listyle = (item.customProps?.icon) ? {
+ const listyle = (item.customProps?.icon) ? ({
listStyleImage: `url("${item.customProps.icon}")`
- } : {};
+ }) : ({});
return (
- {item.label} {item.customProps?.summary && (" - " + item.customProps.summary)}
+ {item.label}
+ {item.customProps?.summary && (" - " + item.customProps.summary)}
);
})}
diff --git a/docz/docs/03-demos/42-engines/21-boa.md b/docz/docs/03-demos/42-engines/21-boa.md
index 1848139..47a6275 100644
--- a/docz/docs/03-demos/42-engines/21-boa.md
+++ b/docz/docs/03-demos/42-engines/21-boa.md
@@ -19,8 +19,8 @@ more performant engine like [`v8`](/docs/demos/engines/v8#rust)
[SheetJS](https://sheetjs.com) is a JavaScript library for reading and writing
data from spreadsheets.
-The ["Complete Example"](#integration-example) section creates a command-line
-tool for reading data from spreadsheets and generating CSV rows.
+The ["Complete Example"](#complete-example) section creates a command-line tool
+for reading data from spreadsheets and generating CSV rows.
## Integration Details
diff --git a/docz/docs/03-demos/42-engines/index.md b/docz/docs/03-demos/42-engines/index.md
index 1390cf5..62a2ccc 100644
--- a/docz/docs/03-demos/42-engines/index.md
+++ b/docz/docs/03-demos/42-engines/index.md
@@ -171,6 +171,6 @@ NodeJS and Deno, Adobe UXP and other platforms.
This demo has been moved [to a dedicated page](/docs/demos/engines/v8).
The demo includes examples in C++ and Rust.
-The ["Python + Pandas" demo](/docs/demos/engines/pandas) uses V8 with Python.
+The ["Python + Pandas" demo](/docs/demos/math/pandas) uses V8 with Python.
[^1]: See ["Initialize Hermes"](/docs/demos/engines/hermes#initialize-hermes) in the Hermes demo.
\ No newline at end of file
diff --git a/docz/docs/03-demos/index.md b/docz/docs/03-demos/index.md
index d795b10..ec05c25 100644
--- a/docz/docs/03-demos/index.md
+++ b/docz/docs/03-demos/index.md
@@ -23,8 +23,8 @@ in the [issue tracker](https://git.sheetjs.com/sheetjs/docs.sheetjs.com/issues)
- [`Web Workers`](/docs/demos/bigdata/worker)
- [`Typed Arrays`](/docs/demos/math)
- [`Local File Access`](/docs/demos/local/file)
-- [`LocalStorage and SessionStorage`](/docs/demos/data/storageapi)
-- [`Web SQL Database`](/docs/demos/data/websql)
+- [`LocalStorage and SessionStorage`](/docs/demos/local/storageapi)
+- [`Web SQL Database`](/docs/demos/local/websql)
- [`IndexedDB`](/docs/demos/local/indexeddb)
### Web Frameworks
@@ -44,8 +44,8 @@ in the [issue tracker](https://git.sheetjs.com/sheetjs/docs.sheetjs.com/issues)
- [`react-data-grid`](/docs/demos/grid/rdg)
- [`glide-data-grid`](/docs/demos/grid/gdg)
- [`vue3-table-lite`](/docs/demos/grid/vtl)
-- [`angular-ui-grid`](/docs/demos/grid#angular-ui-grid)
-- [`material ui`](/docs/demos/grid#material-ui-table)
+- [`angular-ui-grid`](/docs/demos/grid/#angular-ui-grid)
+- [`material ui`](/docs/demos/grid/mui)
### iOS and Android Mobile Apps
@@ -107,8 +107,8 @@ in the [issue tracker](https://git.sheetjs.com/sheetjs/docs.sheetjs.com/issues)
### Platforms and Integrations
- [`Command-Line Tools`](/docs/demos/cli)
-- [`NodeJS Server-Side Processing`](/docs/demos/net/server#nodejs)
-- [`Deno Server-Side Processing`](/docs/demos/net/server#deno)
+- [`NodeJS Server-Side Processing`](/docs/demos/net/server/#nodejs)
+- [`Deno Server-Side Processing`](/docs/demos/net/server/#deno)
- [`Headless Automation`](/docs/demos/net/headless)
- [`Databases and Structured Data Stores`](/docs/demos/data)
- [`NoSQL and Unstructured Data Stores`](/docs/demos/data)
@@ -116,18 +116,17 @@ in the [issue tracker](https://git.sheetjs.com/sheetjs/docs.sheetjs.com/issues)
### Bundlers and Tooling
-- [`browserify`](/docs/demos/frontend/bundler#browserify)
-- [`bun`](/docs/demos/frontend/bundler#bun)
+- [`browserify`](/docs/demos/frontend/bundler/browserify)
+- [`bun`]((/docs/getting-started/installation/bun#bundling)
- [`esbuild`](/docs/demos/frontend/bundler/esbuild)
-- [`parcel`](/docs/demos/frontend/bundler#parcel)
+- [`parcel`](/docs/demos/frontend/bundler/parcel)
- [`requirejs`](/docs/demos/frontend/bundler/requirejs)
-- [`rollup`](/docs/demos/frontend/bundler#rollup)
-- [`snowpack`](/docs/demos/frontend/bundler#snowpack)
-- [`swc`](/docs/demos/frontend/bundler#swc)
+- [`rollup`](/docs/demos/frontend/bundler/rollup)
+- [`swc`](/docs/demos/frontend/bundler/swcpack)
- [`systemjs`](/docs/demos/frontend/bundler/systemjs)
-- [`vite`](/docs/demos/frontend/bundler#vite)
+- [`vite`](/docs/demos/frontend/bundler/vitejs)
- [`webpack`](/docs/demos/frontend/bundler/webpack)
-- [`wmr`](/docs/demos/frontend/bundler#wmr)
+- [`wmr`](/docs/demos/frontend/bundler/#wmr)
### Other Programming Languages
diff --git a/docz/docs/06-solutions/01-input.md b/docz/docs/06-solutions/01-input.md
index 37cba5c..3664b17 100644
--- a/docz/docs/06-solutions/01-input.md
+++ b/docz/docs/06-solutions/01-input.md
@@ -99,13 +99,13 @@ var XLSX = require("xlsx");
var workbook = XLSX.readFile(path);
```
-Electron APIs have changed over time. The [`electron` demo](/docs/demos/desktop#electron)
+Electron APIs have changed over time. The [`electron` demo](/docs/demos/desktop/electron)
shows a complete example and details the required version-specific settings.
-[The React Native Demo](/docs/demos/mobile#rn-file-plugins) covers tested plugins.
+[The React Native Demo](/docs/demos/mobile/reactnative#rn-file-plugins) covers tested plugins.
@@ -130,7 +130,8 @@ var thisFile = File.openDialog("Select a spreadsheet");
var workbook = XLSX.readFile(thisFile.absoluteURI);
```
-The [`extendscript` demo](/docs/demos/extendscript) includes a more complex example.
+The [`extendscript` demo](/docs/demos/extensions/extendscript) includes complete
+examples for Photoshop and InDesign.
@@ -330,7 +331,7 @@ const server = http.createServer((req, res) => {
}).listen(process.env.PORT || 7262);
```
-The [`server` demo](/docs/demos/server) has more advanced examples.
+The [`server` demo](/docs/demos/net/server) includes more advanced examples.
@@ -434,7 +435,8 @@ req.onload = function(e) {
req.send();
```
-The [`xhr` demo](/docs/demos/network) includes a longer discussion and more examples.
+The [HTTP Downloads demo](/docs/demos/net/network) includes examples using
+browser APIs and wrapper libraries.
https://oss.sheetjs.com/sheetjs/ajax.html shows fallback approaches for IE6+.
@@ -727,7 +729,7 @@ var worksheet = XLSX.utils.aoa_to_sheet([
]);
```
-["Array of Arrays Input"](/docs/api/utilities#array-of-arrays-input) describes
+["Array of Arrays Input"](/docs/api/utilities/array#array-of-arrays-input) describes
the function and the optional `opts` argument in more detail.
@@ -742,7 +744,7 @@ generating a worksheet object. By default, it will generate a header row and
one row per object in the array. The optional `opts` argument has settings to
control the column order and header output.
-["Array of Objects Input"](/docs/api/utilities#array-of-objects-input) describes
+["Array of Objects Input"](/docs/api/utilities/array#array-of-objects-input) describes
the function and the optional `opts` argument in more detail.
#### Examples
@@ -798,7 +800,7 @@ is missing or no options are specified, the default name `Sheet1` is used.
#### Examples
-The [Headless Demo](/docs/demos/headless) includes examples of
+The [Headless Demo](/docs/demos/net/headless) includes examples of
server-side spreadsheet generation from HTML TABLE elements using headless
Chromium ("Puppeteer") and other browsers ("Playwright")
@@ -856,8 +858,8 @@ var workbook = XLSX.read(htmlstr, {type:"string"});
Chrome/Chromium Extension (click to show)
-The [`chrome` demo](/docs/demos/chromium/) shows a complete example and details
-the required permissions and other settings.
+The ["Chrome and Chromium" demo](/docs/demos/extensions/chromium/) includes a
+complete example and enumerates the required permissions and other settings.
In an extension, it is recommended to generate the workbook in a content script
and pass the object back to the extension:
diff --git a/docz/docs/06-solutions/03-processing.md b/docz/docs/06-solutions/03-processing.md
index 02cffcd..9f13906 100644
--- a/docz/docs/06-solutions/03-processing.md
+++ b/docz/docs/06-solutions/03-processing.md
@@ -155,7 +155,7 @@ XLSX.utils.sheet_add_aoa(worksheet, [
], { origin: "B3" });
```
-["Array of Arrays Input"](/docs/api/utilities#array-of-arrays-input) describes the
+["Array of Arrays Input"](/docs/api/utilities/array#array-of-arrays-input) describes the
function and the optional `opts` argument in more detail.
#### Examples
diff --git a/docz/docs/06-solutions/05-output.md b/docz/docs/06-solutions/05-output.md
index 70f527c..b30ac94 100644
--- a/docz/docs/06-solutions/05-output.md
+++ b/docz/docs/06-solutions/05-output.md
@@ -237,13 +237,13 @@ var XLSX = require("xlsx");
XLSX.writeFile(workbook, "out.xlsb");
```
-Electron APIs have changed over time. The [`electron` demo](/docs/demos/desktop#electron)
+Electron APIs have changed over time. The [`electron` demo](/docs/demos/desktop/electron)
shows a complete example and details the required version-specific settings.
-[The React Native Demo](/docs/demos/mobile#rn-file-plugins) covers tested plugins.
+[The React Native Demo](/docs/demos/mobile/reactnative#rn-file-plugins) covers tested plugins.
@@ -260,12 +260,13 @@ var thisFile = File.saveDialog("Select an output file", "*.xlsx;*.xls");
XLSX.writeFile(workbook, thisFile.absoluteURI);
```
-The [`extendscript` demo](/docs/demos/extendscript) includes a more complex example.
+The [`extendscript` demo](/docs/demos/extensions/extendscript) includes complete
+examples for Photoshop and InDesign.
-The [`headless` demo](/docs/demos/headless) includes complete
+The [`headless` demo](/docs/demos/net/headless) includes complete
examples of converting HTML TABLE elements to XLSB workbooks using Puppeteer
and other headless automation tools.
@@ -502,8 +503,8 @@ is to adjust the server process or Lambda function to accept Base64 strings.
:::
-A complete example using XHR is [included in the XHR demo](/docs/demos/network),
-along with examples for fetch and wrapper libraries.
+The [HTTP Uploads demo](/docs/demos/net/upload) includes examples using browser
+APIs and wrapper libraries.
Under normal circumstances, a `Blob` can be generated from the `array` output:
@@ -592,7 +593,8 @@ var aoa = XLSX.utils.sheet_to_json(worksheet, {...opts, header: 1});
The `sheet_to_json` utility function walks a workbook in row-major order,
generating an array of objects. The second `opts` argument controls a number of
export decisions including the type of values (JS values or formatted text). The
-["JSON"](/docs/api/utilities#json) section describes the argument in more detail.
+["Array Output"](/docs/api/utilities/array#array-output) section describes
+supported options.
By default, `sheet_to_json` scans the first row and uses the values as headers.
With the `header: 1` option, the function exports an array of arrays of values.
@@ -845,4 +847,4 @@ Readable Stream.
- `XLSX.stream.to_html` is the streaming version of `XLSX.utils.sheet_to_html`.
- `XLSX.stream.to_json` is the streaming version of `XLSX.utils.sheet_to_json`.
-Examples are included in ["Large Datasets"](/docs/demos/stream#streaming-write)
+Examples are included in ["Large Datasets"](/docs/demos/bigdata/stream#streaming-write)
diff --git a/docz/docs/07-csf/07-features/08-rowprops.md b/docz/docs/07-csf/07-features/08-rowprops.md
index 839a41b..34da7cd 100644
--- a/docz/docs/07-csf/07-features/08-rowprops.md
+++ b/docz/docs/07-csf/07-features/08-rowprops.md
@@ -44,10 +44,9 @@ expected to be an array of row metadata objects.
This example creates a workbook that includes custom row heights, hidden rows,
and row outline levels.
-
- Excel for Windows
- Excel for Mac
-
+
+ Excel for Windows Excel for Mac
+
![Excel for Windows](pathname:///rowprops/win.png)
diff --git a/docz/docs/08-api/07-utilities/01-array.md b/docz/docs/08-api/07-utilities/01-array.md
index 4b05218..6a0cff3 100644
--- a/docz/docs/08-api/07-utilities/01-array.md
+++ b/docz/docs/08-api/07-utilities/01-array.md
@@ -27,11 +27,13 @@ The ["Functions"](#functions) section describes the related functions.
The spiritual equivalent of the grid in JavaScript is an array of arrays:
-Spreadsheet Array of Arrays
+
+ Spreadsheet Array of Arrays
+
![`pres.xlsx` data](pathname:///pres.png)
-
+
```js
[
@@ -44,7 +46,8 @@ The spiritual equivalent of the grid in JavaScript is an array of arrays:
]
```
-
+
+
Each array within the structure corresponds to one row. Individual data points
can be read by indexing by row index and by column index:
@@ -67,11 +70,13 @@ var value_at_A2 = aoa[1][0]; // Bill Clinton
Arrays of objects are commonly used to represent rows from a database:
-Spreadsheet Array of Objects
+
+ Spreadsheet Array of Objects
+
![`pres.xlsx` data](pathname:///pres.png)
-
+
```js
[
@@ -83,7 +88,8 @@ Arrays of objects are commonly used to represent rows from a database:
]
```
-
+
+
Each object within the structure corresponds to one data row. The first row of
the spreadsheet is interpreted as the header row.
@@ -141,7 +147,7 @@ The function takes an options argument:
|`sheetStubs` | false | Create cell objects of type `z` for `null` values |
|`nullError` | false | If true, emit `#NULL!` error cells for `null` values |
|`UTC` | false | If true, dates are interpreted using UTC methods ** |
-|`dense` | false | Emit [dense sheet object](docs/csf/sheet#dense-mode) |
+|`dense` | false | Emit [dense sheets](/docs/csf/sheet#dense-mode) |
[UTC option is explained in "Dates"](/docs/csf/features/dates#utc-option)
@@ -202,7 +208,9 @@ accepts an options argument:
The [example worksheet](#example-sheet) can be built up in the following order:
-Spreadsheet Operations
+
+ Spreadsheet Operations
+
S h e e t J S
@@ -288,7 +296,7 @@ default column order is determined by the first appearance of the field using
|`skipHeader` | false | If true, do not include header row in output |
|`nullError` | false | If true, emit `#NULL!` error cells for `null` values |
|`UTC` | false | If true, dates are interpreted using UTC methods ** |
-|`dense` | false | Emit [dense sheet object](docs/csf/sheet#dense-mode) |
+|`dense` | false | Emit [dense sheets](/docs/csf/sheet#dense-mode) |
[UTC option is explained in "Dates"](/docs/csf/features/dates#utc-option)
diff --git a/docz/docs/08-api/07-utilities/03-html.md b/docz/docs/08-api/07-utilities/03-html.md
index f969617..a77ae08 100644
--- a/docz/docs/08-api/07-utilities/03-html.md
+++ b/docz/docs/08-api/07-utilities/03-html.md
@@ -65,7 +65,7 @@ The generated table will include special data attributes on each `TD` element:
| Attribute | Description |
|:----------|:-------------------------------------------------------------|
-| `data-t` | Override [Cell Type](/docs/csf/cell#data-types) |
+| `data-t` | Override [Cell Type](/docs/csf/cell#cell-types) |
| `data-v` | Override Cell Value |
| `data-z` | Override [Number Format](/docs/csf/features/nf) |
diff --git a/docz/docs/09-miscellany/02-errors.md b/docz/docs/09-miscellany/02-errors.md
index 270baba..65e04f7 100644
--- a/docz/docs/09-miscellany/02-errors.md
+++ b/docz/docs/09-miscellany/02-errors.md
@@ -332,7 +332,7 @@ The `fs` module is automatically loaded in scripts using `require`:
var XLSX = require("xlsx"); // automatically loads `fs`
```
-Using the [ESM import](/docs/getting-started/installation/nodejs/#esm-import),
+Using the [ESM import](/docs/getting-started/installation/nodejs#esm-import),
the `fs` module must be imported and passed to the library:
```js
diff --git a/docz/docusaurus.config.js b/docz/docusaurus.config.js
index 1e56632..c25bd57 100644
--- a/docz/docusaurus.config.js
+++ b/docz/docusaurus.config.js
@@ -1,15 +1,19 @@
+import {themes as prismThemes} from 'prism-react-renderer';
+const math = require('remark-math');
+const katex = require('rehype-katex');
+
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
/** @typedef { import('prism-react-renderer').PrismTheme['styles'] } PrismThemeStyle */
/** @typedef { import('prism-react-renderer').PrismTheme['styles'][number]['style'] } PrismThemeEntry */
-/**
+/**
Updates styles array from prisma theme based off token type
- @type {(theme: PrismThemeStyle, replace: Record) => PrismThemeStyle}
+ @type {(theme: PrismThemeStyle, replace: Record) => PrismThemeStyle}
*/
const updateThemeStyles = (styles, replace) => {
- const copy = structuredClone(styles)
+ const copy = structuredClone(styles);
const types = Object.keys(replace)
copy.forEach(style => {
@@ -23,11 +27,8 @@ const updateThemeStyles = (styles, replace) => {
return copy
}
-const lightCodeTheme = require('prism-react-renderer/themes/github');
-const darkCodeTheme = require('prism-react-renderer/themes/dracula');
-
-const math = require('remark-math');
-const katex = require('rehype-katex');
+const lightCodeTheme = prismThemes.github;
+const darkCodeTheme = prismThemes.dracula;
/** @type {import('@docusaurus/types').Config} */
const config = {
diff --git a/docz/package.json b/docz/package.json
index 337e25d..137ab4a 100644
--- a/docz/package.json
+++ b/docz/package.json
@@ -13,25 +13,30 @@
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
+ "overrides": {
+ "@cmfcmf/docusaurus-search-local": {
+ "@docusaurus/core": "3.2.1"
+ }
+ },
"dependencies": {
- "@cmfcmf/docusaurus-search-local": "0.11.0",
- "@docusaurus/core": "2.4.1",
- "@docusaurus/plugin-client-redirects": "2.4.1",
- "@docusaurus/preset-classic": "2.4.1",
- "@docusaurus/theme-common": "2.4.1",
- "@docusaurus/theme-live-codeblock": "2.4.1",
- "@docusaurus/theme-mermaid": "2.4.1",
- "@mdx-js/react": "1.6.22",
- "clsx": "1.2.1",
- "prism-react-renderer": "1.3.5",
- "react": "17.0.2",
- "react-dom": "17.0.2",
- "rehype-katex": "4.0.0",
- "remark-math": "3.0.1",
+ "@cmfcmf/docusaurus-search-local": "1.1.0",
+ "@docusaurus/core": "3.2.1",
+ "@docusaurus/plugin-client-redirects": "3.2.1",
+ "@docusaurus/preset-classic": "3.2.1",
+ "@docusaurus/theme-common": "3.2.1",
+ "@docusaurus/theme-live-codeblock": "3.2.1",
+ "@docusaurus/theme-mermaid": "3.2.1",
+ "@mdx-js/react": "3.0.1",
+ "clsx": "2.1.0",
+ "prism-react-renderer": "2.3.1",
+ "react": "18.2.0",
+ "react-dom": "18.2.0",
+ "rehype-katex": "7.0.0",
+ "remark-math": "6.0.0",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
},
"devDependencies": {
- "@docusaurus/module-type-aliases": "2.4.1"
+ "@docusaurus/module-type-aliases": "3.2.1"
},
"browserslist": {
"production": [
diff --git a/docz/src/theme/Admonition/Layout/index.js b/docz/src/theme/Admonition/Layout/index.js
new file mode 100644
index 0000000..64c6e96
--- /dev/null
+++ b/docz/src/theme/Admonition/Layout/index.js
@@ -0,0 +1,39 @@
+import React from 'react';
+import clsx from 'clsx';
+import {ThemeClassNames} from '@docusaurus/theme-common';
+import styles from './styles.module.css';
+function AdmonitionContainer({type, className, children}) {
+ return (
+
+ {children}
+
+ );
+}
+function AdmonitionHeading({icon, title}) {
+ return (
+
+ {icon}
+ {title}
+
+ );
+}
+function AdmonitionContent({children}) {
+ return children ? (
+ {children}
+ ) : null;
+}
+export default function AdmonitionLayout(props) {
+ const {type, icon, title, children, className} = props;
+ return (
+
+ {title != "pass" && }
+ {children}
+
+ );
+}
diff --git a/docz/src/theme/Admonition/styles.module.css b/docz/src/theme/Admonition/Layout/styles.module.css
similarity index 83%
rename from docz/src/theme/Admonition/styles.module.css
rename to docz/src/theme/Admonition/Layout/styles.module.css
index 634c9dc..88df7e6 100644
--- a/docz/src/theme/Admonition/styles.module.css
+++ b/docz/src/theme/Admonition/Layout/styles.module.css
@@ -6,6 +6,10 @@
font: var(--ifm-heading-font-weight) var(--ifm-h5-font-size) /
var(--ifm-heading-line-height) var(--ifm-heading-font-family);
text-transform: uppercase;
+}
+
+/* Heading alone without content (does not handle fragment content) */
+.admonitionHeading:not(:last-child) {
margin-bottom: 0.3rem;
}
diff --git a/docz/src/theme/Admonition/index.js b/docz/src/theme/Admonition/index.js
index 02f1093..a6ecab7 100644
--- a/docz/src/theme/Admonition/index.js
+++ b/docz/src/theme/Admonition/index.js
@@ -1,180 +1,18 @@
import React from 'react';
-import clsx from 'clsx';
-import {ThemeClassNames} from '@docusaurus/theme-common';
-import Translate from '@docusaurus/Translate';
-import styles from './styles.module.css';
-function NoteIcon() {
- return (
-
-
-
- );
-}
-function TipIcon() {
- return (
-
-
-
- );
-}
-function DangerIcon() {
- return (
-
-
-
- );
-}
-function InfoIcon() {
- return (
-
-
-
- );
-}
-function CautionIcon() {
- return (
-
-
-
- );
-}
-// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
-const AdmonitionConfigs = {
- note: {
- infimaClassName: 'secondary',
- iconComponent: NoteIcon,
- label: (
-
- note
-
- ),
- },
- tip: {
- infimaClassName: 'success',
- iconComponent: TipIcon,
- label: (
-
- tip
-
- ),
- },
- danger: {
- infimaClassName: 'danger',
- iconComponent: DangerIcon,
- label: (
-
- danger
-
- ),
- },
- info: {
- infimaClassName: 'info',
- iconComponent: InfoIcon,
- label: (
-
- info
-
- ),
- },
- caution: {
- infimaClassName: 'warning',
- iconComponent: CautionIcon,
- label: (
-
- caution
-
- ),
- },
-};
-// Legacy aliases, undocumented but kept for retro-compatibility
-const aliases = {
- secondary: 'note',
- important: 'info',
- success: 'tip',
- warning: 'danger',
-};
-function getAdmonitionConfig(unsafeType) {
- const type = aliases[unsafeType] ?? unsafeType;
- const config = AdmonitionConfigs[type];
- if (config) {
- return config;
+import {processAdmonitionProps} from '@docusaurus/theme-common';
+import AdmonitionTypes from '@theme/Admonition/Types';
+function getAdmonitionTypeComponent(type) {
+ const component = AdmonitionTypes[type];
+ if (component) {
+ return component;
}
console.warn(
- `No admonition config found for admonition type "${type}". Using Info as fallback.`,
+ `No admonition component found for admonition type "${type}". Using Info as fallback.`,
);
- return AdmonitionConfigs.info;
+ return AdmonitionTypes.info;
}
-// Workaround because it's difficult in MDX v1 to provide a MDX title as props
-// See https://github.com/facebook/docusaurus/pull/7152#issuecomment-1145779682
-function extractMDXAdmonitionTitle(children) {
- const items = React.Children.toArray(children);
- const mdxAdmonitionTitle = items.find(
- (item) =>
- React.isValidElement(item) &&
- item.props?.mdxType === 'mdxAdmonitionTitle',
- );
- const rest = <>{items.filter((item) => item !== mdxAdmonitionTitle)}>;
- return {
- mdxAdmonitionTitle,
- rest,
- };
+export default function Admonition(unprocessedProps) {
+ const props = processAdmonitionProps(unprocessedProps);
+ const AdmonitionTypeComponent = getAdmonitionTypeComponent(props.type);
+ return ;
}
-function processAdmonitionProps(props) {
- const {mdxAdmonitionTitle, rest} = extractMDXAdmonitionTitle(props.children);
- return {
- ...props,
- title: props.title ?? mdxAdmonitionTitle,
- children: rest,
- };
-}
-export default function Admonition(props) {
- const {children, type, title, icon: iconProp} = processAdmonitionProps(props);
- const typeConfig = getAdmonitionConfig(type);
- const titleLabel = title ?? typeConfig.label;
- const {iconComponent: IconComponent} = typeConfig;
- const icon = iconProp ?? ;
- return (
-
- {titleLabel == "pass" ? void 0 : (
-
- {icon}
- {titleLabel}
-
- )}
-
{children}
-
- );
-}
-/* See docusaurus issue 8568 -- this was swizzled against 2.4.1 */
\ No newline at end of file
diff --git a/docz/src/theme/prism-include-languages.js b/docz/src/theme/prism-include-languages.js
index 12e76c8..d695464 100644
--- a/docz/src/theme/prism-include-languages.js
+++ b/docz/src/theme/prism-include-languages.js
@@ -4,22 +4,26 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
- import siteConfig from '@generated/docusaurus.config';
- export default function prismIncludeLanguages(PrismObject) {
- const {
- themeConfig: {prism},
- } = siteConfig;
- const {additionalLanguages} = prism;
- // Prism components work on the Prism instance on the window, while prism-
- // react-renderer uses its own Prism instance. We temporarily mount the
- // instance onto window, import components to enhance it, then remove it to
- // avoid polluting global namespace.
- // You can mutate PrismObject: registering plugins, deleting languages... As
- // long as you don't re-assign it
- globalThis.Prism = PrismObject;
- additionalLanguages.forEach((lang) => {
- // eslint-disable-next-line global-require, import/no-dynamic-require
- require(`prismjs/components/prism-${lang}`);
- });
- //delete globalThis.Prism; // <-- If this line is not commented, `liquid` will fail.
+import siteConfig from '@generated/docusaurus.config';
+export default function prismIncludeLanguages(PrismObject) {
+ const {
+ themeConfig: {prism},
+ } = siteConfig;
+ const {additionalLanguages} = prism;
+ // Prism components work on the Prism instance on the window, while prism-
+ // react-renderer uses its own Prism instance. We temporarily mount the
+ // instance onto window, import components to enhance it, then remove it to
+ // avoid polluting global namespace.
+ // You can mutate PrismObject: registering plugins, deleting languages... As
+ // long as you don't re-assign it
+ globalThis.Prism = PrismObject;
+ additionalLanguages.forEach((lang) => {
+ if (lang === 'php') {
+ // eslint-disable-next-line global-require
+ require('prismjs/components/prism-markup-templating.js');
+ }
+ // eslint-disable-next-line global-require, import/no-dynamic-require
+ require(`prismjs/components/prism-${lang}`);
+ });
+ //delete globalThis.Prism; // <-- If this line is not commented, `liquid` will fail.
}