From 36731f409bfb2a78a30bc656a9ee918518feb998 Mon Sep 17 00:00:00 2001 From: Kuba Sekowski Date: Fri, 3 Mar 2023 10:39:24 +0100 Subject: [PATCH 01/27] Fix '::: tip' frames in the documentation (#1173) --- docs/guide/custom-functions.md | 26 ++++++++++++++++---------- docs/guide/named-expressions.md | 2 -- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/docs/guide/custom-functions.md b/docs/guide/custom-functions.md index 00a2b4d70..1c7b9dd60 100644 --- a/docs/guide/custom-functions.md +++ b/docs/guide/custom-functions.md @@ -51,7 +51,8 @@ MyCustomPlugin.implementedFunctions = { }; ``` -::: tip To define multiple functions in a single function plugin, add them all +::: tip +To define multiple functions in a single function plugin, add them all to the `implementedFunctions` object. ```js @@ -64,7 +65,6 @@ MyCustomPlugin.implementedFunctions = { }, }; ``` - ::: ### 3. Add your function's names @@ -302,9 +302,11 @@ if (rangeData.some((row) => row.some((val) => typeof rawValue !== 'number'))) { } ``` -::: tip All HyperFormula [error types](types-of-errors.md) support optional +::: tip +All HyperFormula [error types](types-of-errors.md) support optional custom error messages. Put them to good use: let your users know what caused the -error and how to avoid it in the future. ::: +error and how to avoid it in the future. +::: ### Test your function @@ -476,8 +478,10 @@ function's behavior depends on the number of valid arguments passed), use the You can add translations of your function's name in multiple languages. Your end users use the translated names to call your function inside formulas. -::: tip If you support just one language, you still need to define the name of -your function in that language. ::: +::: tip +If you support just one language, you still need to define the name of +your function in that language. +::: In a separate object, define the translations of your custom functions' names in every language you want to support. Function names are case-insensitive, as they @@ -500,8 +504,10 @@ export const MyCustomPluginTranslations = { HyperFormula.registerFunctionPlugin(MyCustomPlugin, MyCustomPluginTranslations); ``` -::: tip Before using a translated function name, remember to -[register and set the language](localizing-functions.md). ::: +::: tip +Before using a translated function name, remember to +[register and set the language](localizing-functions.md). +::: ## Function aliases @@ -517,7 +523,8 @@ MyCustomPlugin.aliases = { }; ``` -::: tip For each alias of your function, define a translation, even if you want +::: tip +For each alias of your function, define a translation, even if you want to support only one language. ```js @@ -528,5 +535,4 @@ MyCustomPlugin.translations = { }, }; ``` - ::: diff --git a/docs/guide/named-expressions.md b/docs/guide/named-expressions.md index f560849e3..ff7d52df0 100644 --- a/docs/guide/named-expressions.md +++ b/docs/guide/named-expressions.md @@ -45,7 +45,6 @@ Expression names are case-insensitive, and they: - Must be unique within a given scope. ::: tip - Expression names must be unique within a given scope, but you can override a global named-expression with a local one. For example: @@ -56,7 +55,6 @@ hfInstance.addNamedExpression('MyRevenue', '=SUM(100+10)'); // but you can still use `MyRevenue` within the local scope of Sheet2 (sheetId = 1) hfInstance.addNamedExpression('MyRevenue', '=Sheet2!$A$1+100', 1); ``` - ::: For examples of valid and invalid expression names, see the following table: From bc23b9812c4bf22933b8125bb68a5ed9c91b4a5b Mon Sep 17 00:00:00 2001 From: Chris Thilgen Date: Thu, 9 Mar 2023 07:18:08 -0800 Subject: [PATCH 02/27] Fix typo in code snippet in the `advanced-usage` guide (#1182) * fix code sample error in advanaced-usage.md Co-authored-by: Kuba Sekowski --- docs/guide/advanced-usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/advanced-usage.md b/docs/guide/advanced-usage.md index aafbf39b5..5b58e3aef 100644 --- a/docs/guide/advanced-usage.md +++ b/docs/guide/advanced-usage.md @@ -96,7 +96,7 @@ After setting everything up, you can add formulas: // add a sheet named 'Formulas' const sheetNameC = hfInstance.addSheet('Formulas'); // get the new sheet ID for further API calls -const sheetIdC = hfInstance.getSheetId(sheetNameA); +const sheetIdC = hfInstance.getSheetId(sheetNameC); // add formulas to that sheet hfInstance.setSheetContent(sheetIdC, formulas); ``` From 62329fbaffdf5d25d844a7c27307c6a5baf5cbee Mon Sep 17 00:00:00 2001 From: Kuba Sekowski Date: Tue, 21 Mar 2023 16:27:24 +0100 Subject: [PATCH 03/27] Docs: Make built-in-functions page wider (#1175) Make built-in-functions page wider in the documentation --- docs/guide/built-in-functions.md | 13 +++++++++++++ docs/guide/list-of-differences.md | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/guide/built-in-functions.md b/docs/guide/built-in-functions.md index 66acc65f8..d30e0f49a 100644 --- a/docs/guide/built-in-functions.md +++ b/docs/guide/built-in-functions.md @@ -1,5 +1,18 @@ # Built-in functions + +
+ + ## Overview HyperFormula comes with an extensive library of pre-built functions. You can use diff --git a/docs/guide/list-of-differences.md b/docs/guide/list-of-differences.md index e08b5dae8..19b5b25ce 100644 --- a/docs/guide/list-of-differences.md +++ b/docs/guide/list-of-differences.md @@ -1,8 +1,8 @@ # List of differences with other spreadsheets -