From 94ebf33656bbc85a4ef4f7089e54d067ae864251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Hatcher?= Date: Mon, 25 Nov 2024 18:02:14 +0100 Subject: [PATCH] UPDATE: Remove docs artifacts that are not needed anymore generate_docs.rs was used to bootstrap the documentatio effords Unlikely to be used on a regular basis --- .github/workflows/publish-wiki.yml | 18 -- Makefile | 9 - wiki/functions.md | 195 ------------------ xlsx/Cargo.toml | 10 - xlsx/src/bin/documentation.rs | 29 --- xlsx/src/bin/functions/cube.csv | 7 - xlsx/src/bin/functions/database.csv | 12 -- xlsx/src/bin/functions/date_and_time.csv | 25 --- xlsx/src/bin/functions/engineering.csv | 54 ----- xlsx/src/bin/functions/financial.csv | 55 ----- xlsx/src/bin/functions/information.csv | 21 -- xlsx/src/bin/functions/logical.csv | 19 -- .../bin/functions/lookup_and_reference.csv | 37 ---- .../bin/functions/math_and_trigonometry.csv | 82 -------- xlsx/src/bin/functions/statistical.csv | 111 ---------- xlsx/src/bin/functions/text.csv | 25 --- xlsx/src/bin/functions/uncatogorized.csv | 4 - xlsx/src/bin/generate_docs.rs | 154 -------------- 18 files changed, 867 deletions(-) delete mode 100644 .github/workflows/publish-wiki.yml delete mode 100644 wiki/functions.md delete mode 100644 xlsx/src/bin/documentation.rs delete mode 100644 xlsx/src/bin/functions/cube.csv delete mode 100644 xlsx/src/bin/functions/database.csv delete mode 100644 xlsx/src/bin/functions/date_and_time.csv delete mode 100644 xlsx/src/bin/functions/engineering.csv delete mode 100644 xlsx/src/bin/functions/financial.csv delete mode 100644 xlsx/src/bin/functions/information.csv delete mode 100644 xlsx/src/bin/functions/logical.csv delete mode 100644 xlsx/src/bin/functions/lookup_and_reference.csv delete mode 100644 xlsx/src/bin/functions/math_and_trigonometry.csv delete mode 100644 xlsx/src/bin/functions/statistical.csv delete mode 100644 xlsx/src/bin/functions/text.csv delete mode 100644 xlsx/src/bin/functions/uncatogorized.csv delete mode 100644 xlsx/src/bin/generate_docs.rs diff --git a/.github/workflows/publish-wiki.yml b/.github/workflows/publish-wiki.yml deleted file mode 100644 index c420529..0000000 --- a/.github/workflows/publish-wiki.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Publish wiki -on: - push: - branches: [main] - paths: - - wiki/** - - .github/workflows/publish-wiki.yml -concurrency: - group: publish-wiki - cancel-in-progress: true -permissions: - contents: write -jobs: - publish-wiki: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: Andrew-Chen-Wang/github-wiki-action@v4 \ No newline at end of file diff --git a/Makefile b/Makefile index be4c03d..571f6d9 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,6 @@ format: .PHONY: tests tests: lint - cargo test - ./target/debug/documentation - cmp functions.md wiki/functions.md || exit 1 make remove-artifacts # Regretabbly we need to build the wasm twice, once for the nodejs tests # and a second one for the vitest. @@ -25,7 +22,6 @@ remove-artifacts: rm -f xlsx/hello-calc.xlsx rm -f xlsx/hello-styles.xlsx rm -f xlsx/widths-and-heights.xlsx - rm -f functions.md .PHONY: clean clean: remove-artifacts @@ -43,11 +39,6 @@ coverage: CARGO_INCREMENTAL=0 RUSTFLAGS='-C instrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/html -.PHONY: update-docs -update-docs: - cargo build - ./target/debug/documentation -o wiki/functions.md - .PHONY: docs docs: cargo doc --no-deps diff --git a/wiki/functions.md b/wiki/functions.md deleted file mode 100644 index 98ac639..0000000 --- a/wiki/functions.md +++ /dev/null @@ -1,195 +0,0 @@ -# List of Functions implemented in IronCalc - -* AND -* FALSE -* IF -* IFERROR -* IFNA -* IFS -* NOT -* OR -* SWITCH -* TRUE -* XOR -* SIN -* COS -* TAN -* ASIN -* ACOS -* ATAN -* SINH -* COSH -* TANH -* ASINH -* ACOSH -* ATANH -* ABS -* PI -* SQRT -* SQRTPI -* ATAN2 -* POWER -* MAX -* MIN -* PRODUCT -* RAND -* RANDBETWEEN -* ROUND -* ROUNDDOWN -* ROUNDUP -* SUM -* SUMIF -* SUMIFS -* CHOOSE -* COLUMN -* COLUMNS -* INDEX -* INDIRECT -* HLOOKUP -* LOOKUP -* MATCH -* OFFSET -* ROW -* ROWS -* VLOOKUP -* XLOOKUP -* CONCATENATE -* EXACT -* VALUE -* T -* VALUETOTEXT -* CONCAT -* FIND -* LEFT -* LEN -* LOWER -* MID -* RIGHT -* SEARCH -* TEXT -* TRIM -* UNICODE -* UPPER -* ISNUMBER -* ISNONTEXT -* ISTEXT -* ISLOGICAL -* ISBLANK -* ISERR -* ISERROR -* ISNA -* NA -* ISREF -* ISODD -* ISEVEN -* ERROR.TYPE -* ISFORMULA -* TYPE -* SHEET -* AVERAGE -* AVERAGEA -* AVERAGEIF -* AVERAGEIFS -* COUNT -* COUNTA -* COUNTBLANK -* COUNTIF -* COUNTIFS -* MAXIFS -* MINIFS -* YEAR -* DAY -* MONTH -* EOMONTH -* DATE -* EDATE -* TODAY -* NOW -* PMT -* PV -* RATE -* NPER -* FV -* PPMT -* IPMT -* NPV -* MIRR -* IRR -* XIRR -* XNPV -* REPT -* TEXTAFTER -* TEXTBEFORE -* TEXTJOIN -* SUBSTITUTE -* ISPMT -* RRI -* SLN -* SYD -* NOMINAL -* EFFECT -* PDURATION -* TBILLYIELD -* TBILLPRICE -* TBILLEQ -* DOLLARDE -* DOLLARFR -* DDB -* DB -* CUMPRINC -* CUMIPMT -* BESSELI -* BESSELJ -* BESSELK -* BESSELY -* ERF -* ERF.PRECISE -* ERFC -* ERFC.PRECISE -* BIN2DEC -* BIN2HEX -* BIN2OCT -* DEC2BIN -* DEC2HEX -* DEC2OCT -* HEX2BIN -* HEX2DEC -* HEX2OCT -* OCT2BIN -* OCT2DEC -* OCT2HEX -* BITAND -* BITLSHIFT -* BITOR -* BITRSHIFT -* BITXOR -* COMPLEX -* 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 -* CONVERT -* DELTA -* GESTEP -* SUBTOTAL diff --git a/xlsx/Cargo.toml b/xlsx/Cargo.toml index 2885414..6c5f3f4 100644 --- a/xlsx/Cargo.toml +++ b/xlsx/Cargo.toml @@ -35,13 +35,3 @@ path = "src/lib.rs" [[bin]] name = "test" path = "src/bin/test.rs" - - -[[bin]] -name = "documentation" -path = "src/bin/documentation.rs" - - -[[bin]] -name = "generate_docs" -path = "src/bin/generate_docs.rs" \ No newline at end of file diff --git a/xlsx/src/bin/documentation.rs b/xlsx/src/bin/documentation.rs deleted file mode 100644 index 0ba4b7f..0000000 --- a/xlsx/src/bin/documentation.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![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 ironcalc_base::Model; - -fn main() { - let args: Vec<_> = std::env::args().collect(); - let output_file = if args.len() == 3 { - &args[2] - } else if args.len() == 1 { - "functions.md" - } else { - panic!("Usage: {} -o ", args[0]); - }; - let mut doc = Vec::new(); - doc.push("# List of Functions implemented in IronCalc\n\n".to_owned()); - for function in Model::documentation() { - doc.push(format!("* {}\n", &function.name)); - } - let data = doc.join(""); - fs::write(output_file, data).expect("Unable to write file"); -} diff --git a/xlsx/src/bin/functions/cube.csv b/xlsx/src/bin/functions/cube.csv deleted file mode 100644 index 3be1ec9..0000000 --- a/xlsx/src/bin/functions/cube.csv +++ /dev/null @@ -1,7 +0,0 @@ -CUBEKPIMEMBER -CUBEMEMBER -CUBEMEMBERPROPERTY -CUBERANKEDMEMBER -CUBESET -CUBESETCOUNT -CUBEVALUE \ No newline at end of file diff --git a/xlsx/src/bin/functions/database.csv b/xlsx/src/bin/functions/database.csv deleted file mode 100644 index a8486a1..0000000 --- a/xlsx/src/bin/functions/database.csv +++ /dev/null @@ -1,12 +0,0 @@ -DAVERAGE -DCOUNT -DCOUNTA -DGET -DMAX -DMIN -DPRODUCT -DSTDEV -DSTDEVP -DSUM -DVAR -DVARP \ No newline at end of file diff --git a/xlsx/src/bin/functions/date_and_time.csv b/xlsx/src/bin/functions/date_and_time.csv deleted file mode 100644 index 77eb61f..0000000 --- a/xlsx/src/bin/functions/date_and_time.csv +++ /dev/null @@ -1,25 +0,0 @@ -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 \ No newline at end of file diff --git a/xlsx/src/bin/functions/engineering.csv b/xlsx/src/bin/functions/engineering.csv deleted file mode 100644 index ad67caa..0000000 --- a/xlsx/src/bin/functions/engineering.csv +++ /dev/null @@ -1,54 +0,0 @@ -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 \ No newline at end of file diff --git a/xlsx/src/bin/functions/financial.csv b/xlsx/src/bin/functions/financial.csv deleted file mode 100644 index 78519c2..0000000 --- a/xlsx/src/bin/functions/financial.csv +++ /dev/null @@ -1,55 +0,0 @@ -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 diff --git a/xlsx/src/bin/functions/information.csv b/xlsx/src/bin/functions/information.csv deleted file mode 100644 index d19f0db..0000000 --- a/xlsx/src/bin/functions/information.csv +++ /dev/null @@ -1,21 +0,0 @@ -CELL -ERROR.TYPE -INFO -ISBLANK -ISERR -ISERROR -ISEVEN -ISFORMULA -ISLOGICAL -ISNA -ISNONTEXT -ISNUMBER -ISODD -ISOMITTED -ISREF -ISTEXT -N -NA -SHEET -SHEETS -TYPE \ No newline at end of file diff --git a/xlsx/src/bin/functions/logical.csv b/xlsx/src/bin/functions/logical.csv deleted file mode 100644 index 8a06d2b..0000000 --- a/xlsx/src/bin/functions/logical.csv +++ /dev/null @@ -1,19 +0,0 @@ -AND -BYCOL -BYROW -FALSE -IF -IFERROR -IFNA -IFS -LAMBDA -LET -MAKEARRAY -MAP -NOT -OR -REDUCE -SCAN -SWITCH -TRUE -XOR \ No newline at end of file diff --git a/xlsx/src/bin/functions/lookup_and_reference.csv b/xlsx/src/bin/functions/lookup_and_reference.csv deleted file mode 100644 index 9a2b955..0000000 --- a/xlsx/src/bin/functions/lookup_and_reference.csv +++ /dev/null @@ -1,37 +0,0 @@ -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 \ No newline at end of file diff --git a/xlsx/src/bin/functions/math_and_trigonometry.csv b/xlsx/src/bin/functions/math_and_trigonometry.csv deleted file mode 100644 index a08d8ce..0000000 --- a/xlsx/src/bin/functions/math_and_trigonometry.csv +++ /dev/null @@ -1,82 +0,0 @@ -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 \ No newline at end of file diff --git a/xlsx/src/bin/functions/statistical.csv b/xlsx/src/bin/functions/statistical.csv deleted file mode 100644 index ece2ad2..0000000 --- a/xlsx/src/bin/functions/statistical.csv +++ /dev/null @@ -1,111 +0,0 @@ -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 \ No newline at end of file diff --git a/xlsx/src/bin/functions/text.csv b/xlsx/src/bin/functions/text.csv deleted file mode 100644 index 7359b19..0000000 --- a/xlsx/src/bin/functions/text.csv +++ /dev/null @@ -1,25 +0,0 @@ -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 \ No newline at end of file diff --git a/xlsx/src/bin/functions/uncatogorized.csv b/xlsx/src/bin/functions/uncatogorized.csv deleted file mode 100644 index 2422d44..0000000 --- a/xlsx/src/bin/functions/uncatogorized.csv +++ /dev/null @@ -1,4 +0,0 @@ -REGEXTEST -REGEXEXTRACT -REGEXREPLACE -TRIMRANGE diff --git a/xlsx/src/bin/generate_docs.rs b/xlsx/src/bin/generate_docs.rs deleted file mode 100644 index bf80171..0000000 --- a/xlsx/src/bin/generate_docs.rs +++ /dev/null @@ -1,154 +0,0 @@ -#![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 ironcalc_base::Model; -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, -} - -#[derive(Serialize)] -struct Item { - text: String, - collapsed: bool, - items: Vec, -} - -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(); - - let mut implemented = Vec::new(); - for function in Model::documentation() { - implemented.push(function.name.clone()); - } - - 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); - - if implemented.contains(&function_name_upper_case) { - println!("Implemented: {function_name_upper_case}"); - fs::write( - &file_name, - format!( - r#" ---- -layout: doc -outline: deep -lang: en-US ---- - -# {function_name_upper_case} - -::: warning -🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb). -::: - - "# - ) - .trim(), - )?; - } else { - println!("Not implemented: {function_name_upper_case}"); - fs::write( - &file_name, - format!( - r#" ---- -layout: doc -outline: deep -lang: en-US ---- - -# {function_name_upper_case} - -::: warning -🚧 This function is not yet available in IronCalc. -[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions) -::: - "# - ) - .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(()) -}