Skip to content

Commit 5febf2f

Browse files
authored
Merge branch 'release/8.0.0' into feature/8.0.0/DOC-3147
2 parents 4128bb8 + 45240c5 commit 5febf2f

File tree

70 files changed

+2741
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2741
-270
lines changed

CONTRIBUTING.md

Lines changed: 83 additions & 85 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 59 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,101 @@
1-
# TinyMCE documentation
1+
# TinyMCE Documentation
22

3-
This project maintains the documentation for TinyMCE at
4-
[https://www.tiny.cloud/docs](https://www.tiny.cloud/docs). If you have any
5-
modifications you wish to contribute, fork this project, make the changes
6-
and submit a pull request. You will need to sign the contributor’s license
7-
agreement, which will be emailed to you upon creating the pull request.
3+
This project maintains the official documentation for TinyMCE, available at [https://www.tiny.cloud/docs](https://www.tiny.cloud/docs). If you have modifications or improvements to contribute, fork this repository, make the necessary changes, and submit a pull request (PR). A contributor's license agreement (CLA) must be signed before your contribution can be merged. This agreement will be sent via email when you create a PR.
84

9-
This project is built using [Antora](https://antora.org/).
5+
This project is built using [Antora](https://antora.org/), a powerful documentation site generator that supports multi-repository collaboration, content modularization, and flexible versioning.
106

117
## Contributing to the TinyMCE Documentation
128

13-
If you would like to contribute to the TinyMCE project please read the TinyMCE Documentation Contributor’s Guide at either:
9+
To contribute to the TinyMCE documentation project, please review the following resources:
1410

15-
- [TinyMCE Documentation - Contributor's Guide](https://www.tiny.cloud/docs/configure/contributing-docs/).
16-
- [GitHub - How to contribute to TinyMCE’s documentation](https://github.com/tinymce/tinymce-docs/blob/release/docs-6/CONTRIBUTING.md#how-to-contribute-to-tinymces-documentation).
11+
- [GitHub - How to contribute to TinyMCE’s documentation](https://github.com/tinymce/tinymce-docs/blob/main/CONTRIBUTING.md#how-to-contribute-to-tinymces-documentation)
1712

18-
## Working on TinyMCE documentation
13+
These guides cover contribution guidelines, project structure, style conventions, and best practices for submitting changes.
1914

20-
### Compiling or building the documentation
15+
## Setting Up Your Development Environment
2116

22-
The following procedure assists with building (or compiling) the documentation locally. Tiny recommends testing and reviewing changes locally prior to submitting a pull request.
17+
To contribute effectively, you should set up a local development environment. This allows you to preview and test your changes before submitting a PR.
2318

24-
#### Installing Prerequisites
19+
### Prerequisites
2520

26-
##### Linux users
21+
Ensure the following software is installed:
2722

28-
You need the following programs installed on your computer:
23+
- [Node.js](https://nodejs.org/en/) (version 22.9 or lower)
24+
- [Yarn](https://yarnpkg.com/)
25+
- Git
2926

30-
#### First time set up
27+
### Cloning the Repository
3128

32-
Once you have installed any missing prerequisites, in a terminal or on a command prompt:
29+
Clone the TinyMCE documentation repository:
3330

34-
1. Clone the git repository:
35-
```
36-
git clone [email protected]:tinymce/tinymce-docs.git
37-
```
38-
39-
2. Change directory into the cloned git repository:
40-
```
41-
cd tinymce-docs
42-
```
43-
44-
3. Run yarn install
45-
```
46-
yarn install
47-
```
31+
```bash
32+
git clone [email protected]:tinymce/tinymce-docs.git
33+
cd tinymce-docs
34+
yarn
35+
```
4836

49-
#### Run the development version of the documentation
37+
### Running the Development Server
5038

51-
To create a development version of the documentation, run:
39+
To build and serve the documentation locally:
5240

53-
```
41+
```bash
5442
yarn build
55-
yarn serve
43+
yarn start-dev
5644
```
5745

46+
Visit [http://127.0.0.1:4000](http://127.0.0.1:4000) to view the documentation. The server supports hot-reloading, so changes will automatically reflect when you save your work.
5847

59-
To view the documentation; in a web browser, navigate to [http://127.0.0.1:4000](http://127.0.0.1:4000).
60-
61-
> **Note**: The development version of the documentation will update automatically when you save changes locally.
48+
> **Note:** The `yarn build` command generates the API reference documentation from the TinyMCE source code. To adjust the API version, edit the `API_VERSION` variable in the `scripts/api-reference.sh` file. Alternatively, use `yarn build-local` to build using a local TinyMCE instance:
6249
63-
The `yarn build` step will download the latest TinyMCE package and generate new API reference content from source code. To change the version of TinyMCE API, open the `-scripts/api-reference.sh` file and edit the API_VERSION to the TinyMCE version you would like to generate API docs for. Alternatively, to build using a local version of TinyMCE, `yarn build-local ../path/to/local/TinyMCE`.
50+
Example:
6451

65-
> **Note**: The development server does not need to be stopped prior to running the `yarn build` command, antora should pick up the new changes generated by the build step.
52+
```bash
53+
yarn build-local ../path/to/local/tinymce
54+
```
6655

67-
#### TinyMCE API documentation
56+
### API Documentation
6857

69-
The TinyMCE API documentation is maintained within the [TinyMCE project repository](https://github.com/tinymce/tinymce) and compiled for the documentation site using [MoxieDoc](https://github.com/tinymce/moxiedoc).
58+
The TinyMCE API documentation is compiled and generated using [MoxieDoc](https://github.com/tinymce/moxiedoc) from the core [TinyMCE project repository](https://github.com/tinymce/tinymce). To update the published API docs:
7059

71-
To update the published API documentation:
60+
1. Update the `.api-version` file.
61+
2. Run `yarn build`:
7262

73-
1. Change the version in `.api-version`.
74-
2. Run `yarn build`.
63+
* Running `yarn build` downloads the TinyMCE package specified in `.api-version` and generates new API reference content from source.
7564
3. Commit the changes.
7665

77-
Running `yarn build` downloads the TinyMCE package specified in `.api-version` and generates new API reference content from source.
66+
> **Warning:** The API documentation should not be edited manually. Always generate it from source to ensure accuracy.
7867
79-
**Note:** The API documentation should never be edited manually.
68+
## Live Demos
8069

81-
##### Prerequisites
70+
Live demos can be added to the `modules/ROOT/examples/live-demos` directory. Reference them in your documentation with:
8271

83-
- [Node.js](https://nodejs.org/en/).
84-
85-
86-
### Live Demos
72+
```asciidoc
73+
liveDemo::{sub-directory-name}[]
74+
```
8775

88-
New live demos can be added to the [modules/ROOT/examples/live-demos directory](modules/ROOT/examples/live-demos). It then can be referenced in your doc with the following code:
76+
### Overriding the tinymce URL in Live Demos
8977

90-
```
91-
liveDemo::{sub-directory-name}[]
92-
```
78+
By default, live demos load TinyMCE from the URL specified in the `tinymce_live_demo_url` attribute in the `antora.yml` file. This can be overridden for specific use cases:
9379

94-
#### Overriding the tinymce URL in live demos
80+
* Testing a new feature on the `dev` channel.
81+
* Running the site locally while testing live demos on a different channel.
9582
96-
All live demos usually get their `tinymce.min.js` URL from the `tinymce_live_demo_url` setting in the `antora.yml` file.
97-
However, there are some instances where you wish to override this, e.g.
83+
To help with this, there are two mechanisms for overriding the `tinymce.min.js` URL:
9884

99-
- You want to push/deploy a branch for a new feature that's only on the 'dev' channel.
100-
- You want to run the site locally, but test out the live demos in a different channel.
85+
1. **Global Override:**
86+
To change the TinyMCE URL for all live demos, modify the `tinymce_live_demo_url` attribute in `antora-playbook-dev.yml`:
10187
102-
To help with this, there are two mechanisms for overriding the `tinymce.min.js` URL.
88+
```yaml
89+
asciidoc:
90+
attributes:
91+
tinymce_live_demo_url: https://your-custom-url.com/tinymce.min.js
92+
```
10393
104-
1. Change the URL for all live demos by setting the `tinymce_live_demo_url` attribute in `antora-playbook-dev.yml`. For example:
105-
```
106-
asciidoc
107-
attributes:
108-
tinymce_live_demo_url: URL_to_script_file
109-
```
94+
2. **Per-Demo Override:** Use the `script_url_override` attribute:
95+
To override the URL for a specific live demo:
11096
111-
2. Change the URL for an individual live demo by setting `script_url_override` attribute in the live demo markup. For example:
112-
```
113-
liveDemo::{sub-directory-name}[script_url_override='URL_to_script_file']
114-
```
97+
```asciidoc
98+
liveDemo::{sub-directory-name}[script_url_override='https://your-custom-url.com/tinymce.min.js']
99+
```
115100
116-
- This is useful if you want to deploy the develop branch for a feature only in the 'dev' channel.
117-
- This only overrides the URL for one live demo.
118-
- Don't use this in more than one live demo on a page.
119-
- Don't use this long-term - when the feature is fully rolled-out, use the standard channel.
101+
> **Caution:** Use this sparingly. Avoid using different URLs for multiple demos on the same page, and remember to revert these changes once the feature is fully released.

antora-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ content:
88
branches: HEAD
99
start_path: ./
1010
- url: https://github.com/tinymce/tinymce-docs.git
11-
branches: [ tinymce/5, tinymce/6, tinymce/7]
11+
branches: [ tinymce/5, tinymce/6, tinymce/7 ]
1212
urls:
1313
html_extension_style: indexify
1414
latest_version_segment: latest

antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ asciidoc:
1515
webcomponent_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-webcomponent/dist/tinymce-webcomponent.min.js
1616
jquery_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js
1717
openai_proxy_url: https://openai.ai-demo-proxy.tiny.cloud/v1/chat/completions
18-
openai_proxy_token: eyJhbGciOiJFUzM4NCJ9.eyJhdWQiOlsiaHR0cHM6Ly9vcGVuYWkuYWktZGVtby1wcm94eS50aW55LmNsb3VkLyJdLCJleHAiOjE3NTEzMjgwMDAsImh0dHBzOi8vb3BlbmFpLmFpLWRlbW8tcHJveHkudGlueS5jbG91ZC9yb2xlIjoicHVibGljLWRlbW8iLCJpc3MiOiJodHRwczovL2FpLWRlbW8tcHJveHkudGlueS5jbG91ZC8iLCJqdGkiOiJmOGFmY2EyNC1mN2FhLTQxMjktYTc2Yy02YThlZDU3YjAyZjYiLCJzdWIiOiJhaS1hc3Npc3RhbnQtZGVtbyJ9.Xu0apHCbxgmRQTeTqrTIDFFhh2CgKeARRXa3mCxSGoCwZqkoQaFRZBCzDo8Xz7DuUa5mW2XHl-HYcYiXJM9ly16d0oY7lJefHBeLlmJEBE1CSttHBkCRWZS8eFLCasL6
18+
openai_proxy_token: eyJhbGciOiJFUzM4NCJ9.eyJhdWQiOlsiaHR0cHM6Ly9vcGVuYWkuYWktZGVtby1wcm94eS50aW55LmNsb3VkLyJdLCJleHAiOjE3ODI4NjQwMDAsImh0dHBzOi8vb3BlbmFpLmFpLWRlbW8tcHJveHkudGlueS5jbG91ZC9yb2xlIjoicHVibGljLWRlbW8iLCJpc3MiOiJodHRwczovL2FpLWRlbW8tcHJveHkudGlueS5jbG91ZC8iLCJqdGkiOiIxZWY3NjJiNi1mZDYyLTQ3ZWQtOGRkNS0yOGRmMzBkZDU4YmMiLCJzdWIiOiJhaS1hc3Npc3RhbnQtZGVtbyJ9.WC8GIY19MgZneDVZoA-Ttt9E7gNkD0Yl-pcM_5c2RT3RdV_zE0i4bPOGBJpg_g6wu_4ki2ery6_JZtk2Q9gXEBHH7fIu7hXDFS8uIV9qe8MyxEqqRncGFVDjSTldVXGS
1919
default_meta_keywords: tinymce, documentation, docs, plugins, customizable skins, configuration, examples, html, php, java, javascript, image editor, inline editor, distraction-free editor, classic editor, wysiwyg
2020
# product docker variables
2121
dockerimageimportfromwordexporttoword: registry.containers.tiny.cloud/docx-converter-tiny

modules/ROOT/examples/live-demos/comments-callback-with-mentions/index.js

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then(({ faker }) => {
2+
/* This represents a database of users on the server */
23
const userDb = {
34
'michaelcook': {
45
id: 'michaelcook',
56
name: 'Michael Cook',
6-
fullName: 'Michael Cook',
7-
description: 'Product Owner',
8-
image: "{{imagesdir}}/avatars/michaelcook.png"
7+
avatar: '{{imagesdir}}/avatars/michaelcook.png',
8+
custom: {
9+
fullName: 'Michael Cook',
10+
description: 'Product Owner'
11+
}
912
},
1013
'kalebwilson': {
1114
id: 'kalebwilson',
1215
name: 'Kaleb Wilson',
13-
fullName: 'Kaleb Wilson',
14-
description: 'Marketing Director',
15-
image: "{{imagesdir}}/avatars/kalebwilson.png"
16+
avatar: '{{imagesdir}}/avatars/kalebwilson.png',
17+
custom: {
18+
fullName: 'Kaleb Wilson',
19+
description: 'Marketing Director',
20+
}
1621
}
1722
};
1823

@@ -35,7 +40,7 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
3540
const getAuthorInfo = (uid) => {
3641
const user = userDb[uid];
3742
if (user) {
38-
return fillAuthorInfo(user.id, user.fullName, user.image);
43+
return fillAuthorInfo(user.id, user.custom.fullName, user.avatar);
3944
}
4045
return {
4146
author: uid,
@@ -85,8 +90,8 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
8590
const resolvedConversationDb = {};
8691

8792
const setupFakeServer = () => {
88-
const images = [ adminUser.image, currentUser.image ];
89-
const userNames = [ adminUser.fullName, currentUser.fullName ];
93+
const images = [ adminUser.avatar, currentUser.avatar ];
94+
const userNames = [ adminUser.custom.fullName, currentUser.custom.fullName ];
9095

9196
for (let i = 0; i < numberOfUsers; i++) {
9297
images.push(faker.image.avatar());
@@ -99,14 +104,16 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
99104
[currentUser.id]: currentUser
100105
};
101106
userNames.map((fullName) => {
102-
if ((fullName !== currentUser.fullName) && (fullName !== adminUser.fullName)) {
107+
if ((fullName !== currentUser.custom.fullName) && (fullName !== adminUser.custom.fullName)) {
103108
const id = fullName.toLowerCase().replace(/ /g, '');
104109
userDb[id] = {
105110
id,
106111
name: fullName,
107-
fullName,
108-
description: faker.person.jobTitle(),
109-
image: images[Math.floor(images.length * Math.random())]
112+
avatar: images[Math.floor(images.length * Math.random())],
113+
custom: {
114+
fullName,
115+
description: faker.person.jobTitle(),
116+
}
110117
};
111118
}
112119
});
@@ -118,8 +125,8 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
118125
const users = Object.keys(userDb).map((id) => ({
119126
id,
120127
name: userDb[id].name,
121-
image: userDb[id].image,
122-
description: userDb[id].description
128+
image: userDb[id].avatar,
129+
description: userDb[id].custom.description
123130
}));
124131
resolve(users);
125132
}, fakeDelay);
@@ -320,9 +327,6 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
320327
});
321328
setTimeout(() => done({ conversations: fetchedConversations }), fakeDelay);
322329
};
323-
324-
// Read the above `getAuthorInfo` function to see how this could be implemented
325-
const tinycomments_fetch_author_info = (done) => done(getAuthorInfo(currentUid));
326330

327331
tinymce.init({
328332
selector: 'textarea#comments-callback-with-mentions',
@@ -350,9 +354,16 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
350354
mentions_select,
351355

352356
tinycomments_mode: 'callback',
353-
tinycomments_author: currentUser.id,
354-
tinycomments_author_name: currentUser.fullName,
355-
tinycomments_avatar: currentUser.image,
357+
user_id: currentUser.id,
358+
fetch_users: (userIds) => {
359+
return Promise.all(
360+
userIds.map(
361+
(userId) => new Promise(
362+
(resolve) => resolve(userDb[userId] || { id: userId })
363+
)
364+
)
365+
)
366+
},
356367
tinycomments_create,
357368
tinycomments_reply,
358369
tinycomments_delete,
@@ -362,6 +373,5 @@ import ('https://cdn.jsdelivr.net/npm/@faker-js/faker@9/dist/index.min.js').then
362373
tinycomments_delete_comment,
363374
tinycomments_edit_comment,
364375
tinycomments_fetch,
365-
tinycomments_fetch_author_info
366376
});
367377
});

0 commit comments

Comments
 (0)