Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/docs-7' into staging/docs-7
Browse files Browse the repository at this point in the history
  • Loading branch information
FarzadHayat committed Apr 2, 2024
2 parents 8afbc2c + 5d14f4c commit 6bdbdc3
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 55 deletions.
19 changes: 17 additions & 2 deletions modules/ROOT/examples/live-demos/markdown/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,24 @@
<tr>
<td style="width: 50%;">
<textarea class="markdown">
<p>The Markdown Premium plugin detects pure markdown from a paste event within a TinyMCE editor instance.</p>
<h1>Markdown Premium Plugin</h1>
<p>The <strong>Markdown Premium Plugin</strong> enhances the functionality of the editor by allowing it to detect and convert pure markdown content on-paste.</p>
<h2><strong>Tips for Pasting Text</strong></h2>
<p>To paste text in plain form using keyboard shortcuts, use:</p>
<ul>
<li><strong>Windows:</strong> Ctrl+Shift+V</li>
<li><strong>Mac:</strong> Cmd+Shift+V</li>
</ul>
<h3>Paste Example</h3>
<p>Paste the following markdown into the editor using the above shortcuts:</p>
<p># H1</p>
<p>## H2</p>
<p>### H3</p>
<p>#### H4</p>
<p>##### H5</p>
<p>###### H6</p>
</textarea>
</td>
</tr>
</tbody>
</table>
</table>
7 changes: 6 additions & 1 deletion modules/ROOT/examples/live-demos/markdown/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
tinymce.init({
selector: 'textarea.markdown',
plugins: 'markdown',
plugins: [
"markdown", "advlist", "anchor", "autolink", "charmap", "code", "fullscreen",
"help", "image", "insertdatetime", "link", "lists", "media",
"preview", "searchreplace", "table", "visualblocks",
],
toolbar: "undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
height: 600,
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
});
4 changes: 2 additions & 2 deletions modules/ROOT/pages/bower-projects.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Installing TinyMCE with Bower
= Installing {productname} with Bower
:navtitle: Bower projects
:description: Learn how to install TinyMCE using Bower.
:description: Learn how to install {productname} using Bower.
:keywords: bower, javascript, install
:productSource: bower

Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/cloud-quick-start.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= Quick start
:navtitle: Quick start
:description_short: Setup a basic TinyMCE 6 editor using the Tiny Cloud.
:description: Get an instance of TinyMCE 6 up and running using the Tiny Cloud.
:description_short: Setup a basic {productname} {productmajorversion} editor using the {cloudname}.
:description: Get an instance of {productname} {productmajorversion} up and running using the {cloudname}.
:keywords: tinymce, script, textarea
:productSource: cloud

Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/dotnet-projects.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Installing TinyMCE for .NET
= Installing {productname} for .NET
:navtitle: .NET projects
:description: Learn how to install TinyMCE from NuGet.
:description: Learn how to install {productname} from NuGet.
:keywords: nuget .net install
:productSource: nuget

Expand Down
36 changes: 4 additions & 32 deletions modules/ROOT/pages/license-key.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,10 @@
If you are using {productname} in a self-hosted environment, a console log warning message will display if the license key config option is missing or invalid. This message aims to ensure compliance with licensing requirements and provide transparency during the evaluation period.
This message will not be shown when loading {productname} from the Tiny Cloud, as it is already under a commercial license.
This message will not be shown when loading {productname} from {cloudname}, as it is already under a commercial license.
====

== Setting the license

=== Use {productname} with the GPLv2+ license:

If the developer intends to self-host {productname} under the GPL license, they can set the `license_key` config option to 'gpl'. Case sensitivity does not matter.

==== Example

[source,js]
----
tinymce.init({
selector: 'textarea', // change this value according to your HTML
license_key: 'gpl'
});
----

=== Use {productname} with a commercial license:

If the developer intends to self-host {productname} under a commercial license, they must provide a valid license key. Customers who have purchased a self-hosted-eligible license for {productname} will find their license key in the account portal. To purchase a commercial license, see available options on the link:{pricingpage}/[pricing page].

==== Example

[source,js]
----
tinymce.init({
selector: 'textarea', // change this value according to your HTML
license_key: '<your-license-key>'
});
----
include::partial$misc/setting-the-license.adoc[]

== FAQ

Expand All @@ -52,7 +24,7 @@ The GPLv2+ license was chosen to provide the best compatibility with existing GP

=== What is the difference between a license key and the API key?

The **API key** is used when loading {productname} from the Tiny Cloud. The **license key** is used to declare the license terms when self-hosting {productname}.
The **API key** is used when loading {productname} from the {cloudname}. The **license key** is used to declare the license terms when self-hosting {productname}.

=== Who needs to get a license key?

Expand All @@ -64,7 +36,7 @@ If {productname} detects that the `license_key` configuration is missing or inva

=== Should I be using both an API key and a license key?

No, an API key and a license key should not be used simultaneously. The API key should only be used if {productname} is loaded from the Tiny Cloud. If {productname} is being self-hosted, the license key option should be used instead.
No, an API key and a license key should not be used simultaneously. The API key should only be used if {productname} is loaded from the {cloudname}. If {productname} is being self-hosted, the license key option should be used instead.

=== Will {productname} “phone home” to check the license key?

Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/npm-projects.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Installing TinyMCE from NPM
= Installing {productname} from NPM
:navtitle: NPM projects
:description: Learn how to install TinyMCE from NPM using npm and Yarn.
:description: Learn how to install {productname} from NPM using npm and Yarn.
:keywords: yarn, npm, javascript, install
:productSource: npm

Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/php-projects.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Installing TinyMCE with Composer
= Installing {productname} with Composer
:navtitle: PHP projects
:description: Learn how to install TinyMCE from Packagist using Composer.
:description: Learn how to install {productname} from Packagist using Composer.
:keywords: php, composer, packagist, install
:productSource: composer

Expand Down
6 changes: 3 additions & 3 deletions modules/ROOT/pages/zip-install.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Using TinyMCE from a .zip file
:navtitle: TinyMCE .zip deployments
:description: Learn how to use TinyMCE from a .zip archive.
= Using {productname} from a .zip file
:navtitle: {productname} .zip deployments
:description: Learn how to use {productname} from a .zip archive.
:keywords: zip, archive, unzip, install
:productSource: zip

Expand Down
50 changes: 43 additions & 7 deletions modules/ROOT/partials/install/basic-quickstart-base.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ifeval::["{productSource}" != "cloud"]
:scriptsource: /path/or/uri/to/tinymce.min.js
endif::[]

== Install TinyMCE using {sourcename}
== Install {productname} using {sourcename}

{productname} {productmajorversion} is a powerful and flexible rich text editor that can be embedded in web applications. This quick start covers how to add a {productname} editor to a web page using {sourcename}.

Expand Down Expand Up @@ -91,14 +91,14 @@ To add {productname} to a .NET project, run the following on a command line:
+
[source,sh]
----
Install-Package TinyMCE
Install-Package {productname}
----

* Using the `+dotnet+` CLI, run the following:
+
[source,sh]
----
dotnet add package TinyMCE
dotnet add package {productname}
----

Ensure the `+tinymce+` directory containing the `+tinymce.min.js+` file is accessible for the target page or application by either:
Expand All @@ -123,7 +123,7 @@ The location of the main {productname} script will be: `+/path/to/webserver/publ

endif::[]

== Include the TinyMCE script
== Include the {productname} script

Include the following line of code in the `+<head>+` of an HTML page.

Expand All @@ -132,14 +132,15 @@ Include the following line of code in the `+<head>+` of an HTML page.
<script src="{scriptsource}" referrerpolicy="origin"></script>
----

== Initialize TinyMCE as part of a web form
== Initialize {productname} as part of a web form

Initialize {productname} {productmajorversion} on any element (or elements) on the web page by passing an object containing a `+selector+` value to `+tinymce.init()+`. The `+selector+` value can be any valid https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors[CSS selector].

For example: To replace `+<textarea id="mytextarea">+` with a {productname} {productmajorversion} editor instance, pass the selector `+'#mytextarea'+` to `+tinymce.init()+`.

For example:

ifeval::["{productSource}" == "cloud"]
[source,html,subs="attributes+"]
----
<!DOCTYPE html>
Expand All @@ -164,12 +165,41 @@ For example:
</body>
</html>
----
endif::[]

ifeval::["{productSource}" != "cloud"]
[source,html,subs="attributes+"]
----
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{scriptsource}" referrerpolicy="origin"></script>
<script>
tinymce.init({
selector: '#mytextarea',
license_key: 'gpl|<your-license-key>'
});
</script>
</head>
<body>
<h1>{productname} Quick Start Guide</h1>
<form method="post">
<textarea id="mytextarea">Hello, World!</textarea>
</form>
</body>
</html>
----
endif::[]

Adding this content to an HTML file and opening it in a web browser will load a TinyMCE editor, such as:
Adding this content to an HTML file and opening it in a web browser will load a {productname} editor, such as:

liveDemo::default[]
ifeval::["{productSource}" == "cloud"]

ifeval::["{productSource}" == "cloud"]
== Add your API key

To remove the notice:
Expand All @@ -181,6 +211,12 @@ Replace `+no-api-key+` in the source script (`+<script src=...+`) with a {cloudn
Signing up for a {cloudname} API key will also provide a trial of the xref:plugins.adoc#premium-plugins[Premium Plugins].
endif::[]

ifeval::["{productSource}" != "cloud"]
include::partial$misc/setting-the-license.adoc[]

For more information on licensing, see the xref:license-key.adoc[License Key] guide.
endif::[]

== Save the content from the editor

To retrieve content from the editor, either process the content with a form handler or use the xref:apis/tinymce.editor.adoc#getContent[getContent API].
Expand Down
29 changes: 29 additions & 0 deletions modules/ROOT/partials/misc/setting-the-license.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
== Setting the license

=== Use {productname} with the GPLv2+ license

If the developer intends to self-host {productname} under the GPL license, they can set the `license_key` config option to 'gpl'. Case sensitivity does not matter.

==== Example

[source,js]
----
tinymce.init({
selector: 'textarea', // change this value according to your HTML
license_key: 'gpl'
});
----

=== Use {productname} with a commercial license

If the developer intends to self-host {productname} under a commercial license, a valid license key must be provided. Customers who have purchased a self-hosted-eligible license for {productname} will find their license key in the link:https://www.tiny.cloud/auth/login/[account portal]. To purchase a commercial license, see available options on the link:{pricingpage}/[pricing page].

==== Example

[source,js]
----
tinymce.init({
selector: 'textarea', // change this value according to your HTML
license_key: '<your-license-key>'
});
----

0 comments on commit 6bdbdc3

Please sign in to comment.