Skip to content

Commit 7b36fac

Browse files
committed
DOC-3329: Re-feactor editor-skin, editor-icon and all related partials for better flow, and add references to NPM.
1 parent fcbd052 commit 7b36fac

File tree

13 files changed

+134
-83
lines changed

13 files changed

+134
-83
lines changed

modules/ROOT/pages/bundling-icons.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following examples show how to bundle icon packs using different module synt
2626
|====
2727
|Module Syntax |Source |Example
2828

29-
.2+|ES6+
29+
.3+|ES6+
3030
|npm (community)
3131
a|
3232
[source, js]
@@ -48,7 +48,7 @@ a|
4848
import '../tinymce/icons/material/icons';
4949
----
5050

51-
.2+|Common JS
51+
.3+|Common JS
5252
|npm (community)
5353
a|
5454
[source, js]

modules/ROOT/pages/bundling-plugins.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ tinymce.init({
141141
license_key: 'T8LK:...', // Your commercial license key
142142
external_plugins: {
143143
'advcode': '<path_to_premium_plugins>/advcode/plugin.min.js',
144-
'licensekeymanager': '<path_to_premium_plugins>/licensekeymanager/plugin.min.js',
145-
'tinycomments': '<path_to_premium_plugins>/tinycomments/plugin.min.js'
144+
'tinycomments': '<path_to_premium_plugins>/tinycomments/plugin.min.js',
145+
// Always include the licensekeymanager plugin when using premium plugins with a commercial license.
146+
'licensekeymanager': '<path_to_premium_plugins>/licensekeymanager/plugin.min.js'
146147
},
147148
plugins: 'advcode tinycomments',
148149
// ... other configuration

modules/ROOT/pages/editor-icons.adoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22
:navtitle: Icons
33
:description: Configure the editor's toolbar button and menu item icons.
44

5+
{productname} icons come from icon packs. {productname} includes both community and premium icon packs, but also allows integrators to add custom icons or override {productname} icons with their own.
6+
7+
The default icon pack is shipped with {productname} and does not require any configuration, though it must be imported when bundling for deployment:
8+
9+
[source,js]
10+
----
11+
import 'tinymce/icons/default';
12+
----
13+
14+
Replacing the default icon can be done using the `+icons+` and `+icons_url+` settings.
15+
16+
== Available icon packs
17+
18+
{productname} includes both community and premium icon packs:
19+
20+
* **Community**: `default` (always required)
21+
* **Premium**: `bootstrap`, `jam`, `material`, `small`, `thin` (available with paid subscriptions)
22+
23+
For information on which icon packs work best with which skins, see: xref:enhanced-skins-and-icon-packs.adoc#icon-pack-compatibility-matrix[Icon pack compatibility matrix].
24+
25+
== Custom icon packs
26+
27+
For information on creating custom icon packs, see: xref:creating-an-icon-pack.adoc[Create an icon pack for {productname}].
28+
29+
The value passed to `+icons+` must match the pack name defined either:
30+
31+
* Passed to `+tinymce.IconManager.add+` when registering the icon pack via JavaScript; or
32+
* Specified in the `+package.json+` `+iconPackName+` field when creating the icon pack using the xref:creating-an-icon-pack.adoc#download-and-setup-the-icon-pack-template[Icon Pack Template].
33+
34+
== Replacing the default icon pack
35+
536
include::partial$misc/icons-or-icons_url.adoc[]
637

738
include::partial$configuration/icons.adoc[]

modules/ROOT/pages/editor-skin.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22
:navtitle: Skins
33
:description: Configure the editor's overall appearance.
44

5+
{productname} comes with several premium skins which change the look of the editor. These skins are an easy way to restyle {productname} to better suit applications.
6+
7+
[NOTE]
8+
====
9+
*Skins vs Content CSS:*
10+
11+
Skins change both the look of {productname}'s UI and the editable area. To change only the look of the editable area, use xref:add-css-options.adoc#content_css[`+content_css+`].
12+
====
13+
14+
The default skin does not require any configuration, though it must be imported when bundling for deployment:
15+
16+
[source,js]
17+
----
18+
import 'tinymce/skins/ui/oxide/skin';
19+
----
20+
21+
Replacing the default skin uses the `+skin+` and `+skin_url+` settings.
22+
23+
== Available skins
24+
25+
See xref:enhanced-skins-and-icon-packs.adoc[Enhanced Skins & Icon Packs] for a list of available skins and the icon packs which look best with each skin.
26+
27+
== Custom skins
28+
29+
Integrators can create and use their own skin files. For information on creating custom skins, see: xref:creating-a-skin.adoc[Create a skin for {productname}].
30+
31+
== Replacing the default skin
32+
533
include::partial$misc/skin-or-skin_url.adoc[]
634

735
include::partial$configuration/skin.adoc[]

modules/ROOT/pages/license-key.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ To obtain a new {productname} 8 license key (T8LK-prefixed):
223223
Existing {productname} 7 license keys cannot be modified to work with {productname} 8 by adding the T8LK prefix. A new {productname} 8 license must be obtained through the proper channels listed above.
224224
====
225225

226-
=== If im upgrading from TinyMCE 7 how do I get a TinyMCE 8 license key?
226+
=== When upgrading from {productname} 7, what is the process for obtaining a {productname} 8 license key?
227227

228228
If you are using {cloudname} (cloud-hosted):
229229

modules/ROOT/partials/configuration/icons.adoc

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,13 @@ ifeval::[{customIconPack} != true]
33
[[icons]]
44
== `+icons+`
55

6-
The *icons* option allows the editor icons to be extended or replaced using an icon pack. For information on creating icon packs, see: xref:creating-an-icon-pack.adoc[Create an icon pack for {productname}].
6+
The *icons* option allows the editor icons to be extended or replaced using an icon pack. The icon pack is specified by name.
77

88
*Type:* `+String+`
99
endif::[]
1010

1111
On initialization, {productname} will try to load any icon pack specified by the *icons* option. The icons in the icon pack will be merged with xref:editor-icon-identifiers.adoc[{productname}'s default icons] and icons in the icon pack will overwrite the default icons with the same identifier.
1212

13-
{productname} loads icon packs from the path `+TINYMCE_BASE/icons/${iconPackName}/icons.js+`; where:
14-
15-
* `+TINYMCE_BASE+` is the {productname} root directory (the directory containing `+tinymce.min.js+`).
16-
* `+${iconPackName}+` is the name of the icon pack.
17-
18-
== Available icon packs
19-
20-
{productname} includes both community and premium icon packs:
21-
22-
* **Community**: `default` (always required)
23-
* **Premium**: `bootstrap`, `jam`, `material`, `small`, `thin` (available with paid subscriptions)
24-
25-
For information on creating custom icon packs, see: xref:creating-an-icon-pack.adoc[Create an icon pack for {productname}].
26-
27-
== Usage
28-
29-
To use a {productname} icon pack:
30-
31-
. If required, create a new `+icons+` directory in `+TINYMCE_BASE+`.
32-
. Copy the icon pack into the `+icons+` directory.
33-
ifeval::[{customIconPack} == true]
34-
For example:
35-
+
36-
[source,sh]
37-
----
38-
$ cp -r dist/icons/my_icon_pack TINYMCE_BASE/icons/
39-
----
40-
41-
endif::[]
42-
43-
. Add the `+icons+` option to `+tinymce.init+`.
44-
4513
ifeval::[{customIconPack} == true]
4614
For custom icon packs:
4715

@@ -56,7 +24,7 @@ tinymce.init({
5624
endif::[]
5725
ifeval::[{customIconPack} != true]
5826

59-
=== Example: using premium icon packs
27+
=== Example: using a premium icon pack
6028

6129
[source,js]
6230
----
@@ -72,7 +40,7 @@ tinymce.init({
7240
});
7341
----
7442

75-
=== Example: using multiple icon packs
43+
=== Example: using icon packs with matching skins and content styling
7644

7745
[source,js]
7846
----

modules/ROOT/partials/configuration/icons_url.adoc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ ifeval::[{customIconPack} != true]
33
[[icons_url]]
44
== `+icons_url+`
55

6-
The *icons_url* option allows the editor icons to be extended or replaced using an icon pack. For information on creating icon packs, see: xref:creating-an-icon-pack.adoc[Create an icon pack for {productname}].
7-
endif::[]
6+
The *icons_url* option allows integrators to specify a non-default location to load icon packs from. This is useful when {productname} and the icon pack are loaded from different locations. For example: When loading {productname} from {cloudname}, the icon pack can be loaded from a different web server.
87

9-
On initialization, {productname} will try to load any icon pack specified by the *icons_url* option. The icons in the icon pack will be merged with xref:editor-icon-identifiers.adoc[{productname}'s default icons] and icons in the icon pack will overwrite the default icons with the same identifier.
8+
*Type:* `+String+`
9+
endif::[]
1010

11-
`+icons_url+` is used to specify the location of an icon pack when {productname} and the icon pack are loaded from different locations. For example: When loading {productname} from {cloudname}, the icon pack can be loaded from a different web server.
11+
On initialization, {productname} will try to load any icon pack specified by the *icons* option from the location specified by *icons_url*. The icons in the icon pack will be merged with xref:editor-icon-identifiers.adoc[{productname}'s default icons] and icons in the icon pack will overwrite the default icons with the same identifier.
1212

1313
[IMPORTANT]
1414
====
@@ -30,7 +30,6 @@ tinymce.init({
3030
});
3131
----
3232
33-
The `icons` value must match the pack name defined in your `package.json` `iconPackName` field.
3433
====
3534

3635
== Usage
@@ -39,6 +38,7 @@ To use a {productname} icon pack from a separate location:
3938

4039
. Ensure the icon pack is available at the specified URL.
4140
. Add the `+icons_url+` option to `+tinymce.init+`.
41+
. Specify the icon pack name using the `+icons+` setting.
4242

4343
ifeval::[{customIconPack} == true]
4444
For custom icon packs:
@@ -92,7 +92,6 @@ tinymce.init({
9292

9393
endif::[]
9494
ifeval::[{customIconPack} != true]
95-
*Type:* `+String+`
9695

9796
=== Example: using `+icons_url+`
9897

@@ -113,13 +112,13 @@ tinymce.init({
113112

114113
=== Example: loading premium icons from `+tinymce-premium+` (NPM)
115114

116-
When installing the `+tinymce-premium+` NPM package, premium icon packs are stored in `+node_modules/tinymce-premium/icons/+`. Configure `+icons_url+` to point at the desired icon pack file. For example:
115+
When installing the `+tinymce-premium+` NPM package, premium icon packs are stored in `+node_modules/tinymce-premium/icons/+`. Configure `+icons_url+` to point at the desired icon pack file. The path is relative to where {productname} is loaded from. For example:
117116

118117
[source,js]
119118
----
120119
tinymce.init({
121120
selector: 'textarea',
122-
icons_url: '/node_modules/tinymce-premium/icons/material/icons.js',
121+
icons_url: '../../node_modules/tinymce-premium/icons/material/icons.js',
123122
icons: 'material'
124123
});
125124
----
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[[skin]]
22
== `+skin+`
33

4-
This option allows you to specify the skin that {productname} should use, or `+false+` to not load a skin. The default skin included with {productname} is named "oxide".
4+
This option specifies the skin that {productname} should use, or `+false+` to not load a skin. The default skin included with {productname} is named "oxide".
55

66
*Type:* `+String+` or `+Boolean+`
77

88
*Default value:* `+'oxide'+`
99

1010
*Possible values:* the name of a skin or `+false+`
1111

12-
The name of the skin should match the name of the folder within the skins directory of {productname}. If the specified skin is not found, {productname} will not load.
12+
The name of the skin should match the name of the folder within the `+skins/ui+` directory of {productname}. If the specified skin is not found, {productname} will not load.
1313

1414
[source,js]
1515
----
1616
tinymce.init({
17-
selector: 'textarea', // change this value according to your HTML
18-
skin: 'oxide'
17+
selector: 'textarea', // change this value according to the HTML
18+
skin: 'fabric'
1919
});
2020
----
2121

22-
If you would like to create your own skin, please see the guide xref:creating-a-skin.adoc[here].
22+
For information on creating custom skins, see: xref:creating-a-skin.adoc[Create a skin for {productname}].

modules/ROOT/partials/configuration/skin_url.adoc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
[[skin_url]]
22
== `+skin_url+`
33

4-
If you are using {productname} skins, this option enables you to specify the location of the skin directory. This is useful if you are loading {productname} from one URL, for example a CDN, while loading a skin on, say, a local server.
4+
This option specifies the location of the skin directory. This is useful when loading {productname} and the skin files from different locations.
5+
6+
When using `+skin_url+`, the `+skin+` option is not required. The `+skin_url+` option points directly to the skin directory location.
57

68
*Type:* `+String+`
79

810
=== Example: using `+skin_url+`
911

10-
[source,js,subs="attributes+"]
12+
[source,js]
1113
----
1214
tinymce.init({
13-
selector: 'textarea', // change this value according to your HTML
14-
skin_url: '/css/my{prodnamecode}skin'
15+
selector: 'textarea', // change this value according to the HTML
16+
skin_url: '/css/mytinymceskin' // change this to point to the folder of skin files
1517
});
1618
----
1719

1820
=== Example: loading premium skins from `+tinymce-premium+` (NPM)
1921

20-
When installing the `+tinymce-premium+` NPM package, premium skins are stored in `+node_modules/tinymce-premium/skins/+`. Configure `+skin_url+` to point at the desired skin directory. For example:
22+
When installing the `+tinymce-premium+` NPM package, premium skins are stored in `+node_modules/tinymce-premium/skins/ui/+`. Configure the `+skin_url+` to point at the desired skin directory. For example:
2123

2224
[source,js]
2325
----
2426
tinymce.init({
2527
selector: 'textarea',
26-
skin_url: '/node_modules/tinymce-premium/skins/ui/oxide',
27-
skin: 'oxide'
28+
skin_url: '/node_modules/tinymce-premium/skins/ui/fabric'
2829
});
2930
----
3031

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
There are two options for replacing the icons in {productname}: `+icons+` and `+icons_url+`.
1+
There are two options related to replacing the icons in {productname}: `+icons+` and `+icons_url+`.
22

3-
* Use the `+icons+` option when icon packs are in the default location (for {cloudname} deployments, ZIP bundles, or when using NPM packages with bundling or file layering).
4-
* Use the `+icons_url+` option to specify a custom path to icon packs, which is useful for custom icon packs or when using NPM packages without bundling.
3+
* `+icons+` specifies *which* icon pack to use.
4+
* `+icons_url+` specifies *where* to find that icon pack if it is not in the **default location**.
5+
6+
If only `+icons+` is configured, {productname} will try to load the specified icon pack from `+TINYMCE_BASE/icons/${iconPackName}/icons.js+`; where:
7+
8+
* `+TINYMCE_BASE+` is the {productname} root directory (the directory containing `+tinymce.min.js+`).
9+
* `+${iconPackName}+` is the name of the icon pack.
10+
11+
To load icon packs from another location, integrators must specify that location using `+icons_url+`.
12+
13+
* When using {productname} from {cloudname}, ZIP bundles, or NPM packages with bundling or file layering, only `+icons+` should be required.
14+
* When using custom icon packs or using NPM packages without bundling, `+icons_url+` will likely also be required.

0 commit comments

Comments
 (0)