From 1e56be6ef9b423d195d613feee980a7da16f92e5 Mon Sep 17 00:00:00 2001 From: CF Mitrah Date: Fri, 3 Jan 2025 19:17:54 +0530 Subject: [PATCH] Added a examples for lucee docs --- docs/00.home/homepage.md | 4 +--- .../01.functions/evaluate/_examples.md | 11 ++++++++++- .../serialize/_arguments/object.md | 1 + .../query/addcolumn/_arguments/array.md | 1 + .../query/addcolumn/_arguments/column.md | 1 + .../addcolumn/_arguments/datatype_or_array.md | 1 + .../05.objects/query/tostruct/_examples.md | 18 ++++++++++++++++++ 7 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 docs/03.reference/05.objects/query/tostruct/_examples.md diff --git a/docs/00.home/homepage.md b/docs/00.home/homepage.md index f03f6160c..f5852e17e 100644 --- a/docs/00.home/homepage.md +++ b/docs/00.home/homepage.md @@ -12,9 +12,7 @@ Lucee is a [high performance](https://community.ortussolutions.com/t/how-does-cf The documentation here aims to provide a thorough reference and guide to all things to do with the Lucee Server. This includes reference material on both [[functions]] and [[tags]] as well as more in-depth articles in the [[guides]] section. -Our documentation is an open source and community driven effort. It is also a constant work in progress and we always welcome feedback, improvements and suggestions. You can find out more about contributing to the Documentation in the [[about]] section. - -To find out more about getting involved as a developer with Lucee, checkout our [Git Repo](https://github.com/lucee/Lucee/blob/6.0/CONTRIBUTING.md) +Our documentation is an open source and community driven effort. It is also a constant work in progress and we always welcome feedback, improvements and suggestions. You can find out more about contributing to ted as a developer with Lucee, checkout our [Git Repo](https://github.com/lucee/Lucee/blob/6.0/CONTRIBUTING.md) ## Lucee 6.2 diff --git a/docs/03.reference/01.functions/evaluate/_examples.md b/docs/03.reference/01.functions/evaluate/_examples.md index 8bd5a1748..3f224bf2c 100644 --- a/docs/03.reference/01.functions/evaluate/_examples.md +++ b/docs/03.reference/01.functions/evaluate/_examples.md @@ -1 +1,10 @@ -*There are currently no examples for this function.* +```luceescript +str1 = "Lucee"; +str2 = "Lucee"; +writeDump(evaluate("str1 eq str2")); +writeDump(evaluate("10 eq 12")); +writeDump(evaluate("10 neq 12")); +writeDump(evaluate("1 + 2 * 3")); +writeDump(evaluate("10 gt 12")); +writeDump(evaluate("13 gt 12")); +``` \ No newline at end of file diff --git a/docs/03.reference/01.functions/serialize/_arguments/object.md b/docs/03.reference/01.functions/serialize/_arguments/object.md index e69de29bb..019996557 100644 --- a/docs/03.reference/01.functions/serialize/_arguments/object.md +++ b/docs/03.reference/01.functions/serialize/_arguments/object.md @@ -0,0 +1 @@ +An object to be serialized. \ No newline at end of file diff --git a/docs/03.reference/05.objects/query/addcolumn/_arguments/array.md b/docs/03.reference/05.objects/query/addcolumn/_arguments/array.md index e69de29bb..3b5d18665 100644 --- a/docs/03.reference/05.objects/query/addcolumn/_arguments/array.md +++ b/docs/03.reference/05.objects/query/addcolumn/_arguments/array.md @@ -0,0 +1 @@ +Name of an array whose elements populate the new column. \ No newline at end of file diff --git a/docs/03.reference/05.objects/query/addcolumn/_arguments/column.md b/docs/03.reference/05.objects/query/addcolumn/_arguments/column.md index e69de29bb..d8990686b 100644 --- a/docs/03.reference/05.objects/query/addcolumn/_arguments/column.md +++ b/docs/03.reference/05.objects/query/addcolumn/_arguments/column.md @@ -0,0 +1 @@ +Name of the new column. \ No newline at end of file diff --git a/docs/03.reference/05.objects/query/addcolumn/_arguments/datatype_or_array.md b/docs/03.reference/05.objects/query/addcolumn/_arguments/datatype_or_array.md index e69de29bb..6699d36c2 100644 --- a/docs/03.reference/05.objects/query/addcolumn/_arguments/datatype_or_array.md +++ b/docs/03.reference/05.objects/query/addcolumn/_arguments/datatype_or_array.md @@ -0,0 +1 @@ +Column data type. \ No newline at end of file diff --git a/docs/03.reference/05.objects/query/tostruct/_examples.md b/docs/03.reference/05.objects/query/tostruct/_examples.md new file mode 100644 index 000000000..bd6559eac --- /dev/null +++ b/docs/03.reference/05.objects/query/tostruct/_examples.md @@ -0,0 +1,18 @@ +```luceescript+trycf +qry = query( + id: [ 1, 2, 3, 4 ], + name: [ "mssql", "mysql", "image", "pdf" ], + version: [ "7.2.2.jre8", "8.0.30", "1.0.0.42", "1.1.0.7" ] +); +basic = qry.ToStruct("name"); +dump( var=basic, label="basic (ordered)"); + +normal = qry.ToStruct( "version", "normal", false); +dump( var=normal, label="normal (unordered)"); + +row = qry.ToStruct( "version", "normal", true); +dump( var=row, label="valueRowNumber=true,unordered"); + +member = qry.ToStruct("id"); +dump(var=member, label="member"); +``` \ No newline at end of file