From 8619550a2e15a21396e8d519f2581693a59c57f1 Mon Sep 17 00:00:00 2001 From: Aymeric Date: Wed, 8 Jan 2020 10:21:28 +0100 Subject: [PATCH] update documentation Explain how to require SharepointPlus without Babel, and also additional packages required when using on a node server --- docs/core.html | 2 +- docs/files.html | 2 +- docs/index.html | 57 ++++++++++++++++++++++--------- docs/lists.html | 2 +- docs/modals.html | 2 +- docs/node.html | 2 +- docs/people.html | 2 +- docs/utils.html | 2 +- jsdoc_template/tmpl/mainpage.tmpl | 55 +++++++++++++++++++++-------- 9 files changed, 88 insertions(+), 38 deletions(-) diff --git a/docs/core.html b/docs/core.html index dec3cdd..08e4740 100644 --- a/docs/core.html +++ b/docs/core.html @@ -94,7 +94,7 @@

Returns:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Mon, 30 Dec 2019 09:53:34 GMT
+
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
diff --git a/docs/files.html b/docs/files.html index 5d26ef9..f5c41be 100644 --- a/docs/files.html +++ b/docs/files.html @@ -298,7 +298,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Mon, 30 Dec 2019 09:53:34 GMT
+
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
diff --git a/docs/index.html b/docs/index.html index d983b4b..229db66 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,6 +170,18 @@
2) With Webpack / SPFx project
+

`require` only

+
+

If your project doesn't support import symbol, but only require, then you can still load SharepointPlus using esm:

+
+npm install esm
+
+

Then, to require SharepointPlus:

+
+const $SP = require("esm")(module)("sharepointplus").default;
+
+
+

Browser only

You can also just drop one file in your HTML document which will contain all the 70+ functions and all the polyfills to support the different browsers:

@@ -225,7 +237,8 @@

How it works

Because of the large compatibility and of the available features, using the Web Services it's still the right call for SharepointPlus.

Examples

-

Let's see some examples of what you can do with SharepointPlus:

+
+

Let's see some examples of what you can do with SharepointPlus:

 // Update all items with an "Amount" value bigger than 1000
 $SP().list('My List Name').update({
@@ -284,10 +297,12 @@ 

Examples

console.log(file.Url+" has been created") })
-

Each function is documented with examples.

+

Each function is documented with examples.

+
-

Try it out

-

You can test it right now. Just open your browser "Developer Tools" window on your SharePoint site somewhere, then run the following code snippet which will load the SharepointPlus script dynamically:

+

Try it out

+
+

You can test it right now. Just open your browser "Developer Tools" window on your SharePoint site somewhere, then run the following code snippet which will load the SharepointPlus script dynamically:

 // 1: Load SharepointPlus
 var script = document.createElement('script');
@@ -300,11 +315,18 @@ 

Try it out

$SP().whoami().then(function(people) { for (var i=0; i < people.length; i++) console.log(people[i]+" = "+people[people[i]]) })
-Example: -Example into the web developer console + Example: + Example into the web developer console +
-

Node Server Side Application

-

If you plan to run SharepointPlus on the server side using Node, you will need to provide your Sharepoint credentials (see this wiki to find the different authentication systems).

+

Node Server Side Application

+
+

If you plan to run SharepointPlus on the server side using Node, you will need to install two additional modules:

+
+npm install xmldom sp-request
+
+ +

You will also have to provide your Sharepoint credentials (see this wiki to find the different authentication systems).

 // the credentials depend of your authentication system
 // see: https://github.com/s-KaiNet/node-sp-auth
@@ -322,14 +344,17 @@ 

Node Server Side Application

// you can then use SharepointPlus normally // e.g.: sp.list("Hello", "http://my.sharepoint.site/").get(...);
+
-

Older Versions

-

The previous versions of SharepointPlus are available in the releases folder

-

The documentation for SharepointPlus v4.0 is available at https://sharepointplus4.netlify.com/
-

The documentation for SharepointPlus v5.2 is available at https://sharepointplus5.netlify.com/docs/ -

- -
+

Older Versions

+
+

The previous versions of SharepointPlus are available in the releases folder

+

The documentation for SharepointPlus v4.0 is available at https://sharepointplus4.netlify.com/
+

The documentation for SharepointPlus v5.2 is available at https://sharepointplus5.netlify.com/docs/ +

+

+
+ @@ -345,7 +370,7 @@

Older Versions

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Mon, 30 Dec 2019 09:53:34 GMT
+
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
diff --git a/docs/lists.html b/docs/lists.html index 5d4cc05..dae7967 100644 --- a/docs/lists.html +++ b/docs/lists.html @@ -1584,7 +1584,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Mon, 30 Dec 2019 09:53:34 GMT
+
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
diff --git a/docs/modals.html b/docs/modals.html index 40a0718..64a8599 100644 --- a/docs/modals.html +++ b/docs/modals.html @@ -380,7 +380,7 @@

Parameters:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Mon, 30 Dec 2019 09:53:34 GMT
+
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
diff --git a/docs/node.html b/docs/node.html index 0f52626..66f47e7 100644 --- a/docs/node.html +++ b/docs/node.html @@ -161,7 +161,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Mon, 30 Dec 2019 09:53:34 GMT
+
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
diff --git a/docs/people.html b/docs/people.html index f32fefc..eb45533 100644 --- a/docs/people.html +++ b/docs/people.html @@ -470,7 +470,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Mon, 30 Dec 2019 09:53:34 GMT
+
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
diff --git a/docs/utils.html b/docs/utils.html index 51ab461..dc941c5 100644 --- a/docs/utils.html +++ b/docs/utils.html @@ -840,7 +840,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Mon, 30 Dec 2019 09:53:34 GMT
+
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
diff --git a/jsdoc_template/tmpl/mainpage.tmpl b/jsdoc_template/tmpl/mainpage.tmpl index bc1cbb2..d17ec49 100644 --- a/jsdoc_template/tmpl/mainpage.tmpl +++ b/jsdoc_template/tmpl/mainpage.tmpl @@ -116,6 +116,18 @@ build.initialize(gulp); +

`require` only

+
+

If your project doesn't support import symbol, but only require, then you can still load SharepointPlus using esm:

+
+npm install esm
+
+

Then, to require SharepointPlus:

+
+const $SP = require("esm")(module)("sharepointplus").default;
+
+
+

Browser only

You can also just drop one file in your HTML document which will contain all the 70+ functions and all the polyfills to support the different browsers:

@@ -171,7 +183,8 @@ build.initialize(gulp);

Because of the large compatibility and of the available features, using the Web Services it's still the right call for SharepointPlus.

Examples

-

Let's see some examples of what you can do with SharepointPlus:

+
+

Let's see some examples of what you can do with SharepointPlus:

 // Update all items with an "Amount" value bigger than 1000
 $SP().list('My List Name').update({
@@ -230,10 +243,12 @@ $SP().list("Documents").createFile({
   console.log(file.Url+" has been created")
 })
 
-

Each function is documented with examples.

+

Each function is documented with examples.

+
-

Try it out

-

You can test it right now. Just open your browser "Developer Tools" window on your SharePoint site somewhere, then run the following code snippet which will load the SharepointPlus script dynamically:

+

Try it out

+
+

You can test it right now. Just open your browser "Developer Tools" window on your SharePoint site somewhere, then run the following code snippet which will load the SharepointPlus script dynamically:

 // 1: Load SharepointPlus
 var script = document.createElement('script');
@@ -246,11 +261,18 @@ $SP().list('List In the Current Site').get({fields:"ID", where:"ID > 0"}).then(f
 $SP().whoami().then(function(people) { for (var i=0; i < people.length; i++) console.log(people[i]+" = "+people[people[i]]) })
 
-Example: -Example into the web developer console + Example: + Example into the web developer console +
+ +

Node Server Side Application

+
+

If you plan to run SharepointPlus on the server side using Node, you will need to install two additional modules:

+
+npm install xmldom sp-request
+
-

Node Server Side Application

-

If you plan to run SharepointPlus on the server side using Node, you will need to provide your Sharepoint credentials (see this wiki to find the different authentication systems).

+

You will also have to provide your Sharepoint credentials (see this wiki to find the different authentication systems).

 // the credentials depend of your authentication system
 // see: https://github.com/s-KaiNet/node-sp-auth
@@ -268,13 +290,16 @@ const sp = $SP().proxy(proxyweb).auth(credentials);
 // you can then use SharepointPlus normally
 // e.g.: sp.list("Hello", "http://my.sharepoint.site/").get(...);
 
+
-

Older Versions

-

The previous versions of SharepointPlus are available in the releases folder

-

The documentation for SharepointPlus v4.0 is available at https://sharepointplus4.netlify.com/
-

The documentation for SharepointPlus v5.2 is available at https://sharepointplus5.netlify.com/docs/ -

- -
+

Older Versions

+
+

The previous versions of SharepointPlus are available in the releases folder

+

The documentation for SharepointPlus v4.0 is available at https://sharepointplus4.netlify.com/
+

The documentation for SharepointPlus v5.2 is available at https://sharepointplus5.netlify.com/docs/ +

+

+
+