diff --git a/docz/docs/02-getting-started/02-example.mdx b/docz/docs/02-getting-started/02-example.mdx index ff66e08..471c72b 100644 --- a/docz/docs/02-getting-started/02-example.mdx +++ b/docz/docs/02-getting-started/02-example.mdx @@ -13,7 +13,7 @@ The discussion focuses on the problem solving mindset. API details are covered in other parts of the documentation. The goal of this example is to generate a XLSX workbook of US President names -and birthdays. [Click here](#live-demo) to jump to the live demo +and birthdays. [Click here](#live-demo) to jump to the live demo. ## Acquire Data @@ -22,7 +22,14 @@ and birthdays. [Click here](#live-demo) to jump to the live demo [The raw data is available in JSON form](https://theunitedstates.io/congress-legislators/executive.json). For convenience, it has been [mirrored here](https://sheetjs.com/data/executive.json) -The data result is an Array of objects. This is the data for John Adams: +Acquiring the data is straightforward with `fetch`: + +```js +const url = "https://sheetjs.com/data/executive.json"; +const raw_data = await (await fetch(url)).json(); +``` + +The raw data is an Array of objects. This is the data for John Adams: ```js { @@ -165,6 +172,9 @@ XLSX.writeFile(workbook, "Presidents.xlsx", { compression: true }); ## Live Demo +This demo runs in the web browser! Click "Click to Generate File!" and the +browser should generate a XLSX file. + ```jsx live function Presidents() { return (