UPDATE: Add placeholders for all functions
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
48afb45eb9
commit
8243e231ab
7
xlsx/src/bin/functions/cube.csv
Normal file
7
xlsx/src/bin/functions/cube.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
CUBEKPIMEMBER
|
||||
CUBEMEMBER
|
||||
CUBEMEMBERPROPERTY
|
||||
CUBERANKEDMEMBER
|
||||
CUBESET
|
||||
CUBESETCOUNT
|
||||
CUBEVALUE
|
||||
|
12
xlsx/src/bin/functions/database.csv
Normal file
12
xlsx/src/bin/functions/database.csv
Normal file
@@ -0,0 +1,12 @@
|
||||
DAVERAGE
|
||||
DCOUNT
|
||||
DCOUNTA
|
||||
DGET
|
||||
DMAX
|
||||
DMIN
|
||||
DPRODUCT
|
||||
DSTDEV
|
||||
DSTDEVP
|
||||
DSUM
|
||||
DVAR
|
||||
DVARP
|
||||
|
25
xlsx/src/bin/functions/date_and_time.csv
Normal file
25
xlsx/src/bin/functions/date_and_time.csv
Normal file
@@ -0,0 +1,25 @@
|
||||
DATE
|
||||
DATEDIF
|
||||
DATEVALUE
|
||||
DAY
|
||||
DAYS
|
||||
DAYS360
|
||||
EDATE
|
||||
EOMONTH
|
||||
HOUR
|
||||
ISOWEEKNUM
|
||||
MINUTE
|
||||
MONTH
|
||||
NETWORKDAYS
|
||||
NETWORKDAYS.INTL
|
||||
NOW
|
||||
SECOND
|
||||
TIME
|
||||
TIMEVALUE
|
||||
TODAY
|
||||
WEEKDAY
|
||||
WEEKNUM
|
||||
WORKDAY
|
||||
WORKDAY.INTL
|
||||
YEAR
|
||||
YEARFRAC
|
||||
|
54
xlsx/src/bin/functions/engineering.csv
Normal file
54
xlsx/src/bin/functions/engineering.csv
Normal file
@@ -0,0 +1,54 @@
|
||||
BESSELI
|
||||
BESSELJ
|
||||
BESSELK
|
||||
BESSELY
|
||||
BIN2DEC
|
||||
BIN2HEX
|
||||
BIN2OCT
|
||||
BITAND
|
||||
BITLSHIFT
|
||||
BITOR
|
||||
BITRSHIFT
|
||||
BITXOR
|
||||
COMPLEX
|
||||
CONVERT
|
||||
DEC2BIN
|
||||
DEC2HEX
|
||||
DEC2OCT
|
||||
DELTA
|
||||
ERF
|
||||
ERF.PRECISE
|
||||
ERFC
|
||||
ERFC.PRECISE
|
||||
GESTEP
|
||||
HEX2BIN
|
||||
HEX2DEC
|
||||
HEX2OCT
|
||||
IMABS
|
||||
IMAGINARY
|
||||
IMARGUMENT
|
||||
IMCONJUGATE
|
||||
IMCOS
|
||||
IMCOSH
|
||||
IMCOT
|
||||
IMCSC
|
||||
IMCSCH
|
||||
IMDIV
|
||||
IMEXP
|
||||
IMLN
|
||||
IMLOG10
|
||||
IMLOG2
|
||||
IMPOWER
|
||||
IMPRODUCT
|
||||
IMREAL
|
||||
IMSEC
|
||||
IMSECH
|
||||
IMSIN
|
||||
IMSINH
|
||||
IMSQRT
|
||||
IMSUB
|
||||
IMSUM
|
||||
IMTAN
|
||||
OCT2BIN
|
||||
OCT2DEC
|
||||
OCT2HEX
|
||||
|
55
xlsx/src/bin/functions/financial.csv
Normal file
55
xlsx/src/bin/functions/financial.csv
Normal file
@@ -0,0 +1,55 @@
|
||||
ACCRINT
|
||||
ACCRINTM
|
||||
AMORDEGRC
|
||||
AMORLINC
|
||||
COUPDAYBS
|
||||
COUPDAYS
|
||||
COUPDAYSNC
|
||||
COUPNCD
|
||||
COUPNUM
|
||||
COUPPCD
|
||||
CUMIPMT
|
||||
CUMPRINC
|
||||
DB
|
||||
DDB
|
||||
DISC
|
||||
DOLLARDE
|
||||
DOLLARFR
|
||||
DURATION
|
||||
EFFECT
|
||||
FV
|
||||
FVSCHEDULE
|
||||
INTRATE
|
||||
IPMT
|
||||
IRR
|
||||
ISPMT
|
||||
MDURATION
|
||||
MIRR
|
||||
NOMINAL
|
||||
NPER
|
||||
NPV
|
||||
ODDFPRICE
|
||||
ODDFYIELD
|
||||
ODDLPRICE
|
||||
ODDLYIELD
|
||||
PDURATION
|
||||
PMT
|
||||
PPMT
|
||||
PRICE
|
||||
PRICEDISC
|
||||
PRICEMAT
|
||||
PV
|
||||
RATE
|
||||
RECEIVED
|
||||
RRI
|
||||
SLN
|
||||
SYD
|
||||
TBILLEQ
|
||||
TBILLPRICE
|
||||
TBILLYIELD
|
||||
VDB
|
||||
XIRR
|
||||
XNPV
|
||||
YIELD
|
||||
YIELDDISC
|
||||
YIELDMAT
|
||||
|
21
xlsx/src/bin/functions/information.csv
Normal file
21
xlsx/src/bin/functions/information.csv
Normal file
@@ -0,0 +1,21 @@
|
||||
CELL
|
||||
ERROR.TYPE
|
||||
INFO
|
||||
ISBLANK
|
||||
ISERR
|
||||
ISERROR
|
||||
ISEVEN
|
||||
ISFORMULA
|
||||
ISLOGICAL
|
||||
ISNA
|
||||
ISNONTEXT
|
||||
ISNUMBER
|
||||
ISODD
|
||||
ISOMITTED
|
||||
ISREF
|
||||
ISTEXT
|
||||
N
|
||||
NA
|
||||
SHEET
|
||||
SHEETS
|
||||
TYPE
|
||||
|
19
xlsx/src/bin/functions/logical.csv
Normal file
19
xlsx/src/bin/functions/logical.csv
Normal file
@@ -0,0 +1,19 @@
|
||||
AND
|
||||
BYCOL
|
||||
BYROW
|
||||
FALSE
|
||||
IF
|
||||
IFERROR
|
||||
IFNA
|
||||
IFS
|
||||
LAMBDA
|
||||
LET
|
||||
MAKEARRAY
|
||||
MAP
|
||||
NOT
|
||||
OR
|
||||
REDUCE
|
||||
SCAN
|
||||
SWITCH
|
||||
TRUE
|
||||
XOR
|
||||
|
37
xlsx/src/bin/functions/lookup_and_reference.csv
Normal file
37
xlsx/src/bin/functions/lookup_and_reference.csv
Normal file
@@ -0,0 +1,37 @@
|
||||
ADDRESS
|
||||
AREAS
|
||||
CHOOSE
|
||||
CHOOSECOLS
|
||||
CHOOSEROWS
|
||||
COLUMN
|
||||
COLUMNS
|
||||
DROP
|
||||
EXPAND
|
||||
FILTER
|
||||
FORMULATEXT
|
||||
GETPIVOTDATA
|
||||
HLOOKUP
|
||||
HSTACK
|
||||
HYPERLINK
|
||||
IMAGE
|
||||
INDEX
|
||||
INDIRECT
|
||||
LOOKUP
|
||||
MATCH
|
||||
OFFSET
|
||||
ROW
|
||||
ROWS
|
||||
RTD
|
||||
SORT
|
||||
SORTBY
|
||||
TAKE
|
||||
TOCOL
|
||||
TOROW
|
||||
TRANSPOSE
|
||||
UNIQUE
|
||||
VLOOKUP
|
||||
VSTACK
|
||||
WRAPCOLS
|
||||
WRAPROWS
|
||||
XLOOKUP
|
||||
XMATCH
|
||||
|
82
xlsx/src/bin/functions/math_and_trigonometry.csv
Normal file
82
xlsx/src/bin/functions/math_and_trigonometry.csv
Normal file
@@ -0,0 +1,82 @@
|
||||
ABS
|
||||
ACOS
|
||||
ACOSH
|
||||
ACOT
|
||||
ACOTH
|
||||
AGGREGATE
|
||||
ARABIC
|
||||
ASIN
|
||||
ASINH
|
||||
ATAN
|
||||
ATAN2
|
||||
ATANH
|
||||
BASE
|
||||
CEILING
|
||||
CEILING.MATH
|
||||
CEILING.PRECISE
|
||||
COMBIN
|
||||
COMBINA
|
||||
COS
|
||||
COSH
|
||||
COT
|
||||
COTH
|
||||
CSC
|
||||
CSCH
|
||||
DECIMAL
|
||||
DEGREES
|
||||
EVEN
|
||||
EXP
|
||||
FACT
|
||||
FACTDOUBLE
|
||||
FLOOR
|
||||
FLOOR.MATH
|
||||
FLOOR.PRECISE
|
||||
GCD
|
||||
INT
|
||||
ISO.CEILING
|
||||
LCM
|
||||
LET
|
||||
LN
|
||||
LOG
|
||||
LOG10
|
||||
MDETERM
|
||||
MINVERSE
|
||||
MMULT
|
||||
MOD
|
||||
MROUND
|
||||
MULTINOMIAL
|
||||
MUNIT
|
||||
ODD
|
||||
PI
|
||||
POWER
|
||||
PRODUCT
|
||||
QUOTIENT
|
||||
RADIANS
|
||||
RAND
|
||||
RANDARRAY
|
||||
RANDBETWEEN
|
||||
ROMAN
|
||||
ROUND
|
||||
ROUNDDOWN
|
||||
ROUNDUP
|
||||
SEC
|
||||
SECH
|
||||
SERIESSUM
|
||||
SEQUENCE
|
||||
SIGN
|
||||
SIN
|
||||
SINH
|
||||
SQRT
|
||||
SQRTPI
|
||||
SUBTOTAL
|
||||
SUM
|
||||
SUMIF
|
||||
SUMIFS
|
||||
SUMPRODUCT
|
||||
SUMSQ
|
||||
SUMX2MY2
|
||||
SUMX2PY2
|
||||
SUMXMY2
|
||||
TAN
|
||||
TANH
|
||||
TRUNC
|
||||
|
111
xlsx/src/bin/functions/statistical.csv
Normal file
111
xlsx/src/bin/functions/statistical.csv
Normal file
@@ -0,0 +1,111 @@
|
||||
AVEDEV
|
||||
AVERAGE
|
||||
AVERAGEA
|
||||
AVERAGEIF
|
||||
AVERAGEIFS
|
||||
BETA.DIST
|
||||
BETA.INV
|
||||
BINOM.DIST
|
||||
BINOM.DIST.RANGE
|
||||
BINOM.INV
|
||||
CHISQ.DIST
|
||||
CHISQ.DIST.RT
|
||||
CHISQ.INV
|
||||
CHISQ.INV.RT
|
||||
CHISQ.TEST
|
||||
CONFIDENCE.NORM
|
||||
CONFIDENCE.T
|
||||
CORREL
|
||||
COUNT
|
||||
COUNTA
|
||||
COUNTBLANK
|
||||
COUNTIF
|
||||
COUNTIFS
|
||||
COVARIANCE.P
|
||||
COVARIANCE.S
|
||||
DEVSQ
|
||||
EXPON.DIST
|
||||
F.DIST
|
||||
F.DIST.RT
|
||||
F.INV
|
||||
F.INV.RT
|
||||
F.TEST
|
||||
FISHER
|
||||
FISHERINV
|
||||
FORECAST
|
||||
FORECAST.ETS
|
||||
FORECAST.ETS.CONFINT
|
||||
FORECAST.ETS.SEASONALITY
|
||||
FORECAST.ETS.STAT
|
||||
FORECAST.LINEAR
|
||||
FREQUENCY
|
||||
GAMMA
|
||||
GAMMA.DIST
|
||||
GAMMA.INV
|
||||
GAMMALN
|
||||
GAMMALN.PRECISE
|
||||
GAUSS
|
||||
GEOMEAN
|
||||
GROWTH
|
||||
HARMEAN
|
||||
HYPGEOM.DIST
|
||||
INTERCEPT
|
||||
KURT
|
||||
LARGE
|
||||
LINEST
|
||||
LOGEST
|
||||
LOGNORM.DIST
|
||||
LOGNORM.INV
|
||||
MAX
|
||||
MAXA
|
||||
MAXIFS
|
||||
MEDIAN
|
||||
MIN
|
||||
MINA
|
||||
MINIFS
|
||||
MODE.MULT
|
||||
MODE.SNGL
|
||||
NEGBINOM.DIST
|
||||
NORM.DIST
|
||||
NORM.INV
|
||||
NORM.S.DIST
|
||||
NORM.S.INV
|
||||
PEARSON
|
||||
PERCENTILE.EXC
|
||||
PERCENTILE.INC
|
||||
PERCENTRANK.EXC
|
||||
PERCENTRANK.INC
|
||||
PERMUT
|
||||
PERMUTATIONA
|
||||
PHI
|
||||
POISSON.DIST
|
||||
PROB
|
||||
QUARTILE.EXC
|
||||
QUARTILE.INC
|
||||
RANK.AVG
|
||||
RANK.EQ
|
||||
RSQ
|
||||
SKEW
|
||||
SKEW.P
|
||||
SLOPE
|
||||
SMALL
|
||||
STANDARDIZE
|
||||
STDEV.P
|
||||
STDEV.S
|
||||
STDEVA
|
||||
STDEVPA
|
||||
STEYX
|
||||
T.DIST
|
||||
T.DIST.2T
|
||||
T.DIST.RT
|
||||
T.INV
|
||||
T.INV.2T
|
||||
T.TEST
|
||||
TREND
|
||||
TRIMMEAN
|
||||
VAR.P
|
||||
VAR.S
|
||||
VARA
|
||||
VARPA
|
||||
WEIBULL.DIST
|
||||
Z.TEST
|
||||
|
25
xlsx/src/bin/functions/text.csv
Normal file
25
xlsx/src/bin/functions/text.csv
Normal file
@@ -0,0 +1,25 @@
|
||||
MID
|
||||
MIDB
|
||||
NUMBERVALUE
|
||||
PHONETIC
|
||||
PROPER
|
||||
REPLACE
|
||||
REPLACEBs
|
||||
REPT
|
||||
RIGHT
|
||||
RIGHTB
|
||||
SEARCH
|
||||
SEARCHB
|
||||
SUBSTITUTE
|
||||
T
|
||||
TEXT
|
||||
TEXTAFTER
|
||||
TEXTBEFORE
|
||||
TEXTJOIN
|
||||
TEXTSPLIT
|
||||
TRIM
|
||||
UNICHAR
|
||||
UNICODE
|
||||
UPPER
|
||||
VALUE
|
||||
VALUETOTEXT
|
||||
|
4
xlsx/src/bin/functions/uncatogorized.csv
Normal file
4
xlsx/src/bin/functions/uncatogorized.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
REGEXTEST
|
||||
REGEXEXTRACT
|
||||
REGEXREPLACE:
|
||||
TRIMRANGE
|
||||
|
134
xlsx/src/bin/generate_docs.rs
Normal file
134
xlsx/src/bin/generate_docs.rs
Normal file
@@ -0,0 +1,134 @@
|
||||
#![allow(clippy::panic)]
|
||||
#![allow(clippy::expect_used)]
|
||||
|
||||
//! Produces documentation of all the implemented IronCalc functions
|
||||
//! and saves the result to functions.md
|
||||
//!
|
||||
//! Usage: documentation
|
||||
|
||||
use std::fs;
|
||||
|
||||
use serde::Serialize;
|
||||
use std::io::{self, BufRead};
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct FunctionItem {
|
||||
text: String,
|
||||
link: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct CategoryItem {
|
||||
text: String,
|
||||
collapsed: bool,
|
||||
link: String,
|
||||
items: Vec<FunctionItem>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct Item {
|
||||
text: String,
|
||||
collapsed: bool,
|
||||
items: Vec<CategoryItem>,
|
||||
}
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
// Step 1: Create "docs" directory in the working directory
|
||||
let docs_dir = "docs";
|
||||
fs::create_dir_all(docs_dir)?;
|
||||
|
||||
// Step 2: Read files from the "functions" directory
|
||||
let functions_dir = "functions";
|
||||
|
||||
let mut category_items = Vec::new();
|
||||
|
||||
for entry in fs::read_dir(functions_dir)? {
|
||||
let entry = entry?;
|
||||
let path = entry.path();
|
||||
|
||||
// Only process files (skip directories)
|
||||
if path.is_file() {
|
||||
// Get the file name without extension
|
||||
if let Some(category) = path.file_stem().and_then(|s| s.to_str()) {
|
||||
// Create a directory in "docs" with the name of the file
|
||||
let target_dir = format!("{}/{}", docs_dir, category);
|
||||
fs::create_dir_all(&target_dir)?;
|
||||
|
||||
// Open the file and read lines
|
||||
let file = fs::File::open(&path)?;
|
||||
let reader = io::BufReader::new(file);
|
||||
|
||||
let mut file_items = Vec::new();
|
||||
|
||||
for line in reader.lines() {
|
||||
let line = line?;
|
||||
let function_name = line.trim().to_lowercase();
|
||||
let function_name_upper_case = function_name.to_uppercase();
|
||||
|
||||
if function_name.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Create a file with the name from the line, ending with .md
|
||||
let file_name = format!("{}/{}.md", target_dir, function_name);
|
||||
|
||||
// Write "Hello World" into the file
|
||||
fs::write(
|
||||
&file_name,
|
||||
format!(
|
||||
r#"
|
||||
---
|
||||
layout: doc
|
||||
outline: deep
|
||||
lang: en-US
|
||||
---
|
||||
|
||||
::: warning
|
||||
**Note:** This page is under construction 🚧
|
||||
:::
|
||||
|
||||
# {function_name_upper_case}
|
||||
|
||||
## Parameters
|
||||
|
||||
## Overview
|
||||
|
||||
## Examples
|
||||
|
||||
[See this example in IronCalc](https://app.ironcalc.com/?filename={function_name})
|
||||
|
||||
## Links
|
||||
|
||||
"#
|
||||
)
|
||||
.trim(),
|
||||
)?;
|
||||
|
||||
// Add the item to file_items
|
||||
let item = FunctionItem {
|
||||
text: function_name_upper_case,
|
||||
link: format!("/functions/{}/{}", category, function_name),
|
||||
};
|
||||
file_items.push(item);
|
||||
}
|
||||
category_items.push(CategoryItem {
|
||||
text: category.to_string(),
|
||||
collapsed: true,
|
||||
link: format!("/functions/{}", category),
|
||||
items: file_items,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let root_item = Item {
|
||||
text: "Functions".to_string(),
|
||||
collapsed: true,
|
||||
items: category_items,
|
||||
};
|
||||
|
||||
// Serialize root_item to JSON and write to functions.json
|
||||
let json_string = serde_json::to_string_pretty(&root_item)?;
|
||||
fs::write("functions.json", json_string)?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user